# Different results by \_percolate and \_mpercolate

**URL:** <https://discuss.elastic.co/t/different-results-by--percolate-and--mpercolate/32742>\
**Category:** Elasticsearch\
**Created:** [October 22, 2015, 4:48am UTC](https://discuss.elastic.co/t/different-results-by--percolate-and--mpercolate/32742 "2015-10-22T04:48:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mumpi](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mumpi](https://discuss.elastic.co/u/mumpi)\
**Post date:** [October 22, 2015, 4:48am UTC](https://discuss.elastic.co/t/different-results-by--percolate-and--mpercolate/32742/1 "2015-10-22T04:48:19Z")

</div>

My Setup: language-dependant indices for text-documents; separate language-dependant indices for percolators. So I need the parameter `percolate_index`. While `_percolate` accepts wildcard-indices like eg.: `percolate _index` : `smd_*` and brings results from all percolators `_mpercolate` brings without complaining results of only one of the percolator indices. Setting `percolate_index` to one single index both `_percolate` and `_mpercolate` bring the same results. Do I something wrong or is it a bug? (Elasticsearch 2.0 rc1)

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [October 22, 2015, 9:01am UTC](https://discuss.elastic.co/t/different-results-by--percolate-and--mpercolate/32742/2 "2015-10-22T09:01:43Z")

</div>

Looks to work for me on 2.0 rc1 : [https://gist.github.com/markharwood/2b64e3731d80c8a2b3ac](https://gist.github.com/markharwood/2b64e3731d80c8a2b3ac)

Can you post a similar gist that reproduces the issue?

---

<div class="post-metadata">

**Author:** ![mumpi](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mumpi](https://discuss.elastic.co/u/mumpi)\
**Post date:** [October 22, 2015, 11:41am UTC](https://discuss.elastic.co/t/different-results-by--percolate-and--mpercolate/32742/3 "2015-10-22T11:41:58Z")

</div>

Thank you, Mark. First I was puzzled: I setup on my windows machine an abstraction of my environment. And unexpectedly it worked as it should. So I repeated the whole process on a centos machine with a new elasticsearch installation and it shows the reported error. So somehow the `_mpercolate` under centos handles names differently - be it wildcards or underescores or both.  
I am not an expert on github; so I just added the reproduction steps below.  
Please keep attention: somehow underscores dissappeared; I added also a comment on github. which hopefully shows the \_...

// create 3 identical indices:

PUT /documents\_de\_1900\_1950  
PUT /test\_a  
PUT /test\_b

{  
"mappings": {  
"doc": {  
"properties": {  
"name": {  
"type": "string"  
}  
}  
}  
}  
}

// percolators in testa, testb; document in documents:

PUT /test\_a/.percolator/testForAorCommon  
{  
"query": {  
"match": {  
"name": "a common"  
}  
}  
}

PUT /test\_b/.percolator/testForBorCommon  
{  
"query": {  
"match": {  
"name": "b common"  
}  
}  
}

PUT /documents\_de\_1900\_1950/doc/testdocumenta  
{  
"name": "a"  
}  
PUT /documents\_de\_1900\_1950/doc/testdocumentb  
{  
"name": "b"  
}  
PUT /documents\_de\_1900\_1950/doc/testdocumentcommon  
{  
"name": "common"  
}

// \_percolate works as expected:  
GET /documents\_de\_1900\_1950/doc/testdocumentcommon/\_percolate?percolate\_index=test\*

// response:  
{  
"took": 1,  
"\_shards": {  
"total": 10,  
"successful": 10,  
"failed": 0  
},  
"total": 2,  
"matches": [  
{  
"\_index": "test\_b",  
"\_id": "testForBorCommon"  
},  
{  
"\_index": "test\_a",  
"\_id": "testForAorCommon"  
}  
]  
}

// _mpercolate:  
{"percolate" : {"index" : "documents\_de\_1900\_1950", "type" : "doc", "id" : "testdocumentcommon", "percolate\_index" : "test_\*" } }  
{}

// windows Result:  
D:\curl-7.45.0-win64-mingw\bin\>curl -XPOST "[http://localhost:9200/\_mpercolate?pretty](http://localhost:9200/_mpercolate?pretty)" --data-binary "@mpercolator.txt"  
{  
"responses" : [ {  
"took" : 1,  
"\_shards" : {  
"total" : 10,  
"successful" : 5,  
"failed" : 0  
},  
"total" : 2,  
"matches" : [ {  
"\_index" : "test\_b",  
"\_id" : "testForBorCommon"  
}, {  
"\_index" : "test\_a",  
"\_id" : "testForAorCommon"  
} ]  
} ]  
}

// linux Result:  
[tomcat@office ~]$ curl -XPOST "[http://192.168.2.60:9200/\_mpercolate?pretty](http://192.168.2.60:9200/_mpercolate?pretty)" --data-binary @perc.txt  
{  
"responses" : [ {  
"took" : 19,  
"\_shards" : {  
"total" : 10,  
"successful" : 5,  
"failed" : 0  
},  
"total" : 1,  
"matches" : [ {  
"\_index" : "test\_b",  
"\_id" : "testForBorCommon"  
} ]  
} ]  
}

---

<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, 11:43pm UTC](https://discuss.elastic.co/t/different-results-by--percolate-and--mpercolate/32742/4 "2017-07-05T23:43:18Z")

</div>


