# Elasticsearch - Not require an exact match

**URL:** <https://discuss.elastic.co/t/elasticsearch-not-require-an-exact-match/22758>\
**Category:** Elasticsearch\
**Created:** [March 19, 2015, 12:26pm UTC](https://discuss.elastic.co/t/elasticsearch-not-require-an-exact-match/22758 "2015-03-19T12:26:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_3](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@James\_3](https://discuss.elastic.co/u/James_3)\
**Post date:** [March 19, 2015, 12:26pm UTC](https://discuss.elastic.co/t/elasticsearch-not-require-an-exact-match/22758/1 "2015-03-19T12:26:56Z")

</div>

Currently I have an item in my elasticsearch index with the title:  
_testing123_

When I search for it, I can only get it returned if I search _testing123_  
exactly. However, I want to be able to search _testing_ and have it  
returned too.

How can I have it so the search must start with that term but also not be  
an exact match?

Any help would be appreciated.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [March 19, 2015, 12:30pm UTC](https://discuss.elastic.co/t/elasticsearch-not-require-an-exact-match/22758/2 "2015-03-19T12:30:36Z")

</div>

You should use this then:

> **[Word delimiter token filter | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-word-delimiter-tokenfilter.html)**

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
[Lucene.NET](http://Lucene.NET) committer and PMC member

On Thu, Mar 19, 2015 at 2:26 PM, James [mail@employ.com](mailto:mail@employ.com) wrote:

> Currently I have an item in my elasticsearch index with the title:  
> _testing123_
> 
> When I search for it, I can only get it returned if I search _testing123_  
> exactly. However, I want to be able to search _testing_ and have it  
> returned too.
> 
> How can I have it so the search must start with that term but also not be  
> an exact match?
> 
> Any help would be appreciated.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvcvCYD0\_SRY\_QcHNcytaj7KcmCH2itJcUsPCTc2FjsrQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvcvCYD0_SRY_QcHNcytaj7KcmCH2itJcUsPCTc2FjsrQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![James\_3](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@James\_3](https://discuss.elastic.co/u/James_3)\
**Post date:** [March 19, 2015, 12:33pm UTC](https://discuss.elastic.co/t/elasticsearch-not-require-an-exact-match/22758/3 "2015-03-19T12:33:23Z")

</div>

Thank you for the reply. I thought it was much about making my search query  
not require an exact match, rather than splitting down the words I am  
searching against?

On 19 March 2015 at 12:30, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com) wrote:

> You should use this then:  
> [Word delimiter token filter | Elasticsearch Guide [8.11] | Elastic](http://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-word-delimiter-tokenfilter.html)
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> [Lucene.NET](http://Lucene.NET) committer and PMC member
> 
> On Thu, Mar 19, 2015 at 2:26 PM, James [mail@employ.com](mailto:mail@employ.com) wrote:
> 
> > Currently I have an item in my elasticsearch index with the title:  
> > _testing123_
> > 
> > When I search for it, I can only get it returned if I search _testing123_  
> > exactly. However, I want to be able to search _testing_ and have it  
> > returned too.
> > 
> > How can I have it so the search must start with that term but also not be  
> > an exact match?
> > 
> > Any help would be appreciated.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/psZ8iAVOziM/unsubscribe](https://groups.google.com/d/topic/elasticsearch/psZ8iAVOziM/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvcvCYD0\_SRY\_QcHNcytaj7KcmCH2itJcUsPCTc2FjsrQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvcvCYD0_SRY_QcHNcytaj7KcmCH2itJcUsPCTc2FjsrQ%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvcvCYD0\_SRY\_QcHNcytaj7KcmCH2itJcUsPCTc2FjsrQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvcvCYD0_SRY_QcHNcytaj7KcmCH2itJcUsPCTc2FjsrQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPng%3D3f7pQOm4HPkxtec3or%2Ba4ZUVpC1USb7tWMaD9cvicQ8gQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPng%3D3f7pQOm4HPkxtec3or%2Ba4ZUVpC1USb7tWMaD9cvicQ8gQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [March 19, 2015, 12:35pm UTC](https://discuss.elastic.co/t/elasticsearch-not-require-an-exact-match/22758/4 "2015-03-19T12:35:35Z")

</div>

This boils down to Lucene fundamentals, in particular what search tokens  
are created and then searched. I've explained this in depth here:

[![](https://us1.discourse-cdn.com/elastic/original/3X/f/a/fa63b6b2006d7aad7d366e1e286cca048de159c7.jpeg "Itamar Syn Hershko - "Full-text search with Lucene and neat things you can do with it"") ](https://www.youtube.com/watch?v=QI566fe9Svs)

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
[Lucene.NET](http://Lucene.NET) committer and PMC member

On Thu, Mar 19, 2015 at 2:33 PM, James [mail@employ.com](mailto:mail@employ.com) wrote:

> Thank you for the reply. I thought it was much about making my search  
> query not require an exact match, rather than splitting down the words I am  
> searching against?
> 
> On 19 March 2015 at 12:30, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com) wrote:
> 
> > You should use this then:  
> > [Word delimiter token filter | Elasticsearch Guide [8.11] | Elastic](http://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-word-delimiter-tokenfilter.html)
> > 
> > --
> > 
> > Itamar Syn-Hershko  
> > [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> > Freelance Developer & Consultant  
> > [Lucene.NET](http://Lucene.NET) committer and PMC member
> > 
> > On Thu, Mar 19, 2015 at 2:26 PM, James [mail@employ.com](mailto:mail@employ.com) wrote:
> > 
> > > Currently I have an item in my elasticsearch index with the title:  
> > > _testing123_
> > > 
> > > When I search for it, I can only get it returned if I search  
> > > _testing123_ exactly. However, I want to be able to search _testing_  
> > > and have it returned too.
> > > 
> > > How can I have it so the search must start with that term but also not  
> > > be an exact match?
> > > 
> > > Any help would be appreciated.
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/de42c52d-1566-461e-b578-594aa963a498%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/psZ8iAVOziM/unsubscribe](https://groups.google.com/d/topic/elasticsearch/psZ8iAVOziM/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvcvCYD0\_SRY\_QcHNcytaj7KcmCH2itJcUsPCTc2FjsrQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvcvCYD0_SRY_QcHNcytaj7KcmCH2itJcUsPCTc2FjsrQ%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvcvCYD0\_SRY\_QcHNcytaj7KcmCH2itJcUsPCTc2FjsrQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvcvCYD0_SRY_QcHNcytaj7KcmCH2itJcUsPCTc2FjsrQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAPng%3D3f7pQOm4HPkxtec3or%2Ba4ZUVpC1USb7tWMaD9cvicQ8gQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPng%3D3f7pQOm4HPkxtec3or%2Ba4ZUVpC1USb7tWMaD9cvicQ8gQ%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAPng%3D3f7pQOm4HPkxtec3or%2Ba4ZUVpC1USb7tWMaD9cvicQ8gQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAPng%3D3f7pQOm4HPkxtec3or%2Ba4ZUVpC1USb7tWMaD9cvicQ8gQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zs9A%2B5mVB1txVyFX-KX%3DtXu9m5Rmq0e2n7ET5G3JZnpYQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zs9A%2B5mVB1txVyFX-KX%3DtXu9m5Rmq0e2n7ET5G3JZnpYQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:25am UTC](https://discuss.elastic.co/t/elasticsearch-not-require-an-exact-match/22758/5 "2017-07-06T00:25:38Z")

</div>


