You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Student 1 <st...@gmail.com> on 2017/06/28 16:47:41 UTC

Suggester and fuzzy/infix suggestions

Hi,

I'm trying to implement suggestions mechanism using Solr Suggester
component, that would work like this:

- look inside of the field (like AnalyzingInfixLookupFactory does) AND
- allow for minor spelling mistakes (like FuzzyLookupFactory does).

Is it at all possible? It looks to me, like you can only get one behaviour
- either look inside the field and require strictly correct spelling, OR
allow for typos but match only beginning of the field.

Regards,
Piotr

Re: Suggester and fuzzy/infix suggestions

Posted by Walter Underwood <wu...@wunderwood.org>.
Yes, but it is better than nothing. Don’t let the unavailable perfect solution keep you from implementing the available good solution.

If you want to easily use fuzzy search with edismax, check out the patch submitted with SOLR-629.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)


> On Jun 28, 2017, at 12:06 PM, Student 1 <st...@gmail.com> wrote:
> 
> I thought about that - but that does not solve the issue. If the user types
> in a misspelled word, and that word is somewhere in the middle of the
> field, that result will not be returned.
> 
> 2017-06-28 19:00 GMT+02:00 Walter Underwood <wu...@wunderwood.org>:
> 
>> I set up two suggesters, one fuzzy and one analyzing infix. That gives two
>> sets of suggestions, so the client code has to merge them into one list and
>> toss duplicates.
>> 
>> They use the same weights, so I can keep the top weighted suggestions.
>> 
>> wunder
>> Walter Underwood
>> wunder@wunderwood.org
>> http://observer.wunderwood.org/  (my blog)
>> 
>> 
>>> On Jun 28, 2017, at 9:47 AM, Student 1 <st...@gmail.com> wrote:
>>> 
>>> Hi,
>>> 
>>> I'm trying to implement suggestions mechanism using Solr Suggester
>>> component, that would work like this:
>>> 
>>> - look inside of the field (like AnalyzingInfixLookupFactory does) AND
>>> - allow for minor spelling mistakes (like FuzzyLookupFactory does).
>>> 
>>> Is it at all possible? It looks to me, like you can only get one
>> behaviour
>>> - either look inside the field and require strictly correct spelling, OR
>>> allow for typos but match only beginning of the field.
>>> 
>>> Regards,
>>> Piotr
>> 
>> 


Re: Suggester and fuzzy/infix suggestions

Posted by Student 1 <st...@gmail.com>.
I thought about that - but that does not solve the issue. If the user types
in a misspelled word, and that word is somewhere in the middle of the
field, that result will not be returned.

2017-06-28 19:00 GMT+02:00 Walter Underwood <wu...@wunderwood.org>:

> I set up two suggesters, one fuzzy and one analyzing infix. That gives two
> sets of suggestions, so the client code has to merge them into one list and
> toss duplicates.
>
> They use the same weights, so I can keep the top weighted suggestions.
>
> wunder
> Walter Underwood
> wunder@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
>
>
> > On Jun 28, 2017, at 9:47 AM, Student 1 <st...@gmail.com> wrote:
> >
> > Hi,
> >
> > I'm trying to implement suggestions mechanism using Solr Suggester
> > component, that would work like this:
> >
> > - look inside of the field (like AnalyzingInfixLookupFactory does) AND
> > - allow for minor spelling mistakes (like FuzzyLookupFactory does).
> >
> > Is it at all possible? It looks to me, like you can only get one
> behaviour
> > - either look inside the field and require strictly correct spelling, OR
> > allow for typos but match only beginning of the field.
> >
> > Regards,
> > Piotr
>
>

Re: Suggester and fuzzy/infix suggestions

Posted by Walter Underwood <wu...@wunderwood.org>.
I set up two suggesters, one fuzzy and one analyzing infix. That gives two sets of suggestions, so the client code has to merge them into one list and toss duplicates.

They use the same weights, so I can keep the top weighted suggestions.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)


> On Jun 28, 2017, at 9:47 AM, Student 1 <st...@gmail.com> wrote:
> 
> Hi,
> 
> I'm trying to implement suggestions mechanism using Solr Suggester
> component, that would work like this:
> 
> - look inside of the field (like AnalyzingInfixLookupFactory does) AND
> - allow for minor spelling mistakes (like FuzzyLookupFactory does).
> 
> Is it at all possible? It looks to me, like you can only get one behaviour
> - either look inside the field and require strictly correct spelling, OR
> allow for typos but match only beginning of the field.
> 
> Regards,
> Piotr


Re: Suggester and fuzzy/infix suggestions

Posted by "alessandro.benedetti" <a....@sease.io>.
Another path to follow could be to design a specific collection(index) for
the auto-suggestion.
In there you can define the analysis chain as you like ( for example using
edge-ngram filtering on top of tokenisation) to provide infix
autocompletion.
Then you can play with your queries as you like and potentially run fuzzy
queries.

Under the hood the AnalyzingInfixLookupFactory is using an internal
auxiliary Lucene index, so won't be that different.
If you don't want to go with an external index, you could potentially just
add an additional field with the analysis you like in the current
collection.




-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
View this message in context: http://lucene.472066.n3.nabble.com/Suggester-and-fuzzy-infix-suggestions-tp4343225p4343382.html
Sent from the Solr - User mailing list archive at Nabble.com.