Searches including category keywords not working
Continuing this Stack Exchange post: http://expressionengine.stackexchange...
Category keywords aren't being included in the search...
I have a category with the title "Dog Friendly", I've included this in the collection and run a search on "dog". No results. "Dog", "friendly", "Dog Friendly" - all no results (I have tried rebuilding indexes). I've even tried adding the word "testing" to a category description, then run a search for "testing" and included a dropdown category select with the relevant category selected. Still no results.
Form Code:
{exp:low_search:form collection="campsites" result_page="/campsites/search" search_mode="any"}
<div id="search">
<div class="searchbox">
<input type="text" name="keywords" placeholder="Search Campsites" value="" class="required" minlength="3">
<button type="submit" class="btn green no-margin">Search</button>
</div>
</div>
<input type="hidden" name="require_all" value="category”>
{/exp:low_search:form}
Results Code:
{exp:low_search:results query="{segment_3}" limit="10"}
{if count == 1}<ol>{/if}
<li><a href="#">{title}</a></li>
{if count == total_results}</ol><p>LOW_SEARCH RESULTS END</p>{/if}
{if no_results}No search results{/if}
{/exp:low_search:results}
No-results URI:
/search/eyJyZXN1bHRfcGFnZSI6IlwvY2FtcHNpdGVzXC9zZWFyY2giLCJrZXl3b3JkcyI6ImRvZyJ9
Version Details
EE v2.7.2
Low Search v3.1.5
Collections
Settings
The site isn't visible to the outside world for you to test, but let me know if there's anything else you need (debug output?).
Thanks,
Peter
Replies
Low 9 Jun 2014 10:17
Couple of things you can improve:
- Remove the collection="" and search_mode="" parameters from the Form tag. They have no effect. Instead, either set them on the Results tag, or add them as hidden input fields in the Form tag (like you're doing with the require_all param).
- The require_all="" param doesn't do anything in that form, because there's no category selection. You can safely remove it.
Then I do need some more info:
- Note the entry ID of an entry you'd expect to find with that search term. Then go to the SQL manager and the exp_low_search_indexes table. Look for the row with that entry_id and check what the content is of the index_text column. Can you see the keywords there?
- Enable template debugging and copy/paste all lines mentioning Low Search here
- In the Output Profiler, look up the query generated by LS. It will target the 'exp_low_search_indexes' table. What does that query say? Can you run it in the SQL manager and does that produce results?
Peter 9 Jun 2014 11:57
Hi Low,
No category information seems to be appearing in the low_search_indexes table. Even after a new re-build of indexes. Obviously this is the issue, I've supplied the rest of the info you wanted anyway...
There are around 130 references to low_search in the output, none seemed dramatic or informative.
Lots of these:
Calling Extension Class/Method: Low_search_ext/custom_field_modify_data
This is the most interesting one:
SQL:
Peter 9 Jun 2014 12:03
Currently debugging the SQL from the rebuild indexes - will update you shortly...
Peter 9 Jun 2014 12:11
Managed to identify the cause! Sorry - it's nothing to do with Low Search!
I had Publisher installed on this build, and had uninstalled it to run these tests and confirm that it wasn't conflicting. BUT, there was another separate extension (by the same developer) to add compatibility with Low Search to Publisher (https://github.com/litzinger/publishe...). This was still installed and throwing off the rebuild of the index.
I'll contact that developer to get it sorted.
Sorry for the run around!
Low 9 Jun 2014 12:13
Ah, he probably didn't get round to adding support for Categories in that extension.