I've been working on a custom query / custom query builder. As a starting point, I copy/pasted DummyQueryBuilder and DummyQueryParserPlugin out of Elasticsearch's source and into my package. I've only changed the package.
Unfortunately, this code by itself, only changing the package doesn't compile. I get an error in DummyQueryParserPlugin on this line:
I solved it, though I'm not entirely sure why it matters. The issue boils down to the fact that the QueryParser interface is a functional interface that experts fromXContent to return an Optional<DummyQueryBuilder>. By performing that conversion directly, I can get it to work. So this code works:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.