如何创建一个高效的自动完成? [英] How to create an efficient auto-complete?

查看:20
本文介绍了如何创建一个高效的自动完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实施文本"建议.

我有大量数据,如何实现高效且可扩展的自动完成?

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

我有一个 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, 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.:

  • 水"可能表示 kool-aid、佳得乐、维生素水.
  • sea"可能表示海洋、湖泊、河流

这篇关于如何创建一个高效的自动完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆