# How to use span multi term query in elastic search

**URL:** <https://discuss.elastic.co/t/how-to-use-span-multi-term-query-in-elastic-search/39022>\
**Category:** Elasticsearch\
**Created:** [January 12, 2016, 6:39pm UTC](https://discuss.elastic.co/t/how-to-use-span-multi-term-query-in-elastic-search/39022 "2016-01-12T18:39:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![subbu.nv](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@subbu.nv](https://discuss.elastic.co/u/subbu.nv)\
**Post date:** [January 12, 2016, 6:39pm UTC](https://discuss.elastic.co/t/how-to-use-span-multi-term-query-in-elastic-search/39022/1 "2016-01-12T18:39:42Z")

</div>

My requirement is if the user enters multiple regex string separated by pipe, i should perform search in elastic search. from documents, i think span multi term query would be the best option and i want some one to help me in constructing the exact query. please 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, 11:25pm UTC](https://discuss.elastic.co/t/how-to-use-span-multi-term-query-in-elastic-search/39022/2 "2017-07-05T23:25:06Z")

</div>


