osma commented on issue #536: Add support SurroundQueryParser to jena-text URL: https://github.com/apache/jena/pull/536#issuecomment-475686611 @afs Thanks for the reminder @DamienFontaine Any chance to refactor `parseQuery` just a little bit? There is quite a lot of redundancy and repetition now. For example * combine `QueryParser` and `AnalyzingQueryParser` cases into one, since their code is (nowadays) identical * handle the SurroundQueryParser case separate from the others since it's treated differently - for the others, avoid repeating the same boilerplate (e.g. `qp.setAllowLeadingWildcard(true)`) over and over Another option would be to create a class that wraps SurroundQueryParser giving it a QueryParser interface, so that it can be handled just like the others (ie revert the merging of two methods). But that may be difficult in practice - I assume there's a reason why SurroundQueryParser isn't a QueryParser in Lucene already although I haven't looked at it in detail. If we can get the line count in TextIndexLucene down by a dozen or so, I'm happy. And of course we need some kind of promise to update the jena-text documentation accordingly after this gets merged.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services