Closed cdrini closed 1 month ago
In our https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/worksearch/code.py#L495-L502
that powers the /search endpoint, we ultimately do a do_search
which uses run_solr_query
to generate search results and facets for the work_search.html template (otherwise if there are no params, we fallback to an empty SearchResponse
object).
We presumably want to control do_search
from the search GET
so that facets
are False.
This will allow us to populate the search page without the facets initially.
cc: @cdrini we may need your help figuring out how to create or update the search API / endpoints to only return facet counts (no search results)
^ Set the rows=0 ; on the do_search
; that's the solr recommended way to only get facet data :+1:
Facets are expensive and have performance implications. Make some of the facets collapsed by default, and only load in when the user expands them.
Requires adding a way to fetch facets from a search endpoint.
Initial Solution
For now, the path forward is (perhaps led by @jimchamp):
Phases
Polished Solution
This should probably be led by @cdrini
facets
option to return counts