Re: How to best sort in a pre-defined item-by-item order ...
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 49725
interpreted = N
texte = How do you plan to have the visitor specify this order?Have you gotten that far yet?I once created a My Shopping List feature for an online grocer. Thevisitor was able to create various shopping lists, such as Camping,Bathroom, Picnic, etc. Of course the visitor had to Become A Memberin order to use this feature, which gave him/her a unique member ID.The way I approached that situation was to create a shoppinglists.dbwhere each shopping list was recorded with the member ID, name of list,sku, item, price, last purchased, etc. As the visitor accessed hisShopping Lists, of course there was a default sort, but then he couldselect from various the sort orders.Unfortunately, I can't say much about performance. The project wasclosed because the client didn't want to pay up. ho hum But my theoryin this approach was that it would be less stress for WebDNA to do onesearch by recording the basic item information rather than forcingmultiple searches to pull the item information from the main itemdatabase.Just my take.-----Original Message-----From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf OfKenneth GromeSent: Wednesday, April 23, 2003 10:29 AMTo: WebDNA TalkSubject: How to best sort in a pre-defined item-by-item order ...I have two db's, a visitors.db and a products.db.I want to keep a list of a visitor's favorite products in the favorites field in his visitors.db record. My plan is to make this a comma-delimited list, and to store the sku of each favorite item in this field. But I do not want these skus stored randomly. Instead, I want them stored in the same order that the visitor wants to see them displayed when he clicks a link to View My Favorite Products.It's easy enough to store a bunch of comma-separated skus in the favorites field in a database record. And it's even easy to get WebDNA to store these skus in the specific order the visitor wants to see them when he views them in his browser. But ...If I'm going to perform a search in the products.db for the specific skus that appear in the favorites field of a visitors.db record, how do I make WebDNA sort the founditems in the order that the skus appear in my search parameters?Is this a case where I have to create a separate database, or a temporary database, just to get the founditems to appear in the specific item-by-item order I need?Or would a listwords loop with a bunch of lookups (or exact-match searches) be a better way to force the display into the proper order?Basically I'm looking for some theoretical (and hopefully some informed technical) answers to this problem -- answers that consider the relative performance hits of each proposed technique -- so I can select the technique that will produce fast results with the smallest performance hit to the WebDNA engine.I can see now that occasionally, such as in this situation, it would be really cool to be able to sort the founditems based on the order of the values as they appear in the search parameters. How hard would this be to add as a feature to WebDNA?I'm imagining a new set of parameter such as sortOrder=12,34,51,19,63,11,49&sortField=SKU ... which would tell WebDNA to sort the results in the order that the 'sortOrder' values appear when each of those comma-separated values is found in the 'SKU' field ...-- Sincerely,Kenneth Grome----------------------------------------------Wholesale WebDNA programming only $27 an hour!-----------------------------------------------------------------------------------------------------------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 toWeb Archive of this list is at: http://webdna.smithmicro.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:
How do you plan to have the visitor specify this order?Have you gotten that far yet?I once created a My Shopping List feature for an online grocer. Thevisitor was able to create various shopping lists, such as Camping,Bathroom, Picnic, etc. Of course the visitor had to Become A Memberin order to use this feature, which gave him/her a unique member ID.The way I approached that situation was to create a shoppinglists.dbwhere each shopping list was recorded with the member ID, name of list,sku, item, price, last purchased, etc. As the visitor accessed hisShopping Lists, of course there was a default sort, but then he couldselect from various the sort orders.Unfortunately, I can't say much about performance. The project wasclosed because the client didn't want to pay up. ho hum But my theoryin this approach was that it would be less stress for WebDNA to do onesearch by recording the basic item information rather than forcingmultiple searches to pull the item information from the main itemdatabase.Just my take.-----Original Message-----From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf OfKenneth GromeSent: Wednesday, April 23, 2003 10:29 AMTo: WebDNA TalkSubject: How to best sort in a pre-defined item-by-item order ...I have two db's, a visitors.db and a products.db.I want to keep a list of a visitor's favorite products in the favorites field in his visitors.db record. My plan is to make this a comma-delimited list, and to store the sku of each favorite item in this field. But I do not want these skus stored randomly. Instead, I want them stored in the same order that the visitor wants to see them displayed when he clicks a link to View My Favorite Products.It's easy enough to store a bunch of comma-separated skus in the favorites field in a database record. And it's even easy to get WebDNA to store these skus in the specific order the visitor wants to see them when he views them in his browser. But ...If I'm going to perform a search in the products.db for the specific skus that appear in the favorites field of a visitors.db record, how do I make WebDNA sort the founditems in the order that the skus appear in my search parameters?Is this a case where I have to create a separate database, or a temporary database, just to get the founditems to appear in the specific item-by-item order I need?Or would a listwords loop with a bunch of lookups (or exact-match searches) be a better way to force the display into the proper order?Basically I'm looking for some theoretical (and hopefully some informed technical) answers to this problem -- answers that consider the relative performance hits of each proposed technique -- so I can select the technique that will produce fast results with the smallest performance hit to the WebDNA engine.I can see now that occasionally, such as in this situation, it would be really cool to be able to sort the founditems based on the order of the values as they appear in the search parameters. How hard would this be to add as a feature to WebDNA?I'm imagining a new set of parameter such as sortOrder=12,34,51,19,63,11,49&sortField=SKU ... which would tell WebDNA to sort the results in the order that the 'sortOrder' values appear when each of those comma-separated values is found in the 'SKU' field ...-- Sincerely,Kenneth Grome----------------------------------------------Wholesale WebDNA programming only $27 an hour!-----------------------------------------------------------------------------------------------------------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 toWeb Archive of this list is at: http://webdna.smithmicro.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/
Kimberly D. Walls
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:
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
Bug Report, maybe (1997)
Searchable WebCat (etc.) Docs ? (1997)
[Cart] ... (1997)
Status? (2000)
mySQL or MS SQL (2000)
BBedit Syntax coloring.... (2000)
OS X problem: when using [ShowCart] or [orderfile]... (2000)
WebCommerce Security Alert! (1996)
apostrophe in search item (1997)
[WriteFile] problems (1997)
Database Not Found Problem (2004)
using webcat with web* & web*SSL (1998)
Comments in db? (1997)
tabs as delimiters (2004)
Maybe off topic but how to charge (1997)
[WebDNA] CICADA (2009)
WebCat-Typhoon-WebTen (1998)
Table sorting by selected category then others (2004)
Individual Tax on Items (1998)