first: sorry for the bad quoting, I found your message in the archive only...
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
to make it clear, i agree that it doesn't make sense faceting on all available fields, I only want faceting on those 300 attributes that are stored together with the fields for full text searches. A product/document has typically only 5-10 attributes. I like to decide at index time which attributes of a product might be of interest for faceting and store those in dynamic fields with the attribute-name and some kind of prefix or suffix to identify them at query time as facet.fields. Exactly the naming convention you mentioned. I will have a closer look at SOLR-247 and the supplied patch, seems like a good starting point to dig deeper into solr... :o) Tom