# Outdated percolator documentation?

**URL:** <https://discuss.elastic.co/t/outdated-percolator-documentation/9624>\
**Category:** Elasticsearch\
**Created:** [November 8, 2012, 8:32am UTC](https://discuss.elastic.co/t/outdated-percolator-documentation/9624 "2012-11-08T08:32:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 8, 2012, 8:32am UTC](https://discuss.elastic.co/t/outdated-percolator-documentation/9624/1 "2012-11-08T08:32:12Z")

</div>

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](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

--

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [November 8, 2012, 9:45am UTC](https://discuss.elastic.co/t/outdated-percolator-documentation/9624/2 "2012-11-08T09:45:28Z")

</div>

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](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

--

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 8, 2012, 3:19pm UTC](https://discuss.elastic.co/t/outdated-percolator-documentation/9624/3 "2012-11-08T15:19:25Z")

</div>

Hi Simon

On Thu, Nov 8, 2012 at 10:45 AM, simonw  
[simon.willnauer@elasticsearch.com](mailto: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

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:05am UTC](https://discuss.elastic.co/t/outdated-percolator-documentation/9624/4 "2017-07-06T03:05:19Z")

</div>


