If I have the following lucene query as a String, is it possible to use an existing lucene library to parse it?
+spanNot(spanNear([text:word1, text:word2], 10, true), text:mydelimiter)
I'm using lucene 3.0.0. I've tried the QueryParser in core and it gies no error but creates an incorrect BooleanQuery. I've also tried the StandardQueryParser (also gives BooleanQuery) in lucene-contrib and org.apache.lucene.queryParser.surround.parser.QueryParser which results in an error (Encountered ""(""(""....)
Is my only choice to construct the equivalent query in code?
(FYI my overall goal is to find terms in any order in the same sentence, by replacing sentence ending periods with "mydelimiter" in the document before indexing.)