I'm trying to set up a search form that searches several things:
- name
- date
- location
The site in question is a funeral home, and we want to set up a search where people can search by the name of the deceased, the location of the funeral, or the date of death. The name and location search work great, but I get no results when I search by date.
I've set it up so that the date that gets sent to the Low Search module is formatted as YYYY-MM-DD
, but that doesn't seem to matter.
Your talk about range would apply here, but I only want to search for a single date, not a range of dates. In any case, I did try range-from
(as you see below) and a hidden input for range-to
with the same value. That didn't work.
Previously, I didn't use a range at all, and Low Search would return every all results (over 8500 of them!).
My Code
{exp:low_search:form collection="obits|obits_archive" form_class="obit-search" query="" result_page="obit/results" secure="no"}
<ul>
<li><label>Name<br/>
<input type="text" name="keywords" /></label></li>
<li><label for="date-pick">Date of Death<br/>
<input type="text" name="range-from:ob_dod" id="date-pick" value="" /></label><input type="text" style="display:none" name="range-to:ob_dod" /></li>
<li><label>CCG Location<br/>
<select name="child:ob_location[]">
<option value="">All Locations</option>
{exp:channel:entries channel="locations" dynamic="no" orderby="title" sort="asc"}
<option value="{entry_id}">{title}</option>
{/exp:channel:entries}
</select></label></li>
<li><input type="submit" name="submit" value="Search" id="submit" class="button"></li>
</dl>
{/exp:low_search:form}
Other Info
You'll almost certainly want to know that the date is not using EE's date fieldtype, but, rather, Stephen Lewis's Dropdate. Dates are stored as a UNIX timestamp.