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

Use /multi-search for better performance #4

Open
BertrandBordage opened this issue Feb 15, 2024 · 0 comments · May be fixed by #5
Open

Use /multi-search for better performance #4

BertrandBordage opened this issue Feb 15, 2024 · 0 comments · May be fixed by #5

Comments

@BertrandBordage
Copy link

Currently, wagtail-meilisearch queries each meilisearch index one by one and gathers results:

for m in models:
index = self.backend.get_index_for_model(m)
result = index.search(terms)
boosts = self._get_field_boosts(m)
for item in result['hits']:
if item not in results:
item['boosts'] = boosts
results.append(item)

On a website with dozens of page types, searching with meilisearch on the global admin search can take more than a minute.

Would it be possible to use the /multi-search endpoint to send all these "subqueries" at once? I did a test using 3 indexes, the latency is the same as with 1 index, so we can probably expect much better performance with this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant