> > When constructing query, I create a lucene query and use query.toString to > create SolrQuery. > Go this thread - http://www.lucidimagination.com/search/document/f4d91628ced293bf/lucene_query_to_solr_query
I am facing difficulty while creating facet query for individual field, as I > could not find an easy and clean way of constructing facet query with > parameters specified at field level. > Per field overrides for facet params using SolrJ is not supported yet. However, you can always use solrQuery.set("f.myField.facet.limit",10) ... to pass field specific facet params to the SolrServer. Cheers Avlesh On Wed, Sep 9, 2009 at 2:42 PM, Aakash Dharmadhikari <aaka...@gmail.com>wrote: > hello, > > I am using SolrJ to access solr indexes. When constructing query, I create > a lucene query and use query.toString to create SolrQuery. > > I am facing difficulty while creating facet query for individual field, as > I could not find an easy and clean way of constructing facet query with > parameters specified at field level. > > As I understand, the faceting parameters like limit, sort order etc. can > be set on SolrQuery object but they are used for all the facets in query. I > would like to provide these parameters separately for each field. I am > currently building such query in Java code using string append. But it > looks > really bad, and would be prone to breaking when query syntax changes in > future. > > If there any better way of constructing such detailed facet queries, the > way we build the main solr search query? > > regards, > aakash >