On Wed, May 3, 2017 at 1:06 PM, Serkan Mulayim <[email protected]> wrote: > Thank you very much Marvin, > > When I type hell, I would like to get tokens starting with hell, e.g. > {"hell","hello","helix"}. I do not want to get documents which contain hell > token in the title. So it seems like it should be working on the tokens. > > What I need is basically to be able to iterate over all tokens which are > lexicographically ordered. Also I would need to sort them based on their > frequencies when returning the results. I guess Lexicon class, > https://lucy.apache.org/docs/c/Lucy/Index/Lexicon.html, is designed for > this. Can you please confirm? I hope the returned results in the > lucy_Lex_seek contains the frequency of the terms as well.
I stand by my recommendation of using a dedicated index because you will almost certainly want to tune your autosuggestion results. But feel free to play around with Lexicon and see how it works for you. Note that depending on what Analyzer you are using for a given field, the terms in the Lexicon may not be what you expect. Marvin Humphrey
