Hi Guys,
I'm working on a search engine for my site. I already have a catalog/index built. CFsearch works fine if I just use keywords in the "criteria" field.
In the index, I have custom3 set to equal the zip code. So if someone enters a zip code of 63101 within 5 miles, and it returns 7 zip codes, I want to search where custom3 is equal to any one of those zip codes. I have a working function that gets those zip codes.
I have it so users can enter in search criteria in a form, as well as include a zip code range finder.
Search_Box (key words)
Zip_Code
Range (5 miles, 10 miles, 15 miles, etc)
I already have the function working that finds zip codes within a certain range, and my guess is I need to have those results compiled into an array. Let's assume those results are put into variable "zip_array"
I'm hoping I can isolate the records that max the zipcode/custom3 field from the first search, rather than having to do a broader search, then do another query on those results.
Would something like this work?
<CFSEARCH NAME="Search" COLLECTION="#collection#" type="simple" criteria="see below">
criteria="#form.searchbox# AND custom3="#zip_array#"
Or how about this?
<CFSEARCH NAME="Search" COLLECTION="#collection#" custom3="zip_array" type="simple" criteria="#form.searchbox#">
If I can't get it to work in one search, I guess I will just do two queries. If anybody can point in the right direction I'd greatly appreciate it.
-Jason
I'm working on a search engine for my site. I already have a catalog/index built. CFsearch works fine if I just use keywords in the "criteria" field.
In the index, I have custom3 set to equal the zip code. So if someone enters a zip code of 63101 within 5 miles, and it returns 7 zip codes, I want to search where custom3 is equal to any one of those zip codes. I have a working function that gets those zip codes.
I have it so users can enter in search criteria in a form, as well as include a zip code range finder.
Search_Box (key words)
Zip_Code
Range (5 miles, 10 miles, 15 miles, etc)
I already have the function working that finds zip codes within a certain range, and my guess is I need to have those results compiled into an array. Let's assume those results are put into variable "zip_array"
I'm hoping I can isolate the records that max the zipcode/custom3 field from the first search, rather than having to do a broader search, then do another query on those results.
Would something like this work?
<CFSEARCH NAME="Search" COLLECTION="#collection#" type="simple" criteria="see below">
criteria="#form.searchbox# AND custom3="#zip_array#"
Or how about this?
<CFSEARCH NAME="Search" COLLECTION="#collection#" custom3="zip_array" type="simple" criteria="#form.searchbox#">
If I can't get it to work in one search, I guess I will just do two queries. If anybody can point in the right direction I'd greatly appreciate it.
-Jason