# Multi text string search

**URL:** <https://discuss.elastic.co/t/multi-text-string-search/8786>\
**Category:** Elasticsearch\
**Created:** [August 20, 2012, 3:10am UTC](https://discuss.elastic.co/t/multi-text-string-search/8786 "2012-08-20T03:10:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Linton](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@Linton](https://discuss.elastic.co/u/Linton)\
**Post date:** [August 20, 2012, 3:10am UTC](https://discuss.elastic.co/t/multi-text-string-search/8786/1 "2012-08-20T03:10:34Z")

</div>

Hi Im trying to create a query that searches through some documents with varying text. Lets say there are 2 different documents similar to below

curl -XPUT '[http://localhost:9200/providing/post\_prov/2](http://localhost:9200/providing/post_prov/2)' -d '{"userid":"100","docid":"12","key\_words":"Experienced Oracle DBA, willing to travel for work. I have about 5 years experience as a DBA.." }';

curl -XPUT '[http://localhost:9200/providing/post\_prov/5](http://localhost:9200/providing/post_prov/5)' -d '{"userid":"120","docid":"44","key\_words":"iPhone developer available for hire." }';

I would like to create one query that searches for text that would match both of the above documents but process them independently. I've come close but still new to ES and learning the ropes. The problem seems to be that the minimum\_should\_match is not being evaluated per each query\_string query. I know they are within a filter and that may not be the correct way to structure the query

The goal here is to submit mutiple searches within one query to create more efficient processing. But if one document has "oracle developer" and another "Iphone developer"; A search for "oracle developer" and another for "Iphone" should only return 1 result because each query has a minimum\_should\_match set to 2. See my current query below I may be going about this the wrong way

curl -XGET '[http://localhost:9200/providing/post\_prov/\_search?retty=true](http://localhost:9200/providing/post_prov/_search?retty=true)' -d '  
{  
"query":{  
"filtered" : {  
"query" : {  
"terms" : {"userid":[120,100,110,130,150]}  
},  
"filter" : {  
"or" : {  
"filters" : [  
{"query": {"query\_string" :{"query": "iphone developer","analyzer":"snowball","minimum\_should\_match":"2"}}},  
{"query": {"query\_string" :{"query": "oracle dba","analyzer":"snowball","minimum\_should\_match":"2"}}}  
]  
}  
}  
}  
}  
}'

Thanks  
Todd

---

<div class="post-metadata">

**Author:** ![Linton](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@Linton](https://discuss.elastic.co/u/Linton)\
**Post date:** [August 20, 2012, 4:39am UTC](https://discuss.elastic.co/t/multi-text-string-search/8786/2 "2012-08-20T04:39:03Z")

</div>

Actually it is working correctly, sorry for the post

---

<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:15am UTC](https://discuss.elastic.co/t/multi-text-string-search/8786/3 "2017-07-06T03:15:51Z")

</div>


