Re: [WebDNA] Nested Search
This WebDNA talk-list message is from 2008
It keeps the original formatting.
numero = 101482
interpreted = N
texte = --=====================_435295046==.ALTContent-Type: text/plain; charset="us-ascii"To be sure, you can set the [numfound] from the inner search to a text variable - [search db=^db/products.db&eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]][text show=f]THISFIND=[numfound][/text][showif [THISFIND]>100]....[/showif]At 09:37 AM 11/20/2008, you wrote:>I'm trying to generate a link to similar items from our item detail page.>>Currently, our item detail page is generated by doing a search on our products database for the sku and passing that sku to a search request:>>[search db=^db/products.db&eqSKUdatarq=[s]]>>Once inside of this search, I want to do a second search for items that have the same categories as the found item. If the numfound is greater than 100, I want to automatically create a link with 3 categories. If the numfound is less than 100, I want to automatically create a link with only 2 categories:>>[search db=^db/products.db&eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]]> [showif [numfound]>100]>
See similar items (includes cat 3)>[/showif]>>[showif [numfound]<100]>
See similar items (does not include cat 3)>[/showif]>>[/search]>>The problem is, I think since this search is being done within the first search context, the numfound is always going to be 1.>>How can I do this so that this search is independent of the first search, but is still able to use the categories of the sku found in the first search?--=====================_435295046==.ALTContent-Type: text/html; charset="us-ascii"
To be sure, you can set the [numfound] from the inner searchto a text variable -
[searchdb=^db/products.db&eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]]
[text show=f]THISFIND=[numfound][/text]
[showif [THISFIND]>100]....[/showif]
At 09:37 AM 11/20/2008, you wrote:
I'm trying to generate a link tosimilar items from our item detail page.
Currently, our item detail page is generated by doing a search on ourproducts database for the sku and passing that sku to a searchrequest:
[search db=^db/products.db&eqSKUdatarq=[s]]
Once inside of this search, I want to do a second search for items thathave the same categories as the found item. If the numfound is greaterthan 100, I want to automatically create a link with 3 categories. If thenumfound is less than 100, I want to automatically create a link withonly 2 categories:
[searchdb=^db/products.db&eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]]
[showif[numfound]>100]
<ahref="http://www.knifecenter.com/kc_new/store_store.html?ttl=KNIFECENTER%20LISTINGS&srch=eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]%26eqWWWCAT_3datarq%3D[WWWCAT_3]">See similar items (includes cat 3)</a>
[/showif]
[showif [numfound]<100]
<ahref="http://www.knifecenter.com/kc_new/store_store.html?ttl=KNIFECENTER%20LISTINGS&srch=eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]">Seesimilar items (does not include cat 3)</a>
[/showif]
[/search]
The problem is, I think since this search is being done within the firstsearch context, the numfound is always going to be 1.
How can I do this so that this search is independent of the first search,but is still able to use the categories of the sku found in the firstsearch?
--=====================_435295046==.ALT--
Associated Messages, from the most recent to the oldest:
--=====================_435295046==.ALTContent-Type: text/plain; charset="us-ascii"To be sure, you can set the [numfound] from the inner search to a text variable - [search db=^db/products.db&eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]][text show=f]THISFIND=[numfound][/text][showif [THISFIND]>100]....[/showif]At 09:37 AM 11/20/2008, you wrote:>I'm trying to generate a link to similar items from our item detail page.>>Currently, our item detail page is generated by doing a search on our products database for the sku and passing that sku to a search request:>>[search db=^db/products.db&eqSKUdatarq=[s]]>>Once inside of this search, I want to do a second search for items that have the same categories as the found item. If the numfound is greater than 100, I want to automatically create a link with 3 categories. If the numfound is less than 100, I want to automatically create a link with only 2 categories:>>[search db=^db/products.db&eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]]> [showif [numfound]>100]>
See similar items (includes cat 3)>[/showif]>>[showif [numfound]<100]>
See similar items (does not include cat 3)>[/showif]>>[/search]>>The problem is, I think since this search is being done within the first search context, the numfound is always going to be 1.>>How can I do this so that this search is independent of the first search, but is still able to use the categories of the sku found in the first search?--=====================_435295046==.ALTContent-Type: text/html; charset="us-ascii"
To be sure, you can set the [numfound] from the inner searchto a text variable -
[searchdb=^db/products.db&eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]]
[text show=f]THISFIND=[numfound][/text]
[showif [THISFIND]>100]....[/showif]
At 09:37 AM 11/20/2008, you wrote:
I'm trying to generate a link tosimilar items from our item detail page.
Currently, our item detail page is generated by doing a search on ourproducts database for the sku and passing that sku to a searchrequest:
[search db=^db/products.db&eqSKUdatarq=[s]]
Once inside of this search, I want to do a second search for items thathave the same categories as the found item. If the numfound is greaterthan 100, I want to automatically create a link with 3 categories. If thenumfound is less than 100, I want to automatically create a link withonly 2 categories:
[searchdb=^db/products.db&eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]]
[showif[numfound]>100]
<ahref="http://www.knifecenter.com/kc_new/store_store.html?ttl=KNIFECENTER%20LISTINGS&srch=eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]%26eqWWWCAT_3datarq%3D[WWWCAT_3]">See similar items (includes cat 3)</a>
[/showif]
[showif [numfound]<100]
<ahref="http://www.knifecenter.com/kc_new/store_store.html?ttl=KNIFECENTER%20LISTINGS&srch=eqWWWCAT_1datarq%3D[WWWCAT_1]%26eqWWWCAT_2datarq%3D[WWWCAT_2]">Seesimilar items (does not include cat 3)</a>
[/showif]
[/search]
The problem is, I think since this search is being done within the firstsearch context, the numfound is always going to be 1.
How can I do this so that this search is independent of the first search,but is still able to use the categories of the sku found in the firstsearch?
--=====================_435295046==.ALT--
Gary Krockover
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:
Multiple prices (1997)
Re:Emailer and encryption (1997)
[OT] (more) Google Info (2004)
PCS Frames (1997)
Request: Stop any looping context ... (2002)
Can I invoke an ssi plugin from within a webcat page (1997)
A Suggestion? (1998)
[BULK] [WebDNA] AJAX module (2012)
[OT] Powerbook Tech (2005)
OT: Poll Results (2002)
Linux [decrypt] bug exists only on webcat 3 or also 4? (2000)
How true is this? (1999)
Subtotal Not Calculated on Invoice.html (1998)
Protect vs Authenicate (1997)
Summary search -- speed (1997)
WebCat2b13MacPlugIn - [showif][search][/showif] (1997)
[WebDNA] Commas within table content (2009)
financial calculation (2000)
Unexpected comparison behavior change in 4.5.1 (2003)
How long until WebDNA makes the list? :( (2004)