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

multisearch breaks when one of the indexes is not found. #1484

Closed
sjorsjes opened this issue Apr 25, 2023 · 2 comments
Closed

multisearch breaks when one of the indexes is not found. #1484

sjorsjes opened this issue Apr 25, 2023 · 2 comments
Labels
support Issues related to support questions.

Comments

@sjorsjes
Copy link

sjorsjes commented Apr 25, 2023

Description
I have Meilisearch running in a kubernetes environment with no volume attached. When i reboot the Meilisearch container the indexes are cleared. For my situation that's fine and not an issue because most indexes are refreshed every 15min/1h.

But I implemented multiSearch and when Meilisearch had a reboot it can happen that not all indexes are back.

Expected behavior
I would expect that the Multisearch query would not break and just continue giving me results for the indexes that can be found.

Current behavior
Multisearch breaks and throws an error Inside '.queries[0]': Index 'documents' not found. and returns no results.

class_1 [MeiliSearchApiError]: Inside `.queries[0]`: Index `documents` not found.
    at <path>/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:187:23
    at step (<path>/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:104:23)
    at Object.next (<path>/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:85:53)
    at fulfilled (<path>/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:75:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'index_not_found',
  type: 'invalid_request',
  link: 'https://docs.meilisearch.com/errors#index_not_found',
  httpStatus: 400
}

Environment (please complete the following information):

  • OS: Node 18.x
  • Meilisearch version: 1.1.1
  • meilisearch-js version: 0.32.3
  • Browser: Any
@bidoubiwa bidoubiwa added the support Issues related to support questions. label Apr 25, 2023
@oluademola
Copy link

Hello @sjorsjes. Sorry for the inconvenience, and thanks for the report. Indeed this is currently the expected behavior. We intend to make this behavior obvious and warn users through the documentation, as seen in this issue.

@sjorsjes
Copy link
Author

sjorsjes commented May 8, 2023

Ah okay, thanks for the headsup!

For people with the same issue, I workaround this issue by checking with the client.getStats() what indexes are available and then do a multisearch for all indexes that exists.

https://www.meilisearch.com/docs/reference/api/stats#get-stats-of-all-indexes

@sjorsjes sjorsjes closed this as completed May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Issues related to support questions.
Projects
None yet
Development

No branches or pull requests

3 participants