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

Support archive

Searching across categories returns no results

Neil 20 Jan 2013 19:59 problem, complete

Hey Low,

I've got a search form to search for people across different category groups like so;

 
{exp:low_search:form
query="{segment_2}"
collection="person"
search_mode="all"
require_all="category"
result_page="/meet-the-team/results"
}
<select name="category[]" style="width:90%;">
<option>Personal, Corporate or Union?</option>
{exp:channel:categories channel="person" category_group="3" show="not 8|46" style="linear"}
<option value="{category_id}"{if category_id IN ({low_search_category})} selected="selected"{/if}>
{category_name}
</option>
{/exp:channel:categories}
</select>

<select name="category[]" style="width:90%;">
<option>Select a service</option>
{exp:channel:categories channel="person" category_group="6" style="linear"}
<option value="{category_id}"{if category_id IN ({low_search_category})} selected="selected"{/if}>
{category_name}
</option>
{/exp:channel:categories}
</select>

<select name="category[]" style="width:83%;">
<option>Select an office</option>
{exp:channel:categories channel="person" category_group="1" style="linear"}
<option value="{category_id}"{if category_id IN ({low_search_category})} selected="selected"{/if}>
{category_name}
</option>
{/exp:channel:categories}
</select>
<input type="submit" class="search_icon" value="">
{/exp:low_search:form}


A person is in at least one category from each group, but a user can select a category from 1 or all of the selects to find results.

However, the search results page is not returning anything. :/ My Search Results page is like this;

 
{exp:low_search:results
query="{segment_3}"
status="not closed"
orderby="title"
sort="asc"
limit="8"
disable="member_data"
}
{title}
{/exp:low_search:results}


I wondered if you could perhaps offer a solution?

Thank you.

Replies

  1. Low 21 Jan 2013 07:48

    Hi Neil,

    Can you turn on template debugging and look up the lines that start with Low Search? What does that say?

  2. Neil 21 Jan 2013 10:04

    Hey man. I've got ;

    (0.161860 / 18.78MB) Low Search: No search, just filter entries by given parameters
    (0.162437 / 18.78MB) Low Search: Calling the channel module

  3. Low 21 Jan 2013 10:05

    And what's the encoded query in the URI?

  4. Neil 21 Jan 2013 10:56

    So the search form is on this page; domain.tld/meet-the-team

    Search results ends up at;

    /meet-the-team/results/eyJjb2xsZWN0aW9uIjoicGVyc29uIiwicmVzdWx0X3BhZ2UiOiJcL21lZXQtdGhlLXRlYW1cL3Jlc3VsdHMiLCJzZWFyY2hfbW9kZSI6ImFsbCIsImNhdGVnb3J5IjoiUGVyc29uYWwsIENvcnBvcmF0ZSBvciBVbmlvbj8mMjEmU2VsZWN0IGFuIG9mZmljZSJ9

  5. Low 21 Jan 2013 10:59

    Try giving the "empty" options the value parameter: value=""
    So:

    <option value="">Personal, Corporate or Union?</option>


    etc.

  6. Neil 21 Jan 2013 11:14

    Perfect. The numpty award goes to... ;)