# Elasticsearch Reverse Suggester Problem

**URL:** <https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986>\
**Category:** Elasticsearch\
**Created:** [February 24, 2014, 11:39am UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986 "2014-02-24T11:39:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkwelding](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gkwelding/32/1658_2.png) [@gkwelding](https://discuss.elastic.co/u/gkwelding)\
**Post date:** [February 24, 2014, 11:39am UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986/1 "2014-02-24T11:39:00Z")

</div>

Hi guys, I'm hoping somebody on here can help me, I feel like I'm just  
missing something really basic but I can't for the life of me figure out  
what... I have the following index set up (it's very cut down for clarity's  
sake):

{  
"index":"products",  
"body":{  
"settings":{  
"number\_of\_shards":5,  
"number\_of\_replicas":1,  
"analysis":{  
"analyzer":{  
"default":{  
"type":"snowball",  
"language":"English"  
},  
"reverse":{  
"type":"custom",  
"language":"English",  
"tokenizer":"standard",

"filter":["standard","lowercase","stop","snowball","reverse"]  
}  
}  
}  
},  
"mappings":{  
"product":{  
"properties":{  
"\_all":{"enabled":true},

"id":{"type":"string","include\_in\_all":true,"index":"analyzed","analyzer":"snowball","store":"yes"},

"name":{"type":"string","include\_in\_all":true,"index":"analyzed","analyzer":"snowball","store":"yes"},

"name\_reverse":{"type":"string","include\_in\_all":true,"index":"analyzed","analyzer":"reverse","store":"yes"}  
}  
}  
}  
}  
}

I'm then running search queries against this and I'm now trying to do  
suggesters. The following query works fine and returns no "suggests" as  
expected:

{  
"index":"products",  
"type":"product",  
"body":{  
"indices\_boost":{"id":2,"name":1.5},  
"query":{  
"filtered":{  
"query":{  
"query\_string":{  
"query":"pushchair",  
"fields":["id","name"]  
}  
}  
}  
},  
"suggest":{  
"text":"pushchair",  
"simple\_phrase":{  
"phrase":{  
"field":"name",  
"size":4,  
"real\_word\_error\_likelihood":0.95,  
"confidence":1,  
"gram\_size":1,  
"direct\_generator":[  
{  
"field":"name",  
"suggest\_mode":"always",  
"min\_word\_len":1  
}  
}  
}  
}  
}  
}

The next query also works fine and returns the expected suggestions:

{  
"index":"products",  
"type":"product",  
"body":{  
"indices\_boost":{"id":2,"name":1.5},  
"query":{  
"filtered":{  
"query":{  
"query\_string":{  
"query":"pushchiar",  
"fields":["id","name"]  
}  
}  
}  
},  
"suggest":{  
"text":"pushchair",  
"simple\_phrase":{  
"phrase":{  
"field":"name",  
"size":4,  
"real\_word\_error\_likelihood":0.95,  
"confidence":1,  
"gram\_size":1,  
"direct\_generator":[  
{  
"field":"name",  
"suggest\_mode":"always",  
"min\_word\_len":1  
}  
}  
}  
}  
}  
}

As you can see, "pushchair" is spelt incorrectly and then response from  
Elasticsearch provides the correct suggestion. The problem comes when I try  
to add in reverse support as follows:

{  
"index":"products",  
"type":"product",  
"body":{  
"indices\_boost":{"id":2,"name":1.5},  
"query":{  
"filtered":{  
"query":{  
"query\_string":{  
"query":"pushchair",  
"fields":["id","name"]  
}  
}  
}  
},  
"suggest":{  
"text":"pushchair",  
"simple\_phrase":{  
"phrase":{  
"field":"name",  
"size":4,  
"real\_word\_error\_likelihood":0.95,  
"confidence":1,  
"gram\_size":1,  
"direct\_generator":[  
{  
"field":"name",  
"suggest\_mode":"always",  
"min\_word\_len":1  
},{  
"field":"name\_reverse",  
"suggest\_mode":"always",  
"min\_word\_len":1,  
"pre\_filter":"reverse",  
"post\_filter":"reverse"  
}  
]  
}  
}  
}  
}  
}

Now I start hitting problems. A query for "pushchair" returns results and  
no suggestions (as expected), a query for "pushchiar" returns no results  
and a suggestion to use "pushchair" instead. The problem is when querying  
"upshchair", I get 0 results and 0 suggestions... My understanding of  
providing a reversed index and reverse filters on the suggester was that it  
would then reverse match on "riahchspu" and "riahchsup" and return  
"pushchair" as a suggestion.

I can also see that the reverse analyzer's working because when I hit  
localhost:9200/searchable/\_analyze?analyzer=reverse&text=pushchair I get  
the following response:

{"tokens":[{"token":"riahchsup","start\_offset":0,"end\_offset":9,"type":"","position":1}]}

Any help would be much 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/31d30976-402d-47e7-8dd6-8ec2fc1ef5a6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/31d30976-402d-47e7-8dd6-8ec2fc1ef5a6%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![gkwelding](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gkwelding/32/1658_2.png) [@gkwelding](https://discuss.elastic.co/u/gkwelding)\
**Post date:** [February 24, 2014, 12:35pm UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986/2 "2014-02-24T12:35:50Z")

</div>

Argh, knew I'd forget something, the blooming ES version number! I'm on the  
latest 1.0 version.

On Monday, February 24, 2014 11:39:00 AM UTC, Garry Welding wrote:

> Hi guys, I'm hoping somebody on here can help me, I feel like I'm just  
> missing something really basic but I can't for the life of me figure out  
> what... I have the following index set up (it's very cut down for clarity's  
> sake):
> 
> {  
> "index":"products",  
> "body":{  
> "settings":{  
> "number\_of\_shards":5,  
> "number\_of\_replicas":1,  
> "analysis":{  
> "analyzer":{  
> "default":{  
> "type":"snowball",  
> "language":"English"  
> },  
> "reverse":{  
> "type":"custom",  
> "language":"English",  
> "tokenizer":"standard",
> 
> "filter":["standard","lowercase","stop","snowball","reverse"]  
> }  
> }  
> }  
> },  
> "mappings":{  
> "product":{  
> "properties":{  
> "\_all":{"enabled":true},
> 
> "id":{"type":"string","include\_in\_all":true,"index":"analyzed","analyzer":"snowball","store":"yes"},
> 
> "name":{"type":"string","include\_in\_all":true,"index":"analyzed","analyzer":"snowball","store":"yes"},
> 
> "name\_reverse":{"type":"string","include\_in\_all":true,"index":"analyzed","analyzer":"reverse","store":"yes"}  
> }  
> }  
> }  
> }  
> }
> 
> I'm then running search queries against this and I'm now trying to do  
> suggesters. The following query works fine and returns no "suggests" as  
> expected:
> 
> {  
> "index":"products",  
> "type":"product",  
> "body":{  
> "indices\_boost":{"id":2,"name":1.5},  
> "query":{  
> "filtered":{  
> "query":{  
> "query\_string":{  
> "query":"pushchair",  
> "fields":["id","name"]  
> }  
> }  
> }  
> },  
> "suggest":{  
> "text":"pushchair",  
> "simple\_phrase":{  
> "phrase":{  
> "field":"name",  
> "size":4,  
> "real\_word\_error\_likelihood":0.95,  
> "confidence":1,  
> "gram\_size":1,  
> "direct\_generator":[  
> {  
> "field":"name",  
> "suggest\_mode":"always",  
> "min\_word\_len":1  
> }  
> }  
> }  
> }  
> }  
> }
> 
> The next query also works fine and returns the expected suggestions:
> 
> {  
> "index":"products",  
> "type":"product",  
> "body":{  
> "indices\_boost":{"id":2,"name":1.5},  
> "query":{  
> "filtered":{  
> "query":{  
> "query\_string":{  
> "query":"pushchiar",  
> "fields":["id","name"]  
> }  
> }  
> }  
> },  
> "suggest":{  
> "text":"pushchair",  
> "simple\_phrase":{  
> "phrase":{  
> "field":"name",  
> "size":4,  
> "real\_word\_error\_likelihood":0.95,  
> "confidence":1,  
> "gram\_size":1,  
> "direct\_generator":[  
> {  
> "field":"name",  
> "suggest\_mode":"always",  
> "min\_word\_len":1  
> }  
> }  
> }  
> }  
> }  
> }
> 
> As you can see, "pushchair" is spelt incorrectly and then response from  
> Elasticsearch provides the correct suggestion. The problem comes when I try  
> to add in reverse support as follows:
> 
> {  
> "index":"products",  
> "type":"product",  
> "body":{  
> "indices\_boost":{"id":2,"name":1.5},  
> "query":{  
> "filtered":{  
> "query":{  
> "query\_string":{  
> "query":"pushchair",  
> "fields":["id","name"]  
> }  
> }  
> }  
> },  
> "suggest":{  
> "text":"pushchair",  
> "simple\_phrase":{  
> "phrase":{  
> "field":"name",  
> "size":4,  
> "real\_word\_error\_likelihood":0.95,  
> "confidence":1,  
> "gram\_size":1,  
> "direct\_generator":[  
> {  
> "field":"name",  
> "suggest\_mode":"always",  
> "min\_word\_len":1  
> },{  
> "field":"name\_reverse",  
> "suggest\_mode":"always",  
> "min\_word\_len":1,  
> "pre\_filter":"reverse",  
> "post\_filter":"reverse"  
> }  
> ]  
> }  
> }  
> }  
> }  
> }
> 
> Now I start hitting problems. A query for "pushchair" returns results and  
> no suggestions (as expected), a query for "pushchiar" returns no results  
> and a suggestion to use "pushchair" instead. The problem is when querying  
> "upshchair", I get 0 results and 0 suggestions... My understanding of  
> providing a reversed index and reverse filters on the suggester was that it  
> would then reverse match on "riahchspu" and "riahchsup" and return  
> "pushchair" as a suggestion.
> 
> I can also see that the reverse analyzer's working because when I hit  
> localhost:9200/searchable/\_analyze?analyzer=reverse&text=pushchair I get  
> the following response:
> 
> {"tokens":[{"token":"riahchsup","start\_offset":0,"end\_offset":9,"type":"","position":1}]}
> 
> Any help would be much 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/187ad946-d400-460e-b3f3-d0e13468a434%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/187ad946-d400-460e-b3f3-d0e13468a434%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![gkwelding](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gkwelding/32/1658_2.png) [@gkwelding](https://discuss.elastic.co/u/gkwelding)\
**Post date:** [February 25, 2014, 7:28pm UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986/3 "2014-02-25T19:28:16Z")

</div>

Really, nobody has an answer to this?

--  
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/35deb787-48f5-4d22-82fc-5d4cc178d87f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/35deb787-48f5-4d22-82fc-5d4cc178d87f%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [February 25, 2014, 8:00pm UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986/4 "2014-02-25T20:00:14Z")

</div>

I believe the job of the reverse filter is to efficiently provide  
suggestions that share a suffix with the provided term rather than a  
prefix. You might try removing the pre\_filter to see if it handles  
reversed words.

The reason for the reverse index for the suffix is that lucene stores terms  
in sorted order and the suggester requires there to be a prefix match to  
slice the portion of the index that must be scanned for terms.

Nik

On Tue, Feb 25, 2014 at 2:28 PM, Garry Welding [gkwelding@gmail.com](mailto:gkwelding@gmail.com) wrote:

> Really, nobody has an answer to this?
> 
> --  
> 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/35deb787-48f5-4d22-82fc-5d4cc178d87f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/35deb787-48f5-4d22-82fc-5d4cc178d87f%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3-ZLq%2BKMiWo4LZQQpGDYGq9%3Dan74jKY1kCQ%3D1vRKWGrg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3-ZLq%2BKMiWo4LZQQpGDYGq9%3Dan74jKY1kCQ%3D1vRKWGrg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![gkwelding](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gkwelding/32/1658_2.png) [@gkwelding](https://discuss.elastic.co/u/gkwelding)\
**Post date:** [February 26, 2014, 8:51am UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986/5 "2014-02-26T08:51:12Z")

</div>

Hi Nik, thanks for the suggestion. That's why I'm using the pre and post  
filters as I want to match the suffix of "upshchair" because I understand  
how Lucene stores terms. As such I have set up a new property called  
name\_reverse that stores the product name as reversed tokens. I'm then  
trying to do the 2nd suggester against that and reverse the query passed to  
it by using the reverse pre/post filters to do matching on the suffix  
instead of the prefix.

On Tuesday, February 25, 2014 8:00:14 PM UTC, Nikolas Everett wrote:

> I believe the job of the reverse filter is to efficiently provide  
> suggestions that share a suffix with the provided term rather than a  
> prefix. You might try removing the pre\_filter to see if it handles  
> reversed words.
> 
> The reason for the reverse index for the suffix is that lucene stores  
> terms in sorted order and the suggester requires there to be a prefix match  
> to slice the portion of the index that must be scanned for terms.
> 
> Nik
> 
> On Tue, Feb 25, 2014 at 2:28 PM, Garry Welding \<[gkwe...@gmail.com](mailto:gkwe...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Really, nobody has an answer to this?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/35deb787-48f5-4d22-82fc-5d4cc178d87f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/35deb787-48f5-4d22-82fc-5d4cc178d87f%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ac1b1bee-39c2-4412-8a56-7d32a25bdd2a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ac1b1bee-39c2-4412-8a56-7d32a25bdd2a%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![gkwelding](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gkwelding/32/1658_2.png) [@gkwelding](https://discuss.elastic.co/u/gkwelding)\
**Post date:** [February 26, 2014, 8:55am UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986/6 "2014-02-26T08:55:23Z")

</div>

However, I did give it a try removing the pre filter, but it didn't change  
the results.

On Tuesday, February 25, 2014 8:00:14 PM UTC, Nikolas Everett wrote:

> I believe the job of the reverse filter is to efficiently provide  
> suggestions that share a suffix with the provided term rather than a  
> prefix. You might try removing the pre\_filter to see if it handles  
> reversed words.
> 
> The reason for the reverse index for the suffix is that lucene stores  
> terms in sorted order and the suggester requires there to be a prefix match  
> to slice the portion of the index that must be scanned for terms.
> 
> Nik
> 
> On Tue, Feb 25, 2014 at 2:28 PM, Garry Welding \<[gkwe...@gmail.com](mailto:gkwe...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Really, nobody has an answer to this?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/35deb787-48f5-4d22-82fc-5d4cc178d87f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/35deb787-48f5-4d22-82fc-5d4cc178d87f%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6171d924-678f-40e6-ae9b-08694e14fde1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6171d924-678f-40e6-ae9b-08694e14fde1%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [February 26, 2014, 2:28pm UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986/7 "2014-02-26T14:28:14Z")

</div>

I'm not sure what to do then. I only use the phrase suggesting in forwards  
mode and only know the theory behind the reverse stuff.

Nik

On Wed, Feb 26, 2014 at 3:55 AM, Garry Welding [gkwelding@gmail.com](mailto:gkwelding@gmail.com) wrote:

> However, I did give it a try removing the pre filter, but it didn't change  
> the results.
> 
> On Tuesday, February 25, 2014 8:00:14 PM UTC, Nikolas Everett wrote:
> 
> > I believe the job of the reverse filter is to efficiently provide  
> > suggestions that share a suffix with the provided term rather than a  
> > prefix. You might try removing the pre\_filter to see if it handles  
> > reversed words.
> > 
> > The reason for the reverse index for the suffix is that lucene stores  
> > terms in sorted order and the suggester requires there to be a prefix match  
> > to slice the portion of the index that must be scanned for terms.
> > 
> > Nik
> > 
> > On Tue, Feb 25, 2014 at 2:28 PM, Garry Welding [gkwe...@gmail.com](mailto:gkwe...@gmail.com) wrote:
> > 
> > > Really, nobody has an answer to this?
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/35deb787-48f5-4d22-82fc-5d4cc178d87f%  
> > > [40googlegroups.com](http://40googlegroups.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).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/6171d924-678f-40e6-ae9b-08694e14fde1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6171d924-678f-40e6-ae9b-08694e14fde1%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3VmZeg%3D2jgJfhp96Aa%2BgYhCowEM3CB0VDmxjOJiv8oYw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3VmZeg%3D2jgJfhp96Aa%2BgYhCowEM3CB0VDmxjOJiv8oYw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![gkwelding](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gkwelding/32/1658_2.png) [@gkwelding](https://discuss.elastic.co/u/gkwelding)\
**Post date:** [March 3, 2014, 2:13pm UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986/8 "2014-03-03T14:13:01Z")

</div>

Just a little bump for this as I still haven't gotten to the bottom of it.  
If anyone with the answer wants the rep on SO you can answer here  
([http://stackoverflow.com/questions/21989644/having-an-issue-with-elasticsearch-reverse-suggesters](http://stackoverflow.com/questions/21989644/having-an-issue-with-elasticsearch-reverse-suggesters))  
instead...

On Wednesday, February 26, 2014 2:28:14 PM UTC, Nikolas Everett wrote:

> I'm not sure what to do then. I only use the phrase suggesting in  
> forwards mode and only know the theory behind the reverse stuff.
> 
> Nik
> 
> On Wed, Feb 26, 2014 at 3:55 AM, Garry Welding \<[gkwe...@gmail.com](mailto:gkwe...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > However, I did give it a try removing the pre filter, but it didn't  
> > change the results.
> > 
> > On Tuesday, February 25, 2014 8:00:14 PM UTC, Nikolas Everett wrote:
> > 
> > > I believe the job of the reverse filter is to efficiently provide  
> > > suggestions that share a suffix with the provided term rather than a  
> > > prefix. You might try removing the pre\_filter to see if it handles  
> > > reversed words.
> > > 
> > > The reason for the reverse index for the suffix is that lucene stores  
> > > terms in sorted order and the suggester requires there to be a prefix match  
> > > to slice the portion of the index that must be scanned for terms.
> > > 
> > > Nik
> > > 
> > > On Tue, Feb 25, 2014 at 2:28 PM, Garry Welding [gkwe...@gmail.com](mailto:gkwe...@gmail.com)wrote:
> > > 
> > > > Really, nobody has an answer to this?
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/35deb787-48f5-4d22-82fc-5d4cc178d87f%  
> > > > [40googlegroups.com](http://40googlegroups.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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/6171d924-678f-40e6-ae9b-08694e14fde1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6171d924-678f-40e6-ae9b-08694e14fde1%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/72bebdf3-4159-4ff4-a8de-a5dcb985c793%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/72bebdf3-4159-4ff4-a8de-a5dcb985c793%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![gkwelding](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gkwelding/32/1658_2.png) [@gkwelding](https://discuss.elastic.co/u/gkwelding)\
**Post date:** [March 3, 2014, 2:21pm UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986/9 "2014-03-03T14:21:35Z")

</div>

I'm marking this as resolved... What did I do to fix it? No idea... It just  
started magically working... Which means I was doing something wrong when  
testing this functionality...

On Monday, March 3, 2014 2:13:01 PM UTC, Garry Welding wrote:

> Just a little bump for this as I still haven't gotten to the bottom of it.  
> If anyone with the answer wants the rep on SO you can answer here (  
> [http://stackoverflow.com/questions/21989644/having-an-issue-with-elasticsearch-reverse-suggesters](http://stackoverflow.com/questions/21989644/having-an-issue-with-elasticsearch-reverse-suggesters))  
> instead...
> 
> On Wednesday, February 26, 2014 2:28:14 PM UTC, Nikolas Everett wrote:
> 
> > I'm not sure what to do then. I only use the phrase suggesting in  
> > forwards mode and only know the theory behind the reverse stuff.
> > 
> > Nik
> > 
> > On Wed, Feb 26, 2014 at 3:55 AM, Garry Welding [gkwe...@gmail.com](mailto:gkwe...@gmail.com) wrote:
> > 
> > > However, I did give it a try removing the pre filter, but it didn't  
> > > change the results.
> > > 
> > > On Tuesday, February 25, 2014 8:00:14 PM UTC, Nikolas Everett wrote:
> > > 
> > > > I believe the job of the reverse filter is to efficiently provide  
> > > > suggestions that share a suffix with the provided term rather than a  
> > > > prefix. You might try removing the pre\_filter to see if it handles  
> > > > reversed words.
> > > > 
> > > > The reason for the reverse index for the suffix is that lucene stores  
> > > > terms in sorted order and the suggester requires there to be a prefix match  
> > > > to slice the portion of the index that must be scanned for terms.
> > > > 
> > > > Nik
> > > > 
> > > > On Tue, Feb 25, 2014 at 2:28 PM, Garry Welding [gkwe...@gmail.com](mailto:gkwe...@gmail.com)wrote:
> > > > 
> > > > > Really, nobody has an answer to this?
> > > > > 
> > > > > --  
> > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/35deb787-48f5-4d22-82fc-5d4cc178d87f%  
> > > > > [40googlegroups.com](http://40googlegroups.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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/6171d924-678f-40e6-ae9b-08694e14fde1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6171d924-678f-40e6-ae9b-08694e14fde1%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7ce2b243-1ff3-49e9-a297-1e5daff8ed1d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7ce2b243-1ff3-49e9-a297-1e5daff8ed1d%40googlegroups.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, 1:46am UTC](https://discuss.elastic.co/t/elasticsearch-reverse-suggester-problem/15986/10 "2017-07-06T01:46:11Z")

</div>


