Hi,
have a look at the flexible query parser of lucene (contrib package)
[1]. It provides a framework to easily create different parsing logic.
You should be able to access the AST and to modify as you want how it
can be translated into a Lucene query (look at processors and pipeline
processors).
One time you have your own query parser, then it is straightforward to
plug it into Solr.
[1] http://lucene.apache.org/java/3_1_0/api/contrib-queryparser/index.html
--
Renaud Delbru
On 31/05/11 19:24, dar...@ontrenet.com wrote:
Hi,
I want to write my own query expander. It needs to obtain the AST
(abstract syntax tree) of an already parsed query string, navigate to
certain parts of it (words) and make logical phrases of those words by
adding to the AST - where necessary.
This cannot be done to the string because the query logic cannot be
semantically altered. (e.g. AND, OR, paren's etc) so it must be parsed
first.
How can this be done with SolrJ?
thanks for any tips.
Darren