Prashant Valanda
Prashant Valanda

Reputation: 480

Elastic search collapse and aggregation count issue

I have collapse data using one attribute and aggregation for layered navigation price, it is showing result correct but count is wrong due to collapse

example: We have 2 document in price range 3000-4000 both document attribute value same which attribute data collapsed

so as of now showing 2 count instead of 1.

any suggestion would be highly appreciated.

Upvotes: 0

Views: 2101

Answers (1)

Sagar Patel
Sagar Patel

Reputation: 5486

That is expected behaviour for the collapse because distinct count is unknown and same you can read in official documentation as well:

The total number of hits in the response indicates the number of matching documents without collapsing. The total number of distinct group is unknown.

Also, As Jaspreet mentioned in comment:

Collapsing is applied to the top hits only and does not affect aggregations.

Upvotes: 1

Related Questions