Reputation: 1993
How can I add a clause in php Solarium to filter by date? like omit all the results where date > today.
$query = $client->createSelect();
$query->createFilterQuery('myDateField')->setQuery(
sprintf('myDateField:%s', /*WHAT TO PUT HERE?*/)
);
thanks
Upvotes: 1
Views: 421
Reputation: 8668
Your code would be in solarium for solr would be :
$query->createFilterQuery('myDateField')->setQuery(
sprintf('myDateField:[2020-11-10T00:00:00Z TO NOW]')
);
Upvotes: 0