Hi Check out the CollapsingQParser (https://cwiki.apache.org/confluence/display/solr/Collapse+and+Expand+Results). As long as you have a field that will be the same for all duplicates, you can “collapse” on that field. If you not have a “group id”, you can create one using e.g. an MD5 signature of the identical body text (https://cwiki.apache.org/confluence/display/solr/De-Duplication).
-- Jan Høydahl, search solution architect Cominvent AS - www.cominvent.com > 31. aug. 2015 kl. 12.03 skrev Zheng Lin Edwin Yeo <edwinye...@gmail.com>: > > Hi, > > I'm using Solr 5.2.1, and I would like to find out, what is the best way to > get Solr to return only distinct results? > > Currently, I've indexed several exact similar documents into Solr, with > just different id and title, but the content is exactly the same. When I do > a search, Solr will return all these documents several time in the list. > > What is the most suitable way to get Solr to return only one of the > document during the search? > I understand that there is result grouping and faceting, but I'm not sure > if that is the best way. > > Regards, > Edwin