Autocomplete (suggest) functionality that ignores terms order

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Autocomplete (suggest) functionality that ignores terms order

p.e.g.o
Hi,

I'm trying to implement an autocomplete feature based on a filtered set of
documents.

A user enters multiple terms (separated by space) in an input field and
will get some word suggestions only for the last word entered. All the
words before the current/last word should be used as filter criteria. The
last/current word entered will be auto suggested.

Documents in my index:

||ID||field||
|1|The quick brown fox was seen in this country|
|2|The fox is quick and has brown dots.|
|3|The fish is quick and it's colour is brown.|
|4|Many peope saw the falcon in the sky|

i.e. a users enters the following text in an autocomplete input field: The
brown f

The auto complete dropdown should suggest terms like 'fox', 'fish'.

The query for filtering the documents should be like (stopwords are ignored
in this example)

+field:the +field:brown

How would you guys realize this requirement in Lucene?

Thx in advance - best regards,

pego
Reply | Threaded
Open this post in threaded view
|

Re: Autocomplete (suggest) functionality that ignores terms order

Mikhail Khludnev-2
I skim through  https://lucidworks.com/2015/03/04/solr-suggester/ It seems
like AnalyzingInfixLookupFactory.
Note despite the blog is about Solr it's based on Lucene classes.

On Sun, Apr 21, 2019 at 11:36 PM Peter Gößweiner <
[hidden email]> wrote:

> Hi,
>
> I'm trying to implement an autocomplete feature based on a filtered set of
> documents.
>
> A user enters multiple terms (separated by space) in an input field and
> will get some word suggestions only for the last word entered. All the
> words before the current/last word should be used as filter criteria. The
> last/current word entered will be auto suggested.
>
> Documents in my index:
>
> ||ID||field||
> |1|The quick brown fox was seen in this country|
> |2|The fox is quick and has brown dots.|
> |3|The fish is quick and it's colour is brown.|
> |4|Many peope saw the falcon in the sky|
>
> i.e. a users enters the following text in an autocomplete input field: The
> brown f
>
> The auto complete dropdown should suggest terms like 'fox', 'fish'.
>
> The query for filtering the documents should be like (stopwords are ignored
> in this example)
>
> +field:the +field:brown
>
> How would you guys realize this requirement in Lucene?
>
> Thx in advance - best regards,
>
> pego
>


--
Sincerely yours
Mikhail Khludnev
Reply | Threaded
Open this post in threaded view
|

Re: Autocomplete (suggest) functionality that ignores terms order

p.e.g.o
Aweseome...AnalyzingInfixSuggester is the way to go. Thanks a lot!

Am Mo., 22. Apr. 2019 um 11:21 Uhr schrieb Mikhail Khludnev <[hidden email]
>:

> I skim through  https://lucidworks.com/2015/03/04/solr-suggester/ It seems
> like AnalyzingInfixLookupFactory.
> Note despite the blog is about Solr it's based on Lucene classes.
>
> On Sun, Apr 21, 2019 at 11:36 PM Peter Gößweiner <
> [hidden email]> wrote:
>
> > Hi,
> >
> > I'm trying to implement an autocomplete feature based on a filtered set
> of
> > documents.
> >
> > A user enters multiple terms (separated by space) in an input field and
> > will get some word suggestions only for the last word entered. All the
> > words before the current/last word should be used as filter criteria. The
> > last/current word entered will be auto suggested.
> >
> > Documents in my index:
> >
> > ||ID||field||
> > |1|The quick brown fox was seen in this country|
> > |2|The fox is quick and has brown dots.|
> > |3|The fish is quick and it's colour is brown.|
> > |4|Many peope saw the falcon in the sky|
> >
> > i.e. a users enters the following text in an autocomplete input field:
> The
> > brown f
> >
> > The auto complete dropdown should suggest terms like 'fox', 'fish'.
> >
> > The query for filtering the documents should be like (stopwords are
> ignored
> > in this example)
> >
> > +field:the +field:brown
> >
> > How would you guys realize this requirement in Lucene?
> >
> > Thx in advance - best regards,
> >
> > pego
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>