All collections being searched rather than the specified collection
Hi Low,
I'm using Low Search 3.1.2 and EE 2.7.3, and my site has three collections.
I'm finding then when searching, the collection parameter is being ignored in the exp:low_search:form tag, so results from all collections are being returned, rather than just the collection(s) that I have in the collection parameter.
The search results URL looks like this: http://mysite.dev/search/results?keyw...
I've added my ode below. Do you have any ideas what's going wrong here?
Search form in global header template:
{exp:low_search:form collection="ls_news" search_mode="all" result_page="/search/results" form_id="keyword-search" query="{segment_3}"}
<input type="text" name="keywords" class="textfield" value="" size="18" maxlength="100" placeholder="Keyword Search..." />
<input type="submit" value="Go" class="button" />
{/exp:low_search:form}
Search results code in search/results template:
{exp:low_search:results query="{segment_3}" limit="100" paginate="both" disable="categories|category_fields|member_data"}
{if count == 1}
<p>{if low_search_keywords}Searched for <strong>{low_search_keywords}</strong>.{/if} <strong>{absolute_results}</strong> results.</p>
{/if}
<h3><a href="{page_uri}">{title}</a></h3>
<p>{low_search_excerpt}</p>
{if count == total_results}
{/if}
{if no_results}
<p>Sorry, your search did not return any results. Please try broadening your search criteria.</p>
{/if}
{paginate}
<p>Page {current_page} of {total_pages} pages {pagination_links}</p>
{/paginate}
{/exp:low_search:results}
If I add collection="ls_news" to the exp:low_search:results tag, it does then filter the results to just this collection. But I'm not sure why it's being ignored from the main exp:low_search:form tag, which I've been using on another site for over a year now (albeit, with an older version of EE and Low Search).
Thanks,
Stephen
Replies
Low 10 Mar 2014 06:35
It's intended behaviour. Since LS 3.0, all filter-specific parameters are no longer valid on the Form tag, and must be specified either as an input field in the Form tag, or on the Results tag.
Stephen 10 Mar 2014 17:00
Okay thanks for letting me know, Low, I hadn't spotted that change in 3.0.