Outdated percolator documentation?

Hi,

I wanted to register a query in the _percolator index, but the
documentation seems outdated.

http://www.elasticsearch.org/guide/reference/java-api/percolate.html
seems to say, that you can set a Query object as source, but this does
not seem to work anymore for an IndexRequest...

I guess the normal way is to set via a string then to register a
percolate request

--Alexander

--

hey alex, what error are you seeing if you pass the Query Object?

simon

On Thursday, November 8, 2012 9:32:15 AM UTC+1, Alexander Reelsen wrote:

Hi,

I wanted to register a query in the _percolator index, but the
documentation seems outdated.

Elasticsearch Platform — Find real-time answers at scale | Elastic
seems to say, that you can set a Query object as source, but this does
not seem to work anymore for an IndexRequest...

I guess the normal way is to set via a string then to register a
percolate request

--Alexander

--

Hi Simon

On Thu, Nov 8, 2012 at 10:45 AM, simonw
simon.willnauer@elasticsearch.com wrote:

hey alex, what error are you seeing if you pass the Query Object?
IndexRequestBuilder has no setSource(Query query) method (like shown
in the docs)
However I found my problem (except coding late at night) and solved it like this

IndexResponse indexResponse = client.prepareIndex("_percolator",
"documents", contentMatcher.id)
.setSource("query", queryBuilder).setRefresh(true).execute().actionGet();

--Alexander

--