I'm trying to test the new Percolator API in the alpha3 release. Indexing the queries is working fine and everything is working as long as I use the REST API directly. Now I want to percolate documents directly from Java. According to the latest changes the percolator is no longer part of the core elasticsearch dependency: https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_50_percolator.html#_java_client
I can't find anything about the new percolator module and how I get it working. What's the maven dependency for the percolator module?
This is unfortunate, so the only way to get the percolator jar file is from the distribution's module directory (zip/tar etc.) itself and add that on your classpath.
ES 5.0 will ship with a low level rest client, so when that is available, that will be the recommended way to use the percolator.
Thanks for your answer. I almost got it to work, but the classes PercolateRequest and PercolateRequestBuilder are both deprecated? So the percolator java module it is not really meant to be used directly?
Yes, you shouldn't use the percolate api (unless you're tide to is for bwc reasons), but use the percolator query via the search api instead. If the percolate module is on your classpath then you can use the PercolateQueryBuilder in your code and set that as query when using the search api.
In fact the transport client needs to know about the PercolateQueryBuilder otherwise it can't serialize it, so you need to the percolate api to be on the classpath. For the rest client this will not be the case.
Ah okay, perfect! Thanks a lot for your answer! No everything makes sense for me. (I was just confused because of the documentation which I referred in my post).
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.