# Query for elastic search

**URL:** <https://discuss.elastic.co/t/query-for-elastic-search/54037>\
**Category:** Elasticsearch\
**Created:** [June 27, 2016, 12:20pm UTC](https://discuss.elastic.co/t/query-for-elastic-search/54037 "2016-06-27T12:20:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ravi\_Shanker\_Reddy](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@Ravi\_Shanker\_Reddy](https://discuss.elastic.co/u/Ravi_Shanker_Reddy)\
**Post date:** [June 27, 2016, 12:20pm UTC](https://discuss.elastic.co/t/query-for-elastic-search/54037/1 "2016-06-27T12:20:43Z")

</div>

I parsed a csv through logstash and saved the data in elastic search. Now I have to condition to search like below.

((column08=Submit & column10=Delivered & column09=Something) | (column12=SMSC\_No\_error & column56=DEV))

As from page "[https://www.elastic.co/guide/en/elasticsearch/guide/current/combining-filters.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/combining-filters.html)"

I written the code as  
`GET /ramya_testing/_search { "query": { "constant_score": { "filter": { "bool": { "should":[{ "bool":{ "must":[ {"term":{"column08":"Submit"}}, {"term":{"column10":"Delivered"}}, {"term":{"column09":"Something"}}] } }, { "bool":{ "must":[{"term":{"column12":"SMSC_No_error"}}, {"term":{"column56":"DEV"}}] } } ] } }, "boost": 1.2 } } }`

This is my condition. Is it the good way to write or any better ways???

---

<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:40pm UTC](https://discuss.elastic.co/t/query-for-elastic-search/54037/2 "2017-07-05T22:40:15Z")

</div>


