# Multipercolation not working after 3 queries

**URL:** <https://discuss.elastic.co/t/multipercolation-not-working-after-3-queries/55728>\
**Category:** Elasticsearch\
**Created:** [July 18, 2016, 7:06am UTC](https://discuss.elastic.co/t/multipercolation-not-working-after-3-queries/55728 "2016-07-18T07:06:57Z")\
**Posts on this page:** 6\
**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:** [July 18, 2016, 7:06am UTC](https://discuss.elastic.co/t/multipercolation-not-working-after-3-queries/55728/1 "2016-07-18T07:06:57Z")

</div>

I tried the below multi percolation query from postman. I was able to execute till 175 queries.  
If I try with more number of queries, it was crashing and the postman was getting closed.

POST [http://127.0.0.1:9200/xyz4/res/\_mpercolate](http://127.0.0.1:9200/xyz4/res/_mpercolate)

{"percolate":{"index":"xyz4","id":"AVXe7oZSV","type":"res"}}  
{}  
{"percolate":{"index":"xyz4","id":"AVXe7oZSV7","type":"res"}}  
{}  
.....

Then I tried calling this from Java Jersey Client .

I have created this particular query in the given format.  
WebTarget target = client.target(UriBuilder.fromUri(uri.toString()).build());  
Response response = target.request().post(Entity.entity(String.valueOf(body), MediaType.APPLICATION\_JSON));

the variable body holds this query json. When there is only 2 query, it executes and gives the response. For 3 or more queries it throws the below exception.  
{"error":"ElasticsearchParseException[Expected field]","status":400}  
Please help me on this.

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [July 18, 2016, 9:25am UTC](https://discuss.elastic.co/t/multipercolation-not-working-after-3-queries/55728/2 "2016-07-18T09:25:47Z")

</div>

> [@Nisar\_Adappadathil](#):
>
> {"error":"ElasticsearchParseException[Expected field]","status":400}

This indicates a parsing error. I think something goes wrong when you build the request body?  
Can you share the actual request body that you send to ES?

---

<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:** [July 18, 2016, 10:02am UTC](https://discuss.elastic.co/t/multipercolation-not-working-after-3-queries/55728/3 "2016-07-18T10:02:45Z")

</div>

{"percolate":{"index":"xyz4","id":"AVXe7oZSVXJ\_HQBQwl6O","type":"resumes"}}  
{}  
{"percolate":{"index":"xyz4","id":"AVXe7wgIVXJ\_HQBQwl6X","type":"resumes"}}  
{}  
{"percolate":{"index":"xyz4","id":"AVXe70KYVXJ\_HQBQwl6b","type":"resumes"}}  
{}

This is what I have in the body

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [July 18, 2016, 11:57am UTC](https://discuss.elastic.co/t/multipercolation-not-working-after-3-queries/55728/4 "2016-07-18T11:57:47Z")

</div>

That looks ok. Are you sending a newline (`\n` or `\r\n`) after each line (also the last line)? If you miss a new line then parsing on the ES side fails.

---

<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:** [July 18, 2016, 1:37pm UTC](https://discuss.elastic.co/t/multipercolation-not-working-after-3-queries/55728/5 "2016-07-18T13:37:00Z")

</div>

Sorry.I added \n only one time. I need to add it two times like "\n{}\n"  
Now its working.  
Thanks for your help.

---

<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 5, 2017, 10:34pm UTC](https://discuss.elastic.co/t/multipercolation-not-working-after-3-queries/55728/6 "2017-07-05T22:34:41Z")

</div>


