Refactored the Encyclopedia API. The complex aggregations are now prefiltered correctly according to the user query and the maximum result set size has been lowered.

Lauri Himanen requested to merge aggregation-improvement into v0.9.0

I reordered the search logic a bit and included a bit better filtering before the costly aggregations are run. Also lowered the maximum result size from 5M to 500k. If this does not improve the situation, we can still lower the query size. But I would not spend much more time optimizing these queries as they will anyways go away once we get the materials index up.

Merge request reports