Hi, for our project, we have to implement a custom query language that does have much in common with the built-in Lucene query language. We have a formal grammar for that language, formalized with Antlr.
I am not sure about the best way to build/generate a Lucene-based QueryParser object that is pluggable into our project because some of the query language's properties refer to information we have stored in payloads, i.e. require SpanQueries. Unfortunately, it is not as simple as calling a SpanTermQuery because we would like to allows queries for e.g. tokens that have the same payload, but not specified in advance. Ideally, I would like to apply a typical Lucene query processing step as in: StandardQueryParser parser = new StandardQueryParser(new WhitespaceAnalyzer(Version.LUCENE_40)); Query q = parser.parse("text", query); >From that point of view, the only change should be CustomParser parser = new CustomParser(...); Unfortunately, I couldn't find much documentation on that. The "Lucene in Action" textbook refers to building custom query parsers with Antlr or JavaCC, but does not go into any details. The Lucene query syntax definition in JavaCC would probably be a valuable source, but going through that is very tedious. That is why I would like to know whether you might know of a tutorial or less complex examples. Thank you very much! Carsten Schnober -- Institut für Deutsche Sprache | http://www.ids-mannheim.de Projekt KorAP | http://korap.ids-mannheim.de Tel. +49-(0)621-43740789 | schno...@ids-mannheim.de Korpusanalyseplattform der nächsten Generation Next Generation Corpus Analysis Platform --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org