concept duplicate document in category solr

This is an excerpt from Manning's book Solr in Action.
The Collapsing query parser provides the ability to remove duplicate documents (documents containing identical values in some field you specify) from a set of search results. This capability, called field collapsing, can be very useful for ensuring diversity among your search results. There are two ways to achieve field collapsing in Solr. The first is by using a larger suite of capabilities called result grouping, which enables you to group all documents with identical values in a field and only return a specifiable number of documents per group. The other way to collapse documents to a unique field value is by utilizing the Collapsing query parser. The topic of result grouping/field collapsing has a dedicated chapter (chapter 11) later in the book, so you can find all of the specifics on how to use the Collapsing query parser in section 11.7.
In addition to collapsing search results to remove duplicate documents, the result grouping functionality in Solr provides other useful features. In many ways, you can view result grouping in Solr as a more verbose form of faceting. Instead of only returning separate facet sections along with the counts for each value, result grouping returns the unique values and their counts (like faceting) plus some number of documents that contain each of the specified values. One way in which grouping is different than faceting is that it returns the requested groups within the search results section, which means the groups and values within the groups are sorted based on the sorts specified for the documents in the query. Grouping can be performed based upon field values, functions, or queries, making its applications numerous. Although this may sound complex initially, we will cover several use cases to demonstrate this incredibly useful and (mostly) straightforward feature. Before jumping in, it will be useful to clarify the sometimes confusing distinction between the terms result grouping and field collapsing.