Re: Sorting by highest number of matches unique to a field
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 52131
interpreted = N
texte = You could store the total number of messages in a thread in the first message for that thread (msg_rank=0, if I understand you scheme correctly) - say a "msg_count" field. When you add a message to the thread, increment "msg_count" in the first thread message. Then you could sort with[search db=db/ messages.db&eqmsg_rankdatarq=0&allhit=1&demsg_countsort=1&msg_counttype= num]No need to summ since you only find the first message per thread.- brianOn Friday, August 8, 2003, at 11:17 AM, Robert Wade wrote:> I've tried this. In fact, I do have a ranking system that is exactly > how you described. Every post in the board belongs to a [msg_id] > (which identifies the thread), and every post also gets a [msg_rank] > (starting with 0).>> I tried a search like the following, hoping that it would work, but > the problem is that the results are summarized BEFORE they are sorted. > Therefore, it uses the first match of the msg_ranks within that > particular msg_id and uses it for the summ. Ideally, it would sort > the results FIRST, then summarize them using the top result dependent > upon your sort order. Seems like sort and summ could play together a > little nicer.>> [search > db=db/ > messages.db&nemsg_rankdatarq=[blank]&demsg_ranksort=1&msg_ranktype=num& > msg_idsumm=T]>>> On Friday, August 8, 2003, at 12:29 PM, WebDna @ wrote:>>> I have been looking into index searching alot lately. It may not be >> exactly>> what you want, but it may be along the right premise to getting what >> you>> need.>>>> Add an additional field to the DB or make a new DB that is associated >> with>> the main topic ID and it will contain a number. Starting out with 0 >> and then>> increase by one everytime someone post a reply to it.>>>> This would allow you to show the number of replies to a specific post>> without having to search and sum.>>>> Is this possible for you?>>>>>> ----- Original Message ----->> From: "Robert Wade"
>> To: "WebDNA Talk" >> Sent: Friday, August 08, 2003 10:12 AM>> Subject: Re: Sorting by highest number of matches unique to a field>>>>>>> Kenneth, Thanks. I just tried a slimmed down search with no sort>>> specified...>>>>>> [search db=db/messages.db&nemsg_iddatarq=[blank]&msg_idsumm=T&max=10]>>> [founditems]>>> ...>>> [/founditems]>>> [/search]>>>>>> What you are saying, is that this would list the [msg_id] at the top>>> that had the most matches? It didn't.>>>>>> this search seemed to randomly, pick out 10 results. I could not >>> find>>> a pattern to the sort at all. It just grabbed 10 of them out of>>> seemingly anywhere in the db., of those the highest number was 10>>> matches. I know that one [msg_id] in particular has over 200 posts,>>> and there are many that have more than 10.>>>>>> I thought that the default sort was "best match" not "most matches" >>> In>>> otherwords the results that "best match" the search criteria, not the>>> results that have the most matches...?>>>>>> -- Confused.>>>>>>>>> On Friday, August 8, 2003, at 11:27 AM, Kenneth Grome wrote:>>>>>>>> I was hoping to get a clearer understanding of the possibility of>>>>> sorting a search by entries that have the most number of matches>>>>> first.>>>>>-- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com ---------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
You could store the total number of messages in a thread in the first message for that thread (msg_rank=0, if I understand you scheme correctly) - say a "msg_count" field. When you add a message to the thread, increment "msg_count" in the first thread message. Then you could sort with[search db=db/ messages.db&eqmsg_rankdatarq=0&allhit=1&demsg_countsort=1&msg_counttype= num]No need to summ since you only find the first message per thread.- brianOn Friday, August 8, 2003, at 11:17 AM, Robert Wade wrote:> I've tried this. In fact, I do have a ranking system that is exactly > how you described. Every post in the board belongs to a [msg_id] > (which identifies the thread), and every post also gets a [msg_rank] > (starting with 0).>> I tried a search like the following, hoping that it would work, but > the problem is that the results are summarized BEFORE they are sorted. > Therefore, it uses the first match of the msg_ranks within that > particular msg_id and uses it for the summ. Ideally, it would sort > the results FIRST, then summarize them using the top result dependent > upon your sort order. Seems like sort and summ could play together a > little nicer.>> [search > db=db/ > messages.db&nemsg_rankdatarq=[blank]&demsg_ranksort=1&msg_ranktype=num& > msg_idsumm=T]>>> On Friday, August 8, 2003, at 12:29 PM, WebDna @ wrote:>>> I have been looking into index searching alot lately. It may not be >> exactly>> what you want, but it may be along the right premise to getting what >> you>> need.>>>> Add an additional field to the DB or make a new DB that is associated >> with>> the main topic ID and it will contain a number. Starting out with 0 >> and then>> increase by one everytime someone post a reply to it.>>>> This would allow you to show the number of replies to a specific post>> without having to search and sum.>>>> Is this possible for you?>>>>>> ----- Original Message ----->> From: "Robert Wade" >> To: "WebDNA Talk" >> Sent: Friday, August 08, 2003 10:12 AM>> Subject: Re: Sorting by highest number of matches unique to a field>>>>>>> Kenneth, Thanks. I just tried a slimmed down search with no sort>>> specified...>>>>>> [search db=db/messages.db&nemsg_iddatarq=[blank]&msg_idsumm=T&max=10]>>> [founditems]>>> ...>>> [/founditems]>>> [/search]>>>>>> What you are saying, is that this would list the [msg_id] at the top>>> that had the most matches? It didn't.>>>>>> this search seemed to randomly, pick out 10 results. I could not >>> find>>> a pattern to the sort at all. It just grabbed 10 of them out of>>> seemingly anywhere in the db., of those the highest number was 10>>> matches. I know that one [msg_id] in particular has over 200 posts,>>> and there are many that have more than 10.>>>>>> I thought that the default sort was "best match" not "most matches" >>> In>>> otherwords the results that "best match" the search criteria, not the>>> results that have the most matches...?>>>>>> -- Confused.>>>>>>>>> On Friday, August 8, 2003, at 11:27 AM, Kenneth Grome wrote:>>>>>>>> I was hoping to get a clearer understanding of the possibility of>>>>> sorting a search by entries that have the most number of matches>>>>> first.>>>>>-- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com ---------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Brian Fries
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Make sure I understand this??? (1997)
[search] & [encrypt]/[decrypt] (2001)
Is this really true... (2006)
emailer (1997)
RE: protect tag on NT (1997)
[WebDNA] agree? --> [url] broken inside [redirect], on a square-bracket-style include, included from a XML-style page (2009)
Unexpected comparison behavior change in 4.5.1 (2003)
setting taxable to true (1997)
WebCat2: Formulas.db question (1997)
WebDNA performance comparisons? (2004)
test 3 (2003)
Other then credit cards-how? (1997)
[WebDNA] WSDL Wizzard (2009)
[WebDNA] Daily tasks without triggers (2011)
Help! WebCat2 bug (1997)
Putting together a econimic server (2004)
is there a global includes directory? (1998)
shipping help (1998)
Verisign is at it again (2003)
WebMerchant and PC Auth Hub (1999)