lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Parsing a Lucene/Solr query and adding more clauses
Date Thu, 17 Jan 2013 01:46:26 GMT
: I am trying to write a util which can parse a Lucene/Solr query and convert
: into an object representation to add more clauses to the query. 
: Eg.
: Input: (name:John AND name:Doe)
: Output: ((firstName:John OR lastName:John) AND (firstName:John OR
: lastName:John))

edismax can support this natively, no coding required -- although itwill 
build a DisjunctionMaxQuery across the "name"=>"firstName,lastName" 
expansion, not a simple BooleanQuery (but if you set the "tie" param to 
1.0 it should be equivilent, although i suspect a DisjunctionMaxQuery 
with the default tie breaker value would fit your usecase better 

So try something like this...



View raw message