Spellchecking with term and phrase suggesters

Hi all,

I need to set up a system that provides spellchecking functionality on user
searches, similar to what Google does with its well known *did-you-mean *
suggestions.
The term suggester works very well for single words, but it doesn't take
into account shingles, thus not being able to provide suggestions that are
accurate enough for the standards I need to reach.
The *phrase suggester *is perfect for what I need, working with my shingle
fields to rank suggestions based on a language model, but it will not
provide any suggestions for single-term queries.

    {
        "phrase" : {
            "size"                       : 1,
            "gram_size"                  : 2,
            "field"                      : "description.shingle",
            "analyzer"                   : "intact",
            "direct_generator"           : [
                {"field" : "description.unstemmed"}
            ]
        }
    }

At the moment I'm mixing this phrase suggester with a term suggester,
returning from one or from the other depending on the length of the
provided query, but I cannot understand why the phrase suggester cannot
just output single-term suggestions as well.
Any help?

Michele

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6536746f-887d-4c7c-9679-a117fe2c3add%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

On Fri, Dec 5, 2014 at 11:49 AM, Michele Palmia micpalmia@gmail.com wrote:

Hi all,

I need to set up a system that provides spellchecking functionality on
user searches, similar to what Google does with its well known *did-you-mean
*suggestions.
The term suggester works very well for single words, but it doesn't
take into account shingles, thus not being able to provide suggestions that
are accurate enough for the standards I need to reach.
The *phrase suggester *is perfect for what I need, working with my
shingle fields to rank suggestions based on a language model, but it
will not provide any suggestions for single-term queries.

That right there sounds like a bug. You should get something for single
term queries. If you could put together some concise reproduction steps
with curl and file it as an issue I'll look into it.

Nik

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2RdhksUmJWHyF7q3id5uXv%2BXh8ZRrO3vOh5QtJwfPJSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

On Fri, Dec 5, 2014 at 12:43 PM, Nikolas Everett nik9000@gmail.com wrote:

On Fri, Dec 5, 2014 at 11:49 AM, Michele Palmia micpalmia@gmail.com
wrote:

Hi all,

I need to set up a system that provides spellchecking functionality on
user searches, similar to what Google does with its well known *did-you-mean
*suggestions.
The term suggester works very well for single words, but it doesn't
take into account shingles, thus not being able to provide suggestions that
are accurate enough for the standards I need to reach.
The *phrase suggester *is perfect for what I need, working with my
shingle fields to rank suggestions based on a language model, but it
will not provide any suggestions for single-term queries.

That right there sounds like a bug. You should get something for single
term queries. If you could put together some concise reproduction steps
with curl and file it as an issue I'll look into it.

Replying to myself:

I'm able to get the phrase suggester to spit out single word suggestions:


So maybe its a problem or your end.

Here is how it all comes about:



Those contain the query, mapping, and settings in the indexes involved.

If I had to suggest I'd say you might not be including unigrams in your
suggest field.

Nik

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0Dze3W4pnNJPNRVN-WXao9RygxNKpGLF3AK7uoLAx4kg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

I'm able to get the phrase suggester to spit out single word suggestions:
https://en.wikipedia.org/w/index.php?title=Special%
3ASearch&profile=default&search=gult&fulltext=Search
So maybe its a problem or your end.

If I had to suggest I'd say you might not be including unigrams in your

suggest field.

Yes, that's actually true. As the documentation for the phrase suggester is
not very explicit, I tried using a shingle field I was already using for
proximity queries as the suggestion field, but that doesn't output unigrams.

The resources you linked are incredibly useful (and not just for the
suggesters). Thank you very much!
Michele

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALkm6ke__P9VY5RHN%3Dp2mauFV98SWDTM-ZQ_QkwYHsiPGe1TiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.