: I have many products of different types with totally different : attributes. There are currently more than 300 attributes.... : I use dynamic fields to import the attributes into solr without having : to define a specific field for each attribute. Now when I make a query I : would like to get back all facet.fields that are relevant for that query. : : I think it would be really nice, if I don't have to know which facets : fields are there at query time, instead just import attributes into
The problem is there may be lots of fields you index but don't want to facet on (full text search fields) and Solr has no easy way of knowing the difference between those and the fields you think it makes sense to facet on ... even if a field does make sense to facet on some of the time, that doesn't mean it makes sense all of the time (as you say "when I make a query I would like to get back all facet.fields that are relevant for that query" ... Solr has no way of knowing which fields make sense for that query unless it tries them all (can be very expensive) or you tell it. I solve this problem by having metadata stored in my index which tells my custom request handler what fields to facet on for each category ... but i've also got several thousand categories. If you've got less then 100 categories, you could easily enumerate them all with default facet.field params in your solrconfig using seperate requesthandler instances. : What do the experts think about this? you may want to read up on the past discussion of this in SOLR-247 ... in particular note the link to the mail archive where there was assitional discussion about it as well. Where we left things is that it might make sense to support true globging in both fl and facet.field, so you can use naming conventions and say things like facet.field=facet_* but that in general trying to do something like facet.field=* would be a very bad idea even if it was supported. http://issues.apache.org/jira/browse/SOLR-247 -Hoss