Fix unnecessary multiple requests for each search

Created on 22 August 2023, about 1 year ago
Updated 31 August 2023, about 1 year ago

Problem/Motivation

As outlined in 📌 Sorting and sort boost Fixed and 🐛 Sorting impossible, numeric fields erroneously indexed as string (patch included) Closed: duplicate there are several places in code where multiple requests are sent off to Meilisearch to make sure a given state is set.

Remaining tasks

Setting updates for sorts will most likely be solved in their own issue, at least consent has been reached at #3311231-8: Sorting and sort boost .


Unnecessary updates for filters have been solved as part of 🐛 Custom filter groups on a View (Search API index view) are not working Fixed

Synonyms also get reset every time:

// If the synonyms processor is disabled we have to reset
// the synonyms on the server and remove the configuration string.

Move that to the relevant place as well, e.g. only when synonyms get actively changed.

Another additional request gets sent off to get the total amount of hits before doing the actual search.
This does not seem to be necessary any more.

// First, perform a search with a limit of 0 documents to get the nbHits
// that represents the number of all documents.

Wouldn't setting "hitsPerPage" and therefore getting an exhaustive number of "totalHits" be better than setting off two requests?
I think I read this in the changelogs as a new feature, this is also documented here:
https://www.meilisearch.com/docs/reference/api/search#number-of-results-...

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇹Austria tgoeg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024