1
$\begingroup$

I'm trying to implement an autocomplete feature for a search engine. I have a database of words(stemmed) that occur in the documents that I have. what I'm doing is:

  • Constructing a graph with words as nodes and weighted edges with weights as the number of times those 2 words have been searched together.

  • Each node also keeps track of which is the most commonly typed word next to it.

  • Whenever a user starts typing his query, this graph is queried and the first word is predicted by string matching and then ranking the matched words according to search frequency.

  • When the user starts typing the next word, the graph is visited and the neighbours of this node are retrieved and shown to the user in order of frequency(weight of edges.).

This is a rough overview of what I am trying to achieve. Are there any optimizations that could be made to this or something else entirely that can replace this?

$\endgroup$
  • 1
    $\begingroup$ I think this question is too broad. Where are your bottleneck? Does it work the way you want? Etc. Community votes please; is this too broad? $\endgroup$ – Raphael Mar 10 '16 at 21:01
  • 1
    $\begingroup$ The title you have chosen is not well suited to representing your question. Please take some time to improve it; we have collected some advice here. Thank you! $\endgroup$ – Raphael Mar 10 '16 at 21:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.