# Expand terms in search query into boolean expression?

**URL:** <https://discuss.elastic.co/t/expand-terms-in-search-query-into-boolean-expression/252935>\
**Category:** Elasticsearch\
**Created:** [October 22, 2020, 6:10am UTC](https://discuss.elastic.co/t/expand-terms-in-search-query-into-boolean-expression/252935 "2020-10-22T06:10:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GavinM](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@GavinM](https://discuss.elastic.co/u/GavinM)\
**Post date:** [October 22, 2020, 6:10am UTC](https://discuss.elastic.co/t/expand-terms-in-search-query-into-boolean-expression/252935/1 "2020-10-22T06:10:08Z")

</div>

Hi

Does Elastic search have a capability of reading a text file containing `pattern = replacement` strings, and if any terms in the search query match `pattern` they are replaced with the boolean expression defined on the right side of the equals... e.g.

rowing boat = (rowingboat\* OR "row boat\*" OR (rowing\* AND boat\*))

I'm new to Elastic search, still only reading through docs to understand it, but I can't find any reference to anything that looks like it does this?

---

<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, 2020, 7:42am UTC](https://discuss.elastic.co/t/expand-terms-in-search-query-into-boolean-expression/252935/2 "2020-10-22T07:42:37Z")

</div>

Hi Gavin  
Check out [synonyms](https://www.elastic.co/blog/boosting-the-power-of-elasticsearch-with-synonyms)

---

<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:** [November 19, 2020, 7:42am UTC](https://discuss.elastic.co/t/expand-terms-in-search-query-into-boolean-expression/252935/3 "2020-11-19T07:42:42Z")

</div>

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