如何建立一个高效的自动完成? [英] How to create an efficient auto-complete?
问题描述
我想实现一个文本的建议。
I want to implement a "text" suggestion.
我有一个巨大的数据,我怎么能实现数的高效,可扩展的自动完成?
I have a huge number of data, how I can implement an efficient and scalable auto-complete?
编辑1: 我有一个MySQL表,每行一个客户端和一个名称一栏,我想创建一个建议,以搜索客户端名称(如谷歌建议但不是查询它的客户端名称) - 我行的数量巨大,我怎么能设计一个高效的建议?
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
推荐答案
OK,我想我明白你在寻找什么,这里有一些可能的解决方案为您提供:
OK, I think I understand what you're looking for and here are some possible solutions for you:
- <一个href="http://stackoverflow.com/questions/1783652/what-is-the-best-autocomplete-suggest-algorithm-datastructure-c-c">What是最好的自动完成/建议算法,数据结构[C ++ / C] (答案是足够的通用性,尽管事实上,这是一个C / C ++的问题)
- <一个href="http://stackoverflow.com/questions/678987/how-to-implement-autocomplete-on-a-massive-dataset">How实现自动完成对大规模数据集
- 自动完成使用特里
- 算法自动完成?
- <一个href="http://stackoverflow.com/questions/6937059/trie-based-addressbook-and-efficient-search-by-name-and-contact-number">Trie基于通讯录和姓名及联络电话号码高效的搜索
- <一个href="http://stackoverflow.com/questions/5254909/how-do-you-autocomplete-names-containing-spaces">How你是否包含空格自动完成的名字?
- 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.:
- 在水可能暗示库尔急救,佳得乐,维他命水。
- 在海可能暗示海洋,湖泊,河流
这篇关于如何建立一个高效的自动完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!