Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

New Fields and Searching - Best Method?

Quote Reply
New Fields and Searching - Best Method?
I am wondering which is the best way to add a new field that is searchable.

I want to test a condition eg.

Is this progam 'available' or 'not available'.

I was going to add a 'YES/NO' field, but then thought how would the user go searching this?

The other way of doing it was having a field that would contain the full text ie:

'available'
'not-available'

AND making this field searchable with a level of '1'.

Which is the 'best way' of doing this? I thought if I could have a pre-defined search query as a link in my menu then the Yes/No field may be better - if this is possible.

Any thought's would be appreciated.




------------------
Clint
----------------------------------
www.AffiliatesDirectory.com
Proud Supporter of Links SQL
----------------------------------




Quote Reply
Re: New Fields and Searching - Best Method? In reply to
Why not make it an Integer field, and then No='0' and Yes-'1' or anything non-zero.

The way you'd test for the field is by adding an "if AVAILABLE" type test to the search query.

The way to do it would be to set up an option in the search so a user could check a box for which option, and then have it passed through to the search query.

I think there have been some discussions on that in the forum here and in the FAQ.

You can then modify your search routines to only show links that pass the "AND AVAILBLE" test.

I'm not sure what you want to do -- if you want the users to be able to find things that are available only, or a choice... but the binary "if" field is what you really should use.

The only other way to do it, is to create a nonsense string that is used for anything that is available, and then let the user check the box, and have it appended to the search query with an AND.

This was discussed here about 3 weeks ago on how to attach a location (in Australia) to a search.

It's not as desireable for you, since you have a pure binary if test which would be more useful in the long run as a 1/0 test.



------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/