Re: Search Philosophy
This WebDNA talk-list message is from 2001
It keeps the original formatting.
numero = 39366
interpreted = N
texte = >Hello, question from a confused designer....>In a basic search string similiar to:>>[search db=some.db&eqFIELDdatarq=var]>[founditems]>some action>[/founditems]>[/search]>>If one wants to enact an action on both the found>items that equal FIELD and that founditems that dont equal>FIELD does one need two search contexts?As I see it, there are two approaches to this,1. as you have discovered, 2 searches.2. search for ALL the records (neFIELDdatarq=[blank]) and use showif's and hideif's to make the difference[founditems][showif [field]=var][/showif][hideif [field]=var][/hideif][/founditems]Which approach you want to use depends on your situation, db size, performance issues, and so on. A little side by side comparison may be in order.Without knowing the rest of your code, I prefer to do something like #2:[search db=some.db&neFIELDdatarq=[blank]][founditems][showif [FIELD]=var][text]t_field=[var][/showif][hideif [FIELD]=var][text]t_field=something else[/hideif]More code using [t_field][/founditems][/search]You may also want to research [lookup] especially in relation to the notfound parameter.HTHs-Sam>>In otherwords, I want to change a variable to something>if it is found and something else if it is not found.>>thanks.>>>>>-- Donovan D. Brooke>Systems Administrator/>Assc. Art Director>Epsen Hillmer Graphics>>>I know I'm making progress when I look at the questions I have>asked in the past and think to myself... how stupid was that>>>------------------------------------------------------------->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://search.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://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
>Hello, question from a confused designer....>In a basic search string similiar to:>>[search db=some.db&eqFIELDdatarq=var]>[founditems]>some action>[/founditems]>[/search]>>If one wants to enact an action on both the found>items that equal FIELD and that founditems that dont equal>FIELD does one need two search contexts?As I see it, there are two approaches to this,1. as you have discovered, 2 searches.2. search for ALL the records (neFIELDdatarq=[blank]) and use showif's and hideif's to make the difference[founditems][showif [field]=var][/showif][hideif [field]=var][/hideif][/founditems]Which approach you want to use depends on your situation, db size, performance issues, and so on. A little side by side comparison may be in order.Without knowing the rest of your code, I prefer to do something like #2:[search db=some.db&neFIELDdatarq=[blank]][founditems][showif [FIELD]=var][text]t_field=[var][/showif][hideif [FIELD]=var][text]t_field=something else[/hideif]More code using [t_field][/founditems][/search]You may also want to research [lookup] especially in relation to the notfound parameter.HTHs-Sam>>In otherwords, I want to change a variable to something>if it is found and something else if it is not found.>>thanks.>>>>>-- Donovan D. Brooke>Systems Administrator/>Assc. Art Director>Epsen Hillmer Graphics>>>I know I'm making progress when I look at the questions I have>asked in the past and think to myself... how stupid was that>>>------------------------------------------------------------->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://search.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://search.smithmicro.com/
Samuel Renkert
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:
Doing VALIDCARD right? (1998)
New global preference ... ??? (2000)
math on date? (1997)
PCS search results page (1998)
[taxRate] [TaxTotal] ? (1997)
Email Formatting and Encryption (1998)
Generating Report Totals (1997)
date sorting and 'template (1997)
Exclamation point (1997)
are we ready to fix random sort? - Or did that already happen? (2000)
5.0 feature request: Sort for ListWords (2001)
Not reading code (1997)
WCS Newbie question (1997)
'RequiredField' Question (1998)
Running _every_ page through WebCat ? (1997)
bugs w/! &/or bad scripting??? (1997)
Running _every_ page through WebCat ? (1997)
Spawn Wishes (1998)
[orderfile Orders/[cart]] (2000)
WebCat2 Append problem (B14Macacgi) (1997)