I'm creating a search app which intensively uses Solr (5.2.1) faceting functionality. One requirement is to limit the number of facets returned by prefix for a specified field.
The standard Solr query syntax works well for a single prefix value:
/select?q=*%3A*&rows=0&wt=json&indent=true&facet=true&facet.field=DocumentKind&f.DocumentKind.facet.prefix=faq
Output:
"facet_counts": {
"facet_queries": {},
"facet_fields": {
"DocumentKind": {
"faq": 1523
}
...
Unfortunately this doesn't work when I must limit the facets on the field with more than one prefix:
/select?q=*%3A*&rows=0&wt=json&indent=true&facet=true&facet.field=DocumentKind&f.DocumentKind.facet.prefix=manual&f.DocumentKind.facet.prefix=faq
I expected it will return something like this:
"facet_counts": {
"facet_queries": {},
"facet_fields": {
"DocumentKind": {
"faq": 1523,
"manual": 2366
}
...
But it gives the same output as previous.
In the example above I match the entire facet value but in the real use case I really have to match the prefix. I showed this example for brevity.
I could filter this out in my app but the size of data returned unnecessarily by Solr is significant.