散列solr输入字段 [英] Hashing a solr input field
问题描述
我想促进对我们无法索引或以非散列或加密形式存储的字段的搜索.有没有办法告诉 solr 在与索引进行比较之前散列(或加密)特定字段?
I would like to facilitate searching on a field that we cannot index or store in non hashed or encrypted form. Is there a way to tell solr to hash (or encrypt) a speicfic field prior to comparing against the index?
推荐答案
简而言之,我认为这并不容易,这取决于您需要什么级别的安全性.
In a nutshell, I don't think it's easy, and it depends on what level of security you need.
作为通用的简单解决方案,您可以将整个索引存储在加密文件系统中,例如eCryptfs 或 TrueCrypt(参见 块级加密和 fs 级加密的区别)
As a generic, simple solution, you could store the whole index in an encrypted file system, e.g. eCryptfs or TrueCrypt (see difference between block-level encryption and fs-level encryption)
根据您需要如何在此字段中进行搜索,如果您可以仅对值进行哈希处理,那么解决方案将是纯粹的客户端,即对客户端的值进行哈希处理,将其发送到 Solr 并取回结果.
Depending on how you need to search in this field, if you can get away with just hashing the values then the solution would be purely client-side, i.e. hashing the value client-side, sending it to Solr and getting back the results.
几年前有一个补丁可以在 Lucene 中启用字段级加密,但由于某种原因被拒绝了.不过,也许你可以从那个补丁中借鉴一些想法......
Some years ago there was a patch to enable field-level encryption in Lucene, but for some reason it was rejected. Still, maybe you can borrow some ideas from that patch...
这篇关于散列solr输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!