All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Specifying certain collection to search not working

Toby Powell 15 Mar 2016 21:23 question, complete

Hi Im running expression engine 3.2 and low search. I can't seem to limit my search to certain collections, i just get results from all my collections.

I have a search:

{exp:low_search:form required="keywords"result_page="technical-library/tech-search-results" collection="technical_paper|not general_page_articles" form_id="sticky-search-bar" form_class="technical-form"}

Tech Library

{/exp:low_search:form}

and results page:

{exp:low_search:results query="{segment_3}" limit="10" collection="technical_paper|not general_page_articles"}
{if count == 1}
Searched for: {low_search_keywords}
Search results: {absolute_results}
{/if}
if low_search_no_results}
Searched for: {low_search_keywords}
Search results: 0
Please try another search

{/if}
{/exp:low_search:results}

Please help. Thanks

Replies

  1. Low 16 Mar 2016 06:57

    You're setting the collection parameter to both the Form and the Results tags. You can remove it from the Form tag, as filter parameters have no effect there.

    Furthermore, your param looks like this: collection="technical_paper|not general_page_articles"

    You're combining inclusive and exclusive values (ie. foo|not bar). Values can either be inclusive (foo) or exclusive (not bar); not both. Try using only inclusive values.

    If the problem still persists after that, try turning on the template debugger. You should be able to see several lines mentioning Low Search. Please copy/paste those here.

  2. Toby Powell 16 Mar 2016 08:23

    thanks, it was the combining the values. I just use inclusive and it works.

    Thanks very much for helping me and sussing the problem!