Gossamer Forum
Home : Products : Links 2.0 : Customization :

Added search fields

Quote Reply
Added search fields
I added a couple of search fields for someone who comes to the home page they will be able to enter their:
STREET
CITY
STATE
ZIP
From this input criteria after pressing "Find Restaurants" they will receive links to restaurants who deliver to their input. The fields were added in the databases where needed.
It works fine when I add a restaurant link in the administration with one street, city, state and zip code. The search will find the restaurant link as long as the information is typed correctly in each of the fields in the search boxes. BUT...
if I put multiple zips: 70089, 70087, 70086 when inputing the restaurant link in adminstration.
When doing a search from the index (home page, where I added custom fields) I have to put all the zips with the commas in between, exactly how it was written when submitting the link in administration. This only happens with my custom search fields. If I go to the advanced search which I have not changed at all and put in any one of the zip codes it finds the link. How do I make it where in the zip field on the search form a person can put one zip code and it will look through the database and make it true by finding just one of zips listed in the zip field of the database.
Here is the code I inserted on the home page to do the searching:

<form action="<%db_cgi_url%>/search.cgi" method="GET">
<h2>Search</h2>
<div class="margin">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td><strong class="search">Find a Restaurant who delivers to your address.</strong></td></tr>
<tr><td>Street: <input type="text" name="Street" size="20"></tr>
<tr><td>City: <input type="text" name="City" size="20"></tr>
<tr><td>State: <input type="text" name="State" size="2"></tr>
<tr><td>Zip Code: <input type="text" name="Zip" size="5"></tr>
<tr><td><input type=submit value="Search">
</td></tr>
<tr><td><small class="more"><a href="<%db_cgi_url%>/search.cgi">More search options</a></small></td></tr>

</table>
</div>
</form>
Please help me. I am new to this and seems I am close because the search will find restaurants, just not when I add multiple zips, or streets, or anything else.
Thanks.
James

Quote Reply
Re: Added search fields In reply to
LINKS search engine is defaulted to Boolean AND Connector. Add the following hidden field to your search codes:

Code:
<input type="hidden" name="bool" value="or">

Regards.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Added search fields In reply to
Success.
Thank You. Thats exactly what I needed. I am going to create this database with over 5000 street addresses. I assume this links 2.0 will not be able to handle a load like this very well. I just wanted to build it to see if it possible and than purchase the SQL version. Will the conversion be easy if I go ahead and build my databases in Links 2.0, work out the kinks, while I save enough money to buy the SQL version?
Again, Thanks for your help.
James
Quote Reply
Re: Added search fields In reply to
I was wrong. It still does not work. All that does is allow one of the fields to be correct or all of the fields.
What my problem is on the administratin side when I input a restaurant link, I want to enter all the area codes it delivers to, all the streets it delivers to, all the cities, and all the zips.
When someone enters their street, city, state, zip I want the restaurants that match that criteria to pop up.
The way it is right now when I enter restaurant links through administration and input all the zip codes, when someone does a search for their 1 zip code that search comes up empty. If they were to put in every zip code in the database in the zip field it would come up true and show the link. I want the person performing the search to put only their zip code and have the search field in the database checked and if one of the zips matches the customers search input it will be true and the link will show.
How do I do this. I have inserted the zips with commas in the database, but it seems for the search to become true on the search form you have to write all the zips and commas.
What am I doing wrong?
Thanks
James
Quote Reply
Re: Added search fields In reply to
Try using the Match Any option in the Administration menu.

Regards.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Added search fields In reply to
I dont think that solves my problem. Here is an exact example of my problem
Go to http://www.ladelivers.com/idelivers/index.html
You will see a search form where you can put in your street, city, state, & zip.
If you enter the following info. exactly you will receive the restaurant iDelivers as a result of your search:

Street: 2185 C 44th St
City: Los Alamos, Any City
State: NM
Zip: 87544, 87545

The problem is, in the database I made for the iDelivers link I obviously created the fields: street, city, state, & zip.
Under the city field I inputed 2 cities this iDelivers restaurant delivers to: (Los Alamos & Any City.) I also put 2 zip codes this restaurant delivers to: (87544, 87545)
In order for this restaurant to appear after performing a search on the above named URL you have to input BOTH cities and BOTH zips. I want to be able to put only ONE city, and ONE zip. Isn't it possible in the database to put as many zips as I would like with commas in between them and if a search is performed and one of the zips matches that field becomes true? This is not happening the way I have it configured and I want to change that. Currently you have to input all of the fields in the search and have all of them be true before the restaurant link will be found. That is the way I want it, but I want to be able to put only one street, city, state & zip and have it come true, even though in the database their maybe FIVE cities, FIVE streets, FIVE states, & FIVE zips listed for a particular restaurant.
Please help me out here. I am confused.
Thanks
James
Quote Reply
Re: [jemezman] Added search fields In reply to
I believe it's the comma that confuses the search. Maybe if you search for just "12345 12346" and not "12345, 12346". It's probably looking for "12345," and not finding it.Blush