0

In mysql query "distinct" keyword is used for getting different values. So is there any keyword for solr query to retrieve different documents on the basis of specific field name(fl) value.

Or any way to get different documents. Because sometimes i am getting same documents again and again because of same field title value but they have field content different values.

MTA
  • 1,033
  • 5
  • 16
  • 37

1 Answers1

0

Solr will only return the document once for each query, so if that's the case - you have duplicate documents in your index.

You might be looking for Result Grouping which will allow you to group the documents by a common field, getting the top hit for each value in that specific field. If you iterate over the groups, you'll get a distinct set by that field.

If you're looking for all the distinct values in a specific field (and not the whole document for each value as well), Faceting is the way to go.

MatsLindh
  • 49,529
  • 4
  • 53
  • 84