简体   繁体   English

阿尔及利亚搜索加密数据

[英]Algolia searching encrypted data

Currently, my database has encrypted data which I send to Algolia. 目前,我的数据库已加密的数据发送给了Algolia。 I need to search on this encrypted data but if indexed is 'John' and I search 'Joh', they are not similar at all, and thus result to 0 hits. 我需要搜索此加密数据,但是如果索引为“ John”并且搜索“ Joh”,则它们根本不相似,因此结果为0。

Any ideas how to solve this? 任何想法如何解决这个问题? I am currently running rails and attr_encrypted 我目前正在运行rails和attr_encrypted

I don't think this is possible. 我认为这是不可能的。 Search indexes like Algolia operate on raw text - they tokenize words and phrases and create a reverse index from them. 像Algolia这样的搜索索引对原始文本进行操作-它们对单词和短语进行标记,并根据它们创建反向索引。 If you send Algolia an encrypted string, it won't be able to identify words (because there won't be any spaces). 如果您将加密的字符串发送给Algolia,它将无法识别单词(因为不会有空格)。

The only way to make this work is to send Algolia your decrypted attribute contents. 进行此工作的唯一方法是将您解密后的属性内容发送给Algolia。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM