# How to give the filter query in Elastic Search percolation

**URL:** <https://discuss.elastic.co/t/how-to-give-the-filter-query-in-elastic-search-percolation/65592>\
**Category:** Elasticsearch\
**Created:** [November 10, 2016, 6:57am UTC](https://discuss.elastic.co/t/how-to-give-the-filter-query-in-elastic-search-percolation/65592 "2016-11-10T06:57:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nisar\_Adappadathil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nisar_adappadathil/32/13224_2.png) [@Nisar\_Adappadathil](https://discuss.elastic.co/u/Nisar_Adappadathil)\
**Post date:** [November 10, 2016, 6:57am UTC](https://discuss.elastic.co/t/how-to-give-the-filter-query-in-elastic-search-percolation/65592/1 "2016-11-10T06:57:06Z")

</div>

Hi

I am trying percolation

Below is what I have indexed.  
{  
"\_index": "my\_index",  
"\_type": ".percolator",  
"\_id": "AVhIEWHa89Gnz7pd0EQc",  
"\_version": 1,  
"found": true,  
"\_source": {  
"query": {  
"bool": {  
"should": [{  
"match": {  
"candidate": {  
"query": "ABC",  
"type": "boolean"  
}  
}  
}]  
}  
},  
"documentId": "6017:6066:d59defa4c6dc4552a2be5d9b3c66a47c",  
"status": "Open"  
}  
}

Now I need to search over multiple documentId.

{"percolate" : {"index" : "spire\_4", "type" : "candidate", "id" : "6017:6005:aba6e2059d4c4993b7c8f7221c3429ee" } }  
{"highlight":{"fields":{"skill":{} }},"size":5, "query": {"bool": { "filter": { "terms": { "requisitionId": ["6017:6066:d59defa4c6dc4552a2be5d9b3c66a47c"] } } } } }  
{"percolate" : {"index" : "spire\_4", "type" : "candidate", "id" : "6017:6005:2f9b8d2694fb4a8eb19a14e666c47021" } }  
{"highlight":{"fields":{"skill":{} }},"size":5, "query": {"bool": { "filter": { "terms": { "requisitionId": ["6017:6066:d59defa4c6dc4552a2be5d9b3c66a47c"] } } } } }

my query is like above. But this is throwing error.

"reason": {  
"type": "parse\_exception",  
"reason": "failed to parse request",  
"caused\_by": {  
"type": "no\_class\_def\_found\_error",  
"reason": "Could not initialize class org.apache.lucene.queries.TermsQuery"  
}

Please help.

Thanks  
Nisar

---

<div class="post-metadata">

**Author:** ![Nisar\_Adappadathil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nisar_adappadathil/32/13224_2.png) [@Nisar\_Adappadathil](https://discuss.elastic.co/u/Nisar_Adappadathil)\
**Post date:** [November 28, 2016, 6:08am UTC](https://discuss.elastic.co/t/how-to-give-the-filter-query-in-elastic-search-percolation/65592/2 "2016-11-28T06:08:22Z")

</div>

Please reply.Stuck on this.

---

<div class="post-metadata">

**Author:** ![shradhatx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shradhatx/32/45398_2.png) [@shradhatx](https://discuss.elastic.co/u/shradhatx)\
**Post date:** [November 30, 2016, 2:38pm UTC](https://discuss.elastic.co/t/how-to-give-the-filter-query-in-elastic-search-percolation/65592/3 "2016-11-30T14:38:50Z")

</div>

You setup queries separately first and then percolate the documents.

The code is not very readable. List your queries and then show how you are percolating. Looks like the documents you want to send for percolation is in an index so show the mappings of the index and docs you want to send for percolation.

---

<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:** [December 28, 2016, 2:38pm UTC](https://discuss.elastic.co/t/how-to-give-the-filter-query-in-elastic-search-percolation/65592/4 "2016-12-28T14:38:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
