Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard facet retrieval not working in react-instantsearch #6202

Open
1 task done
giovanni-d opened this issue May 16, 2024 · 1 comment
Open
1 task done

Wildcard facet retrieval not working in react-instantsearch #6202

giovanni-d opened this issue May 16, 2024 · 1 comment
Labels
triage Issues to be categorized by the team

Comments

@giovanni-d
Copy link

giovanni-d commented May 16, 2024

🐛 Current behavior

When using the wildcard property to retrieve all facets *, the facets are not being returned by the useInstantSearch() hook.

Screenshot 2024-05-16 at 17 00 13

When using the js library search function, you can retrieve all facets using wildcard. see codesandbox for repro.

This is also the same behavior on v6 using connectStateResults:

https://codesandbox.io/p/sandbox/algolia-facets-v6-5hn9rn?file=%2Fsrc%2FApp.tsx

🔍 Steps to reproduce

  1. Setup instant search:
  <InstantSearch
      searchClient={searchClient}
      indexName="instant_search"
      routing={true}
      insights={true}
    >
      <Configure ruleContexts={[]} facets={["*"]} />
      <SearchState />
 </InstantSearch>
  1. Use hook useInstantSearch() to retrieve results
  2. Check the facets retrieved and it will be empty

Live reproduction

https://codesandbox.io/p/sandbox/algolia-facets-issue-9xpw2d?file=%2Fsrc%2FApp.tsx

💭 Expected behavior

Expecting to receive all facets available when using the wildcard property just like when you can retrieve them using the js client.

Package version

"algoliasearch": "4.23.2",
"instantsearch.js": "4.68.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-instantsearch": "7.8.1"

Operating system

macOS 12.7

Browser

Chrome Version 124.0.6367.208

Code of Conduct

  • I agree to follow this project's Code of Conduct
@giovanni-d giovanni-d added the triage Issues to be categorized by the team label May 16, 2024
@Haroenv
Copy link
Contributor

Haroenv commented May 16, 2024

This has indeed always been the case, facets retrieved from the SearchResults class are only those that are manually set, as they require a second query if anything is refined.

You can however read the facets (which would be conjunctive) from rawResults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues to be categorized by the team
Projects
None yet
Development

No branches or pull requests

2 participants