LP#
1505286: limit number of facets retrieved
This patch teaches search how to limit the number of facets retrieved
per defined facet field. Setting a limit is useful so that
open-ils.cstore backends don't end up needlessly consuming
memory when fetching facets for a large result set; if a broad
search retrieves over 10,000 author facets (say), even the most
persistant user is not going to actually look at all of them. Fetching
fewer facets can also slightly speed up generation of search
results.
The limit is controlled by a new global flag, search.max_facets_per_field,
whose label is "Search: maximum number of facet values to retrieve for
each facet field". The default limit value is 1,000, but lower values
(e.g., 100) are perhaps even better for most catalogs.
To test:
[1] Upon applying the patch, set the value of the
search.max_facets_per_field global flag to a small
value.
[2] Perform some searches and verify that the number
of facets retrieved doesn't exceed the limit; note
that the limit is per facet *field*, not overall
or per field class.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Ben Shum <ben@evergreener.net>