# How to search text field for list of "terms" / "keywords"

**URL:** <https://discuss.elastic.co/t/how-to-search-text-field-for-list-of-terms-keywords/256218>\
**Category:** Elasticsearch\
**Created:** [November 21, 2020, 11:50am UTC](https://discuss.elastic.co/t/how-to-search-text-field-for-list-of-terms-keywords/256218 "2020-11-21T11:50:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/msta/32/79441_2.png) [@msta](https://discuss.elastic.co/u/msta)\
**Post date:** [November 21, 2020, 11:50am UTC](https://discuss.elastic.co/t/how-to-search-text-field-for-list-of-terms-keywords/256218/1 "2020-11-21T11:50:29Z")

</div>

Hi ES Community,  
We have a set of text-documents indexed, and their primary field is an analyzed version of their text (stored in a `text` field). We want to exact or partial match any of a long list of keywords in the text.  
The keyword list is easily a few hundred terms, or keywords.  
Previously, we've combined match phrase queries in a boolean clause, and gotten around the large query by changing the maxClauseCount.  
It would look like this:

```auto
    { "must" : [ 
     "should" : { "match_phrase" : .... },
     "should" : { "match_phrase" : .... },
    ] // etc
    }

```

Now we've switched to Elastic Cloud and they don't allow changing that setting. I'm trying to figure out if its possible to write this query in a different way.

So ideally something like

```auto
{
    "match_keywords" : ["a", "b", "c"]
    }

```

I cannot find anything to support this operation. It seems a quite trivial operation since the term vector should contain all the information needed to do this.  
Is this even possible? How would I go about writing this?  
Ideally the query would also return what term was matched, but that is an add-on luxury.

Thanks!

---

<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:** [December 19, 2020, 11:51am UTC](https://discuss.elastic.co/t/how-to-search-text-field-for-list-of-terms-keywords/256218/2 "2020-12-19T11:51:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
