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:
@Override
public List<QuerySpec<?>> getQueries() {
return singletonList(new QuerySpec<>(DummyQueryBuilder.NAME, DummyQueryBuilder::new, DummyQueryBuilder::fromXContent));
}
Error:(40, 34) java: cannot infer type arguments for org.elasticsearch.plugins.SearchPlugin.QuerySpec<>
I've seen this on Java 7 and 8. I'm using Elasticsearch 5.1.1
Should I expect this line to work outside of package org.elasticsearch.index.query.plugin;?