lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adriano Crestani <adrianocrest...@gmail.com>
Subject Re: Parsing a Lucene/Solr query and adding more clauses
Date Thu, 17 Jan 2013 00:00:04 GMT
The Flexible query parser is what you are looking for:
http://lucene.apache.org/core/4_0_0/queryparser/index.html


On Wed, Jan 16, 2013 at 3:46 PM, balaji.gandhi <jilaba.hindga@gmail.com>wrote:

> Hi Team,
>
> 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))
>
> I tried org.apache.lucene.queryparser.classic.QueryParser to parse the
> query
> and iterate over the terms. But this doesn't give me the boolean operators
> and boosting. Tried to use
> org.apache.lucene.queryparser.surround.parser.QueryParser and
> org.apache.lucene.queryparser.surround.query.SrndQuery. I didn't see any
> API
> to manipulate the query.
>
> What would be the best way to do this?
>
> Thanks,
> Balaji
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Parsing-a-Lucene-Solr-query-and-adding-more-clauses-tp4033973.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message