Exact matching not working for custom field searching
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
Low 3 Jul 2013 16:27
Try exact="search:cf_event_town".
Stephen 3 Jul 2013 16:32
Hi Low,
That did it! Thanks for the quick response.
Thanks,
Stephen
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?
Thanks,
Stephen
Low 3 Jul 2013 20:06
Yes, that should work.
Stephen 3 Jul 2013 20:12
Thanks Low.