[英]Aerospike autocompletion
I want to implement an autocompletion mechanism for aerospike but I don't how I cando it .Is it possible to make an autocompletion mechanism with aerospike? 我想为aerospike实现一个自动完成机制,但我不知道如何使用它。是否可以使用aerospike制作自动完成机制? If yes how can it be implemented?
如果是,如何实施?
Basically, you need functionality to do prefix matching on strings. 基本上,您需要在字符串上进行前缀匹配的功能。 Aerospike is primarily a key-value store which additionally supports secondary index queries.
Aerospike主要是一个键值存储,它还支持二级索引查询。 The secondary index query in Aerospike does not yet support prefix matching of strings.
Aerospike中的二级索引查询尚不支持字符串的前缀匹配。 When this is supported, you can use Aerospike for your use case.
如果支持此功能,您可以将Aerospike用于您的用例。
Already deployed one with existing feature set. 已经部署了一个具有现有功能集。 It works roughly like this:
它的工作方式大致如下:
Autocomplete-Feature with Aerospike: Aerospike自动完成功能:
The main takeaway from this is that you will have to reduce both your results and your search terms to the same identifying token (here 3 ascii characters) that will act as your primary key for records. 这样做的主要内容是,您必须将结果和搜索条件减少到相同的识别标记(此处为3个ascii字符),这些标记将作为记录的主键。
Note: this won't scale indefinetely in terms of list size. 注意:就列表大小而言,这不会无限缩放。 You need to choose your prefix-length carefully, so there ain't too many proposals that need to be read from db and transfered to the client but also watch out for Aerospike's max record size if not using an large, infinitely scalable data type like the large list.
您需要仔细选择前缀长度,因此没有太多的提案需要从db读取并转移到客户端,但如果不使用大型,无限可扩展的数据类型,也要注意Aerospike的最大记录大小大清单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.