I've just become aware of the XML Query parser, which seems to fit with my needs which really are ability to send query syntax trees to Solr (I need to do all query parsing in my client application).
However, I cannot find any examples on how to configure a solr request handler for this query parser. Does anyone know how to use it? Also, are there any limitations compared to the standard and DisMax query handlers (I need to do field level boosting as well as term boosting)? Excerpt from http://www.lucidimagination.com/blog/2009/02/22/exploring-query-parsers/ : ** *Xml-Query-Parser *<http://lucene.apache.org/java/2_4_0/api/contrib-xml-query-parser/index.html> [Lucene] A cool contribution from Mark Harwood, the xml-query-parser can parse xml files that specify which Query objects to construct (making it easy to support the full Lucene Query family). The xml-query-parser is easily expandable to new Query types and even handles simple Filter caching for you. Throw in a little XSLT, and the coolness multiplies. *Example syntax:* *<BooleanQuery fieldName="contents"> <Clause occurs="should"> <TermQuery>merger</TermQuery> </Clause> <Clause occurs="mustnot"> <TermQuery>sumitomo</TermQuery> </Clause> <Clause occurs="must"> <TermQuery>bank</TermQuery> </Clause> </BooleanQuery>* Thanks, Geir On 10 May 2011 14:29, Geir Gullestad Pettersen <gei...@gmail.com> wrote: > Is it possible to create hierarchies of query operator objects and pass > that to solr instead of constructing a long string query? > > This would enable client applications to construct complex queries and have > them verified by the compiler, example (psuedo code): > > q = BooleanQuery( > minNumberShouldMatch => 1, > booleanClauses => ClauseList( > MustMatch(DisjunctionMaxQuery( > PhraseQuery("features","apache solr", 2), > PhraseQuery("name","apache solr", 3) > ), > ShouldMatch(DisjunctionMaxQuery( > TermQuery("features","search", 2), > TermQuery("name","search", 3) > ), > ShouldMatch(DisjunctionMaxQuery( > TermQuery("features","server", 2), > TermQuery("name","server", 3) > )); > > solr.search( q ); > > > However, i cannot see that the Solr api supports this. > > Any thoughts? > > > Thanks, > Geir >