algolia / algolia/instantsearch

facets counts do not follow a clear specification in a multi-index context

Open
#4,189 3 comments 2 reactions 0 assignees View on GitHub
Feature: Facets & filters Library: InstantSearch.js Type: Needs Investigation
Dominant language
TypeScript
Stars
4.1k
Forks
553
Avg merge
1d 11h
Merged PRs (30d)
51

Description

**Describe the bug 🐛**

At the moment, when a refinement list refines over multiple indices, it's not clear what the counts should be referring to.

**To Reproduce 🔍**

**I. On your Algolia Dashboard**
1. Create 2 indices `A` and `B`.
2. Populate both indices with records that randomly have `color: red` or `color: blue`.
3. Configure `color` as a facet

**II. In a codesandbox**
1. Create InstantSearch with:
- 1 index widget for `A`
- 1 index widget for `B`
- 1 refinement list for attribute: "color" refining both `A` and `B`
2. Look at the counts

https://codesandbox.io/s/ais-ecommerce-demo-app-3miyg

**Expected behavior 💭**

There should be a clear definition of what counts we should display

**Screenshots 🖥**
![image](https://user-images.githubusercontent.com/2982512/68323104-0cb57f80-00c5-11ea-9c14-e26d4f8f816c.png)

One request is indeed fired for every index.

![image](https://user-images.githubusercontent.com/2982512/68323462-ca407280-00c5-11ea-9109-e7b305bbf457.png)

**Environment:**
N/A

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox and reproduce the refinement list across indices A and B. Inspect the requests and displayed facet counts, then review the relevant multi-index refinement-list behavior to determine what a consistent count specification would need to cover. Done means the expected counting semantics are documented and the behavior can be verified against them.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
search
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.