finding duplicate field values in solr

梦想的初衷 提交于 2019-12-11 15:57:01

问题


Using Solr 4.3

I have a field "digest" in a solr index - and I would like to execute a query that will return me all the cases where there are duplicate values of digest. Can this be done?

For the records that have duplicate values, I would like to return other values - such as "url" which may not be duplicated.


回答1:


You have two options, neither perfect.

You can use Grouping/Field Collapsing which will group by digest and can give you other fields, but does not allow you to avoid groups with only 1 element.

Or you can use Facets, which allow you to specify minimum number of elements for that facet value, but do not allow you to see which documents match that facet. Though you might be able to get something useful by using Pivot (nested) facets.



来源:https://stackoverflow.com/questions/16770034/finding-duplicate-field-values-in-solr

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