How to compare two columns using Solr?

*爱你&永不变心* 提交于 2019-12-11 12:13:32

问题


Compare two columns in solr if two fields are equal display true or else false.

CASE WHEN o_is_follow = o_follow_id THEN 'TRUE' ELSE 'FALSE'.


回答1:


As per as I know comparing one field to another within a document is not supported in either Solr.

I think it can be achieved by one option of creating another field while indexing only.

You can have another field (boolean). Make this field as boolean type and can be used while searching. Create a o_is_follow_present field and set it to true for documents matching it while indexing.

Use the same field as one of your filter criteria..



来源:https://stackoverflow.com/questions/36996043/how-to-compare-two-columns-using-solr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!