: Is there a way to retrieve only the search "words" the user entered in BNF form? : Query ::= ( Clause )* : Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" ) : : For example the user entered: +Paris -London : : I want to get a List that contains only {Paris, London}
your use of "TERM" is a little vauge. assuming for grammer is designed to be a subset of the QueryParser syntax, then a field name is a term, as is the tokens you are searching in each field correct? if your input is "+Paris: -content:London" you want the list {Paris, content, London} ? Something you might want to look at is the Query.extractTerms(Set) method. it should definitely work if all you are ever dealing with is simple Boolean and Term Queries. Some of the more exotic query types won't work however. (Bear in mind it extracts "Terms" in the org.apache.lucene.index.Term sense) -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]