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

Add multi index and disjunctive facet search #888

Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3302604
Add disjunctive facet search
bidoubiwa Nov 23, 2022
29bda1f
Add condition on filtering caching
bidoubiwa Nov 23, 2022
bb0ef01
Add multi index search
bidoubiwa Nov 24, 2022
07760b6
Add datasets in tests assets
bidoubiwa Nov 24, 2022
073adf0
Update src/client/instant-meilisearch-client.ts
bidoubiwa Nov 24, 2022
7b4fc20
Improve filters
bidoubiwa Nov 24, 2022
ee46536
Improve readme
bidoubiwa Nov 24, 2022
560763d
Merge branch 'bump-meilisearch-v0.30.0-add_multi_index_search' of htt…
bidoubiwa Nov 24, 2022
a224d1a
fix merge conflicts
bidoubiwa Nov 24, 2022
8179471
Remove console logs from client
bidoubiwa Nov 24, 2022
4e1fbb2
Remove comments
bidoubiwa Nov 24, 2022
b33b7d9
Add tests on disjunctive facet search
bidoubiwa Nov 29, 2022
4547b56
remove console log
bidoubiwa Nov 29, 2022
238ee58
Update playground
bidoubiwa Nov 29, 2022
43a3dac
Add logging on react setup
bidoubiwa Nov 29, 2022
9f06d09
Improve README
bidoubiwa Nov 29, 2022
da79ff1
Roll back .gitignore
bidoubiwa Nov 29, 2022
6f79266
Fix readme errors
bidoubiwa Nov 29, 2022
0b130d0
Fix refinement list typo error
bidoubiwa Nov 29, 2022
e7b7ca8
Merge branch 'main' of github.com:meilisearch/instant-meilisearch int…
bidoubiwa Dec 7, 2022
2daa5c2
Fix end to end tests
bidoubiwa Dec 7, 2022
c833807
Fix linting error
bidoubiwa Dec 7, 2022
b1f785d
Update selectors in cypress to improve tests
bidoubiwa Dec 7, 2022
1bf47bf
Add json module resolver for tests
bidoubiwa Dec 7, 2022
42edcde
Add a wait in cypress method resolving to fast
bidoubiwa Dec 7, 2022
a6ab3fa
Remove useless wait in search-ui specs
bidoubiwa Dec 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add condition on filtering caching
bidoubiwa committed Nov 23, 2022
commit 29bda1f4aa848773a1365a23474fa2c5a73cfe3a
15 changes: 8 additions & 7 deletions src/adapter/search-request-adapter/search-resolver.ts
Original file line number Diff line number Diff line change
@@ -39,18 +39,19 @@ export function SearchResolver(
// Check if specific request is already cached with its associated search response.
if (cachedResponse) return cachedResponse

const cachedFacets = extractFacets(searchContext, searchParams)

// Make search request
const searchResponse = await client
.index(searchContext.indexUid)
.search(searchContext.query, searchParams)

// Add missing facets back into facetDistribution
searchResponse.facetDistribution = addMissingFacets(
cachedFacets,
searchResponse.facetDistribution
)
if (searchContext.keepZeroFacets) {
const cachedFacets = extractFacets(searchContext, searchParams)
// Add missing facets back into facetDistribution
searchResponse.facetDistribution = addMissingFacets(
cachedFacets,
searchResponse.facetDistribution
)
}

// query can be: empty string, undefined or null
// all of them are falsy's
2 changes: 2 additions & 0 deletions src/client/instant-meilisearch-client.ts
Original file line number Diff line number Diff line change
@@ -77,6 +77,8 @@ export function instantMeiliSearch(
searchRequest,
instantMeiliSearchOptions,
defaultFacetDistribution
)

const adaptedSearchRequest = adaptSearchParams(searchContext)