![]() |
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.
|
I dont think it searches all the sub cats under main portugal cat that have the extra field selected
|
At the beginning of this topic when you echoed out $sSQL and printed your results you see this:
Quote:
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 Now I am not sure what you searched for then but you can do this to see what all categories it is searching in. |
That search was done on the costa del sol cat,
I just searched this cat, text search golf rental apartment and selected extra field golf and I got no results from the search. They are 24 listings under the costa del sol cat, 21 of them have the extra field golf selected 1 in Alhaurin El Grande 2 in Elviria 3 in La Cala de Mijas 3 in Nerja 2 in San Pedro 6 in Benalmadena 1 in Competa 1 in Fuengirola 1 in Marbella 1 in Riviera I think that this search should have shown the 21 properties with the extra field golf selected? |
Do you know if you have any other extra fields that you do not have searchable that include the word "Golf"?
|
I have another extra field called "Holiday Rental Property Features" this has a "near golf" option, I thought that it was safe because it was called "near golf"
do you think if I would change the holiday type "golf" option to "golfing" this would fix the bug |
That might do it. Because now I believe it is finding two golf which is making it not find only 1. If that makes sense. :) The bad part is you would need to edit each listing and change the option because of the way the extra fields are stored seperatly in the db.
|
Iv just edited 2 listings changing the golf to golfing and they dont show in search, Im turning this extra field off cos it just dosnt work
would this matter be fixed in V4, if So I'll wait till then |
| All times are GMT -4. The time now is 02:58 AM. |
Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.