According to the Apache Solr documentation on facets, I can use keys because: 'This can be helpful when faceting on the same field multiple times with different exclusions.'
I need them because I want to have a facet that gives me 'Last day', 'Last week', 'Last month' options.
However, when I specify a query with the following options set:
http://URL/select?
...unrelated...
facet=true&
facet.date={!key=some_key}created&
f.some_key.facet.date.start=NOW/DAY-1DAY&
f.some_key.facet.date.end=NOW/DAY&
f.some_key.facet.date.gap=NOW/DAY+1DAY
...unrelated...
Solr complains about:
[exception] => org.apache.solr.common.SolrException: Missing required parameter: f.created.facet.date.start (or default: facet.date.start)
When I set facet.date.start, or f.created.facet.date.start, they will override the fields of my some_key (start/end/gap) and this is useless because I need multiple keys... Can anyone point me in the right direction here? Due to limitations of the library I am using, this needs to be done in a single query.
You could use facet queries:
http://URL/select?
...unrelated...
facet=true&
facet.query=[NOW-1DAY TO NOW]&
facet.query=[NOW-7DAY TO NOW]&
facet.query=[NOW-1MONTH TO NOW]&
...unrelated...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With