I don't need really start from the query String. What I need is obtain a list of terms and operators. So the real problem is:
How can I access the Lucene Query structure to traverse it? Davide Marino 2012/10/4 Jack Krupansky <j...@basetechnology.com> > I'm not quite following what the issue is here. I mean, the Solr > QueryComponent generates a Lucene Query structure and you need to write > code to recursively traverse that Lucene Query structure and generate your > preferred form of output. There would be no need to look at the original > query string. So, what exactly are you asking? > > Maybe you simply need to read up on Lucene Query and its subclasses to > understand what that structure looks like. > > -- Jack Krupansky > > -----Original Message----- From: Davide Lorenzo Marino > Sent: Thursday, October 04, 2012 11:36 AM > To: solr-user@lucene.apache.org > Subject: Re: Getting list of operators and terms for a query > > > It's ok.. I did it and I took the query string. > The problem is convert the java.lang.string (query) in a list of term and > operators and doing it using the same parser used by Solr to execute the > queries. > > 2012/10/4 Mikhail Khludnev <mkhlud...@griddynamics.com> > > you've got ResponseBuilder as process() or prepare() argument, check >> "query" field, but your component should be registered after >> QueryComponent >> in your requestHandler config. >> >> On Thu, Oct 4, 2012 at 6:03 PM, Davide Lorenzo Marino < >> davide.mar...@gmail.com> wrote: >> >> > Hi All, >> > i'm working in a new searchComponent that analyze the search queries. >> > I need to know if given a query string is possible to get the list of >> > operators and terms (better in polish notation)? >> > I mean if the default field is "country" and the query is the String >> > >> > "england OR (name:paul AND city:rome)" >> > >> > to get the List >> > >> > [ Operator OR, Term country:england, OPERATOR AND, Term name:paul, Term >> > city:rome ] >> > >> > Thanks in advance >> > >> > Davide Marino >> > >> >> >> >> -- >> Sincerely yours >> Mikhail Khludnev >> Tech Lead >> Grid Dynamics >> >> <http://www.griddynamics.com> >> <mkhlud...@griddynamics.com> >> >> >