Monday, January 20, 2014

Modifying the Solr QueryParser

If you're doing development in Solr trunk and want to adjust the QueryParser, take a look at the JavaCC grammar file at lucene/solr/core/src/java/org/apache/solr/parser/QueryParser.jj.  This isn't a tutorial about JavaCC - there are plenty of those out there.

Once your changes are complete, you'll need to generate the underlying classes again.  ant builds from lucene/ or lucene/solr/ don't accomplish this.  So to do this, run 'ant javacc' from lucene/solr/core/.

That's it.  Continue on with your normal build patterns - I often run 'ant example' from lucene/solr/ when debugging locally.  It might make sense for parent builds to always run the javacc target in lucene/solr/core/ but I assume things are set up this way for a reason.

No comments:

Post a Comment