![]() |
Advance search
Problem with my search extra fields
when I use advance search and only select one category then only select the extra field called golf, nothing comes up. When I type in golf on the text search box and don't select the golf extra field only a few come up. When I put golf in the text search box and select the golf extra field nothing comes up. All my extra fields have been in place before these ads were listed |
Since you have the developer edition can you try this.
Open the searchresults.php file and locate this line: PHP Code:
PHP Code:
Then do the same search as you described and the sql statement will printed at the top of the page. Next copy and paste that into a reply here. |
this is result from just extra field selection:
SELECT p.id, p.owner, p.title, p.featured, p.section, p.shortDescription, p.display, p.description, p.price, p.dateadded, p.expiration, p.pBold, p.pHighlighted, u.state, u.city, u.country,u.phone FROM class_holidaysproducts AS p INNER JOIN class_holidaysproducts_fields ON p.id = class_holidaysproducts_fields.pID AND ( sValue LIKE '%Golf%') LEFT JOIN class_holidaysusers AS u ON p.owner = u.id WHERE p.expiration > NOW() AND p.display = 'Y' AND p.section IN (17, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188) AND p.price BETWEEN 0 AND 9999999 GROUP BY p.id, p.owner, p.title, p.featured, p.section, p.description, p.dateadded, p.expiration, u.state, u.city, u.country HAVING count(sValue) = 1 ORDER BY featured DESC, p.dateadded DESC results from just text search: SELECT p.id, p.owner, p.title, p.featured, p.section, p.shortDescription, p.display, p.description, p.price, p.dateadded, p.expiration, p.pBold, p.pHighlighted, u.state, u.city, u.country,u.phone FROM class_holidaysproducts AS p LEFT JOIN class_holidaysusers AS u ON p.owner = u.id WHERE p.expiration > NOW() AND p.display = 'Y' AND p.section IN (17, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188) AND (p.title LIKE '%golf%' OR p.shortDescription LIKE '%golf%' OR p.description LIKE '%golf%') AND p.price BETWEEN 0 AND 9999999 GROUP BY p.id, p.owner, p.title, p.featured, p.section, p.description, p.dateadded, p.expiration, u.state, u.city, u.country ORDER BY featured DESC, p.dateadded DESC result from extra field selection and text search: SELECT p.id, p.owner, p.title, p.featured, p.section, p.shortDescription, p.display, p.description, p.price, p.dateadded, p.expiration, p.pBold, p.pHighlighted, u.state, u.city, u.country,u.phone FROM class_holidaysproducts AS p INNER JOIN class_holidaysproducts_fields ON p.id = class_holidaysproducts_fields.pID AND ( sValue LIKE '%Golf%') LEFT JOIN class_holidaysusers AS u ON p.owner = u.id WHERE p.expiration > NOW() AND p.display = 'Y' AND p.section IN (17, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188) AND (p.title LIKE '%golf%' OR p.shortDescription LIKE '%golf%' OR p.description LIKE '%golf%') AND p.price BETWEEN 0 AND 9999999 GROUP BY p.id, p.owner, p.title, p.featured, p.section, p.description, p.dateadded, p.expiration, u.state, u.city, u.country HAVING count(sValue) = 1 ORDER BY featured DESC, p.dateadded DESC |
I just ran a few tests and it seems to be working for me.
First I did a normal search by selecting the "Portugal" category then choosing golf. Which returned 2 listings. Next I manually entered the golf option like this: searchresults.php?searchtext=&opt12=Golf Which returned three pages of results. |
I dont think its working like it should,
when you select portugal and use text search golf and select extra field golf I get no results. when I search portugal and only text search golf you get 7 results and when I search portugal and only use extra field golf only 2 results show but the results from the text search golf dont show the golf extra field search result, even thoe all of the results have the golf extra field selected |
When you enter text to search for it does not search the extra fields. It only searches the title, short description, and description.
|
So whats the point of having extra field search option, if when text search is used, all extra field options are ignored.
|
No that is not the case. Let me try and explain a little better.
If you enter text to search it only searches the following rows title, short description, and description If you select an option then it will search the options table. If you enter text and select an option then both the options table and the fields above are searched. I hope this makes sense. |
OK but why do I get no results if I text search golf rental, select cat portugal and select extra field golf,
all properties that have the golf extra field selected under portugal should show up with that search? |
If I search for Portugal and select golf as the option then two listings come up. Neither of these include golf in the title, short description, or description. So they will not appear when searching for the text "golf". Since you entered the text golf and the option golf nothing appears because there are no matches for both search types.
|
| All times are GMT -4. The time now is 04:45 AM. |
Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.