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

Support archive

Exact matching not working for custom field searching

Stephen 3 Jul 2013 16:25 problem, complete

Hi Low,

I've got a Town custom field in my search form. I've found that if I choose 'Hull', then I'm also getting results for 'Solihull.' I'd like to only see results for 'Hull'.

I was looking through the documentation and thought that the 'exact' parameter would allow me to do this, but when I tried it, it didn't have any affect on the search results.

Can you think of anything I'm doing wrong here? Or could this be a bug?

Here's my code (I simplified it to narrow down the issue):

 

{exp:low_search:form collection="ls_event_search" search_mode="all" result_page="/directory/advanced-search" secure="no" query="{freebie_3}" exact="cf_event_town"}

<select name="search:cf_event_town">
<option value="">All towns</option>
<option value="Huddersfield">Huddersfield</option>
<option value="Hull">Hull</option>
<option value="Solihull">Solihull</option>
</select>

<input type="submit" value="Search" />

{/exp:low_search:form}



I'm using EE 2.5.5 and Low Search 2.3.1.

Thanks,

Stephen

Replies

  1. Low 3 Jul 2013 16:27

    Try exact="search:cf_event_town".

  2. Stephen 3 Jul 2013 16:32

    Hi Low,

    That did it! Thanks for the quick response.

    Thanks,

    Stephen

  3. Stephen 3 Jul 2013 17:39

    Hi Low,

    Just a quick follow-up question - if I wanted to add multiple custom fields into the exact parameter, I should do so like this?

     
    exact="search:cf_event_town|search:cf_event_county|search:cf_event_laa|search:cf_event_region"


    Thanks,

    Stephen

  4. Low 3 Jul 2013 20:06

    Yes, that should work.

  5. Stephen 3 Jul 2013 20:12

    Thanks Low.