-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add multi index and disjunctive facet search #888
Add multi index and disjunctive facet search #888
Conversation
3480333
to
29bda1f
Compare
Co-authored-by: Morgane Dubus <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✨ 🦕
…ps://github.com/meilisearch/instant-meilisearch into bump-meilisearch-v0.30.0-add_multi_index_search
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✨🦕
expect(emptyMovies.hits.length).toBe(0) | ||
expect(emptyGames.hits.length).toBe(0) | ||
|
||
const response = await customClient.search<Movies>([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const response = await customClient.search<Movies>([ | |
const response = await customClient.search<Movies>([ |
I want to understand this signature better since now you'll return two different types. What do these Movies
does in this case? Can we get rid of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instantsearch requires a search method with a generic. Nonetheless, you are right that it makes no sense as there are multiple indexes now.
I looked at the code of algoliasearch and it seems the issue is at their side as well. multipleQueries
is the method used for searching in instantsearch, see their searchClient.
…o bump-meilisearch-v0.30.0-add_multi_index_search
@@ -78,6 +81,6 @@ describe(`${playground} playground test`, () => { | |||
|
|||
it('Paginate Search', () => { | |||
cy.get('.ais-InfiniteHits-loadMore').click() | |||
cy.get(HIT_ITEM_CLASS).should('have.length', 11) | |||
cy.get(HIT_ITEM_CLASS).should('have.length', 12) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this has been changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because of the disjunctive facet search accepting more hits in return 😅
await client.deleteIndex('movies') | ||
const task = await client.deleteIndex('games') | ||
|
||
await client.waitForTask(task.taskUid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you have a method that accepts more than one uid
? (or I'm misleading because of other SDKs...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have one in js :(
bors merge |
bors r- |
888: Add multi index and disjunctive facet search r=bidoubiwa a=bidoubiwa⚠️ NOT working with `keepzerofacet` Using the `Index` widget, it is now possible to do mult-index search, see example bellow. By introducing the multi index search. we automatically introduce disjunctive facet search. Related to: #774 #789 # Multi index search ```jsx <InstantSearch indexName="movies" searchClient={searchClient}> <SearchBox /> <h2>Movies</h2> <Index indexName="movies"> <Hits hitComponent={Hit} /> </Index> <h2>Games</h2> <Index indexName="games"> <Hits hitComponent={Hit} /> </Index> </InstantSearch> ``` https://user-images.githubusercontent.com/33010418/203822998-8fc99a62-970f-42a9-95bb-ab09d3c67a9d.mp4 ## Disjunctive facet search https://user-images.githubusercontent.com/33010418/204564207-576bca0c-344b-427c-a1a1-e10ddd7a677f.mp4 # Multi index + disjunctive facet search https://user-images.githubusercontent.com/33010418/204565010-d4564fdb-88a0-46ad-8dc0-bb6761798e49.mp4 ## TODO - [x] Should work on simple search - [x] Should be compatible with following widgets: - [x] Pagination - [x] RefinementList - [x] Should be compatible with all Meilisearch parameters - [x] placeholder search - [x] finite pagination - [ ] keep zero facets⚠️ Fixed in disjunctive facet search PR - [x] check state of cache Co-authored-by: Charlotte Vermandel <[email protected]> Co-authored-by: cvermand <[email protected]>
Canceled. |
bors merge |
Build succeeded: |
918: Fix keepZeroFacets on disjunctive facet search r=bidoubiwa a=bidoubiwa Since introducing the multi-index search here #888 the setting `keepZeroFacets` was broken. This PR introduces the fix to this issue https://user-images.githubusercontent.com/33010418/207385436-e49ded20-e76b-4974-86de-904cfeecfbd7.mp4 What was done in this pr: - keepZeroFacet management has been moved to the response adapter instead of the request adapter - Filtering methods and filtering tests were removed as the new facet distribution management has completely changed - `defaultFacetDistribution` is renamed `initialFacetDistribution` and contains the distribution of an index without any other requests - Initialization of facet distribution was moved from client to its own file Playgrounds: - New SingleMovieIndex playground to create a new environment for testing - Updated `SingleIndex` with keepZeroFacets - Updated `MultiIndex` with keepZeroFacets Co-authored-by: Charlotte Vermandel <[email protected]>
915: Beta: Multi index search and disjunctive facet search r=bidoubiwa a=bidoubiwa see #888 Body of the release: ##⚠️ Breaking change - Facets behavior changed and uses `disjunctive facet search` see #884 added in #888 ## 🚀 Enchancement - The `Index` widget is now compatible with instant-meilisearch #888 Thanks again to `@bidoubiwa!` 🎉 Co-authored-by: Charlotte Vermandel <[email protected]> Co-authored-by: cvermand <[email protected]>
Using the
Index
widget, it is now possible to do mult-index search, see example bellow.By introducing the multi index search. we automatically introduce disjunctive facet search.
Related to: #774 #789
Multi index search
multi-index-1.mp4
Disjunctive facet search
disjunctive.mp4
Multi index + disjunctive facet search
multi-disjunctive.mp4
TODO