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

Support archive

Too many results.

CCD 5 Feb 2013 19:20 question, complete

I'm getting too many results. I want my search results to show X and Y not X or Y. My search form uses 1 channel and 2 categories. Any solutions? I'm new to EE and just purchased the Low Search. Can't wait to get it working.

{exp:low_search:form
query="{segment_2}"
collection="doctors"
search_mode="exact"
require_all="category"
result_page="pages/search-resultstest"
}

Locations
{exp:channel:categories channel="doctor1" category_group="10" style="linear"}

{location_1}

{location_2}

{location_3}

{/exp:channel:categories}

Services
{exp:channel:categories channel="doctor1" category_group="11" style="linear"}

{service_1}

{service_2}

{/exp:channel:categories}

Search
{/exp:low_search:form}

results page tag
{exp:low_search:results query="{segment_3}" limit="30" disable="member_data" orderby="title"}
{if count == 1}

    {/if}
  1. {title}

  2. {if count == total_results}
{/if}
{if no_results}No search results{/if}
{/exp:low_search:results}

Replies

  1. Low 5 Feb 2013 19:24

    Hi! Could you put the search form tag code in a http://pastie.org so GetSat doesn't mess it up? Thanks.

  2. CCD 5 Feb 2013 20:35

    I emailed the tag code direct.

  3. Low 5 Feb 2013 20:59

    I haven't received anything yet. Where did you send it to?

    You can also go to http://pastie.org and paste the code there. Then copy/paste the URL you generated here again.

  4. CCD 5 Feb 2013 21:07

    http://pastie.org/6074495

  5. Low 5 Feb 2013 21:16

    Okay, two things:

    Firstly, add the {category_id} to the option values, which are now empty:

    <option value="{category_id}" ... >


    Secondly, you're pointing to the result page pages/search-resultstest, but you're adding {segment_2} to the query="" tag in the Form tag (and I presume the Results tag as well). That should be {segment_3}.

  6. CCD 5 Feb 2013 21:22

    I'm using {segment_2} in the form and {segment_3} in the Results tag.

    I'm still getting too many results.

  7. Low 5 Feb 2013 21:27

    Right, I see.

    And the option values; have you added the ID to it? The code inside the channel:categories tags looks strange to me -- why create multiple options per category when they would have the same ID?

    Also, what version of Low Search, ExpressionEngine and PHP are you running?

  8. CCD 5 Feb 2013 21:54

    I see what you mean. I have changed some of the code inside the categories tag and now get no results.

    http://pastie.org/6074850

  9. Low 5 Feb 2013 21:58

    The value should be the category ID. Not a variable {category_XX}.

    Why are you using the {exp:channel:categories} tag if you're not using it to generate the categories in the group? Are you hardcoding the categories instead?

  10. CCD 5 Feb 2013 22:05

    I thought I had to use categories. and yes I am hardcoding the categories. What I'm trying to accomplish is probably much simpler than I'm making it.

    I want the user to select a location from one drop down and a service from another drop down. Results would be everything from channel x that uses the location and service selected.

  11. Low 5 Feb 2013 22:09

    You can use categories, but you don't have to hardcode them. If you want to display all the categories in the two groups there, you can simply use the tags, without the limit.

    Take a look at this code: http://pastie.org/6074948 and then compare it to your code. See the difference? Try it out and see what happens.

  12. CCD 5 Feb 2013 22:16

    That fixed it. Thank you so much!