Skip to content

Commit e0db7c6

Browse files
author
Clément Le Provost
authored
Propagate non exhaustive facet count indicator in disjunctive faceting queries (#111)
1 parent ab5f7f7 commit e0db7c6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Source/Index.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,14 @@ import Foundation
629629
}
630630
disjunctiveFacetCounts[facetName] = newFacetCounts
631631
}
632+
// If facet counts are not exhaustive, propagate this information to the main results.
633+
// Because disjunctive queries are less restrictive than the main query, it can happen that the main query
634+
// returns exhaustive facet counts, while the disjunctive queries do not.
635+
if let exhaustiveFacetsCount = result["exhaustiveFacetsCount"] as? Bool {
636+
if !exhaustiveFacetsCount {
637+
mainContent["exhaustiveFacetsCount"] = false
638+
}
639+
}
632640
}
633641
mainContent["disjunctiveFacets"] = disjunctiveFacetCounts
634642
return mainContent

0 commit comments

Comments
 (0)