uwazi
uwazi copied to clipboard
search v2 really slow and memory heave on certain datasets
Describe the bug Some searches are slow on elastic due to trying on too many fields, search v2 uses wildcards to select which fields to search and which to highlight, not only is this slow, but uses a lot of memory, in some cases triggering a circuit breaker for other queries being performed at the time.
To Reproduce Steps to reproduce the behavior:
- Load a dataset with a lot of template properties
- Search snippets on one of the entities
- Takes too much time to respond (times can vary depending on the machine/dataset)
Screenshots
Additional context While debugging this, we noticed that search v1 specifies the list of fields (only searchable fields) so search on and highlight, which makes the query faster.