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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
In a nutshell, I don't think it's easy, and it depends on what level of security you need.
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)
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.
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...