Search code examples
searchsolrfieldfacet

facet dynamic fields with apache solr


I have defined dynamic field in ApacheSolr:

I use it to store products features like: color_feature, diameter_feature, material_feature and so on. Number of those fields are not constant becouse products are changing.

Is it possible to get facet result for all those dynamic fields with the same query or do I need to write always all fields in a query like ... facet.field=color_feature&facet.field=diameter_feature&facet.field=material_feature&facet.field=...


Solution

  • Solr currently does not support wildcards in the facet.field parameter.
    So *_feature won't work for you.

    May want to check on this - https://issues.apache.org/jira/browse/SOLR-247

    If you don't want to pass parameters, you can easily add these to your request handler defaults.

    The qt=requesthandler in request would always include these facets.