lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andi rexha <>
Subject Lucene Free Text Suggester, get only single tokens as suggestion!
Date Mon, 13 Oct 2014 09:07:36 GMT
I have a field in an index for which I want to have a "free text suggestion". The field is
analyzed, storend  and term vector the field. I tried to use two approaches to get the suggestions
from the field.

I have tried to apply the free text suggester with a dictionary like : 

             FreeTextSuggester freeTextSuggester = new FreeTextSuggester(new WhitespaceAnalyzer(),
new WhitespaceAnalyzer(), 2);
             Dictionary dict = new LuceneDictionary(reader, field);

I have also tried a different approach, buy using the term vector elements for each document:

             WFSTCompletionLookup wfstCompletionLookup = new WFSTCompletionLookup();
             //it iterates over the term vector and is an InputIterator
            TermVectorInputIterator termVectorInputIterator = new TermVectorInputIterator(reader,

I have an index with 916 documents, and approximately 32.000 terms, but I always get as suggestion
for a few characters input, single tokens suggestion, and not n-grams. Does anybody have any
suggestion about my problem?

Thank you in advance!
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message