Searching with OR on two custom fields from one front-end field
This may be a total odd-ball question but I wanted to ask anyhow. Here's the background: we have a client with a CSV that will be imported into EE a few times a year which has columns (dumped into separate fields in EE) for first and last name. They would like the front-end Low Search form to have one field that says 'Search first or last name'. So the idea is to be able to search the first OR last name and have it search both fields for a match. Is this possible? I've tried with no the luck the following:
name="search:dir_last[]|search:dir_first[]" - searches last name only
name="search:dir_last|search:dir_first" - produces 'Disallowed Key Characters.' error
Thanks!
Replies
Low 15 Jan 2014 21:06
Hi Mike,
The name="" parameter always takes only one parameter name. Not multiple. To achieve what you want, you'd have to create a Collection where you assign weight to both first name and last name, and use the Keywords filter to search that collection.
mike 15 Jan 2014 21:25
Perfect - thanks Low! Hadn't thought of that - it seems to be doing the trick.
Low 15 Jan 2014 21:28
Cool, glad it works!