I'm trying to create a programmatic Search API query. I've successfully created one which looks for all nodes which are published:
$index = search_api_index_load("node_index"); $myQuery=new SearchApiQuery($index); $myQuery->condition('status', '1', '='); $data=$myQuery->execute(); $results=$data['results'];
However the condition that I want to search for is to find all nodes with a certain date on a date field.
The problem is I can't work out how the Search API stores dates. I've tried UNIX time stamps:
$myQuery->condition('field_application_end_date', '1411084800', '=');
And the PHP date format that is stored on the nodes however neither returns any results.
$myQuery->condition('field_application_end_date', '2014-10-01T00:00:00', '=');
Can someone explain how the Search API stores dates?
I've been digging through the module to try and work out how it's done, but it's a little out of my league.