Percolator Java API 5.0.0-alpha3


#1

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?


(Martijn Van Groningen) #2

Modules aren't published: https://github.com/elastic/elasticsearch/pull/16466

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.


#3

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?


(Martijn Van Groningen) #4

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.


#5

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).


#6

Do you know what is the percolator jar file name and where can I download it.
Thanks,

Carlos


(system) #7