Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an efficient auto-complete? [closed]

I want to implement a "text" suggestion.

I have a huge number of data, how I can implement an efficient and scalable auto-complete?

Edit 1: i have a mysql table with one client per row and a 'name' column, i want to create a suggest in order to search client name (like google suggest but instead of queries it is client name) - I have a huge numbers of rows, how I can design an efficient suggest?

When user will start typing inside an "input text", I want to display possible client names

like image 610
JohnJohnGa Avatar asked Aug 14 '11 18:08

JohnJohnGa


1 Answers

OK, I think I understand what you're looking for and here are some possible solutions for you:

  • What is the best autocomplete/suggest algorithm,datastructure [C++/C] (the answers are generic enough despite the fact that it's a C/C++ question)
  • How to implement autocomplete on a massive dataset
  • Autocomplete using a trie
  • Algorithm for autocomplete?
  • Trie based addressbook and efficient search by name and contact number
  • How do you autocomplete names containing spaces?

Essentially, it seems like you're looking for auto-complete functionality (if I understood your question correctly). Along those lines, the above questions and their answers also provide a lot of references on how to do more complex suggestions (i.e. based on content, semantics, intent, etc.).

This will probably not address your question if you're looking for an algorithm that makes "related" suggestions, e.g.:

  • "water" may suggest kool-aid, gatorade, vitamin water.
  • "sea" may suggest ocean, lake, river
like image 106
Kiril Avatar answered Oct 21 '22 01:10

Kiril