# Elastic search suffix query

**URL:** <https://discuss.elastic.co/t/elastic-search-suffix-query/10655>\
**Category:** Elasticsearch\
**Created:** [February 7, 2013, 8:36pm UTC](https://discuss.elastic.co/t/elastic-search-suffix-query/10655 "2013-02-07T20:36:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohit\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mohit\_Kumar](https://discuss.elastic.co/u/mohit_Kumar)\
**Post date:** [February 7, 2013, 8:36pm UTC](https://discuss.elastic.co/t/elastic-search-suffix-query/10655/1 "2013-02-07T20:36:03Z")

</div>

hello sir,  
I am facing a problem in elastic search while running a query.

How one can search a word through its middle or last letters. For example  
CORPORATION is a words and I am able to search CORPORATION with its  
initials like COR, CO, C etc by using EdgeGram and prefix filter. but I am  
not able to search it with last letters or middle letters of CORPORATION  
that is POR or RATI or ION. is elastic search support this features? if yes  
then please help me how can I resolve this issue.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 7, 2013, 9:24pm UTC](https://discuss.elastic.co/t/elastic-search-suffix-query/10655/2 "2013-02-07T21:24:54Z")

</div>

You should look at nGram, not EdgeNGram.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 7 févr. 2013 à 21:36, Mohit Kumar Yadav [mohit.kumar.ngi@gmail.com](mailto:mohit.kumar.ngi@gmail.com) a écrit :

> hello sir,  
> I am facing a problem in Elasticsearch while running a query.
> 
> How one can search a word through its middle or last letters. For example CORPORATION is a words and I am able to search CORPORATION with its initials like COR, CO, C etc by using EdgeGram and prefix filter. but I am not able to search it with last letters or middle letters of CORPORATION that is POR or RATI or ION. is Elasticsearch support this features? if yes then please help me how can I resolve this issue.
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Michael\_Kleen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_kleen/32/2496_2.png) [@Michael\_Kleen](https://discuss.elastic.co/u/Michael_Kleen)\
**Post date:** [February 8, 2013, 2:59pm UTC](https://discuss.elastic.co/t/elastic-search-suffix-query/10655/3 "2013-02-08T14:59:34Z")

</div>

Hello,

here is a full working example using a ngram tokenizer:

[https://gist.github.com/mkleen/4739479](https://gist.github.com/mkleen/4739479)

Regards,

Michael

On Thursday, February 7, 2013 9:36:03 PM UTC+1, Mohit Kumar Yadav wrote:

> hello sir,  
> I am facing a problem in Elasticsearch while running a query.
> 
> How one can search a word through its middle or last letters. For example  
> CORPORATION is a words and I am able to search CORPORATION with its  
> initials like COR, CO, C etc by using EdgeGram and prefix filter. but I am  
> not able to search it with last letters or middle letters of CORPORATION  
> that is POR or RATI or ION. is Elasticsearch support this features? if yes  
> then please help me how can I resolve this issue.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:52am UTC](https://discuss.elastic.co/t/elastic-search-suffix-query/10655/4 "2017-07-06T02:52:24Z")

</div>


