5

I am trying to build type-ahead search following data.


    ID   DATA STRING
    id_1 "this is line number one"
    id_2 "this is line number two"

While querying these data, I will give string like:


    "line one" --> output: id_1 (ID of matching string)
    "two line" --> output: id_2
    "this is line num" -->  output id_1 id_2 (multiple results)

I tried with inverted index, with n-grams (prefixes), for each token in data string. But for large data-set indexing n-grams is slow (querying is somehow good enough). Now I got some idea while googling that lucene has Suggester classes which is very fast in type-ahead search and uses FST (Finite State Transducer) to implement fast prefix search.

How can FST be used in my scenario to make type-ahead search faster?

kronak
  • 53
  • 1
  • 3

0 Answers0