Open hancush opened 1 month ago
Related to #1145, #718
Also related to efforts to reduce page load time.
It doesn't look like there's a way to add a fields
parameter to the Elastic query with Haystack. We can try extending Haystack's Elasticsearch7SearchBackend
class.
@hancush I tested #1152 on staging and found that it didn't lower the size of the index by very much. I've read that elastic uses a compression algorithm by default in indexes, so that may be why.
It seemed to reduce memory usage when searching, but not by much either.
Hmm, bummer, @antidipyramid.
@hancush I was able to get Elastic to exclude the text fields of bills from search results by customizing Haystack's Elastic backend. I deployed that branch and found that, again, it reduced memory usage somewhat but not enough to be considered a fix.
One search result can be several MB in size. That can really add up! I suspect the biggest culprits are the full text fields. Figure out a way to index that information, but not return it in the results. Looks like ElasticSearch provides for this, if django-haystack does not: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html