# ES 6.5.2 Search for specific terms that appear on the same line in a multiline text field

**URL:** https://discuss.elastic.co/t/es-6-5-2-search-for-specific-terms-that-appear-on-the-same-line-in-a-multiline-text-field/171753
**Category:** Elasticsearch
**Created:** [March 11, 2019, 12:17pm UTC](https://discuss.elastic.co/t/es-6-5-2-search-for-specific-terms-that-appear-on-the-same-line-in-a-multiline-text-field/171753 "2019-03-11T12:17:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)
#### Post date: [March 11, 2019, 12:17pm UTC](https://discuss.elastic.co/t/es-6-5-2-search-for-specific-terms-that-appear-on-the-same-line-in-a-multiline-text-field/171753/1 "2019-03-11T12:17:15Z")

</div>

Hi Guys,

What is the best way to search for multiple specific terms in a multiline text field but only if those terms appear on the same line in that multiline text field?

I couldn't achieve this using the simplied Lucene query and having even more problems using the regexp - can't get regexp to work either.

For this particular index, the \_all field is not disabled.

Cheers,

---

<div class="post-metadata">

### Author: ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)
#### Post date: [March 11, 2019, 3:35pm UTC](https://discuss.elastic.co/t/es-6-5-2-search-for-specific-terms-that-appear-on-the-same-line-in-a-multiline-text-field/171753/2 "2019-03-11T15:35:29Z")

</div>

Hi,

> [@ld\_pvl](#):
>
> What is the best way to search for multiple specific terms in a multiline text field but only if those terms appear on the same line in that multiline text field?

When you say "the same line" you think the _same line_ (line break) or _same phrase_ (punctuation) ?

Take a look at:

> **[Multi-match query | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html)**

bye,  
Xavier

---

<div class="post-metadata">

### Author: ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)
#### Post date: [March 11, 2019, 5:17pm UTC](https://discuss.elastic.co/t/es-6-5-2-search-for-specific-terms-that-appear-on-the-same-line-in-a-multiline-text-field/171753/3 "2019-03-11T17:17:38Z")

</div>

Hi Xavier, thanks for the response, by the same line I mean delimited by line break.

---

<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: [April 8, 2019, 5:17pm UTC](https://discuss.elastic.co/t/es-6-5-2-search-for-specific-terms-that-appear-on-the-same-line-in-a-multiline-text-field/171753/4 "2019-04-08T17:17:52Z")

</div>

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