0

I have an index with text masses like:

"Hello I want to try autocomplete xxx yyy zzz"

Is it possible to get suggestions such that, if I type:

--------------------------------------------------------------------
| I typed                    | Suggestion                          |
====================================================================
| autocomplete x             | autocomplete xxx                    |
--------------------------------------------------------------------
| auto                       | autocomplete                        |
--------------------------------------------------------------------
| Hello I want to try auto   | Hello I want to try  autocomplete.  |
--------------------------------------------------------------------

So it suggests words based on what is actually after the first word, and won't suggest the words that are before the words I suggest either.

Using lucene 4.4

femtoRgon
  • 32,893
  • 7
  • 60
  • 87
Trind
  • 1,583
  • 4
  • 18
  • 38
  • 1
    See http://stackoverflow.com/questions/24968697/how-to-implements-auto-suggest-using-lucenes-new-analyzinginfixsuggester-api/25301811#25301811 for a complete example of doing autocompletion with Lucene. – John Wiseman Aug 14 '14 at 07:20
  • 1
    However that worked exactly how i didn't want it to work :( – Trind Aug 15 '14 at 06:09
  • Ah, sorry. See http://blog.mikemccandless.com/2012/09/lucenes-new-analyzing-suggester.html for a discussion of AnalyzingSuggester, which I believe will do what you want. – John Wiseman Aug 15 '14 at 12:09

1 Answers1