Yes... use key instead of name in your example below :) <http://wiki.apache.org/solr/SimpleFacetParameters#key_:_Changing_the_output_key>
On Nov 15, 2011, at 15:12 , Robert Stewart wrote: > Is there any way to give a name to a facet query, so you can pick > facet values from results using some name as a key (rather than > looking for match via the query itself)? > > For example, in request handler I have: > > <str name="facet.query">publish_date:[NOW-7DAY TO NOW]</str> > <str name="facet.query">publish_date:[NOW-1MONTH TO NOW]</str> > > I'd like results to have names such as "last_week" and "last_month". > Otherwise client code needs to know to lookup values using the actual > query as the key, and that can be subject to change in solrconfig.xml. > > I'd like to be able to something like this in solr config: > > <str name="facet.query">{!name=last_week}publish_date:[NOW-7DAY TO NOW]</str> > <str name="facet.query">{!name=last_month}publish_date:[NOW-1MONTH TO > NOW]</str> > > And then get this in results: > > <lst name="facet_counts"> > <lst name="facet_queries"> > <int name="last_week">10000</int> > <int name="last_month">15000</int> > </lst> > > > Thanks > Bob