What makes a good autowarming query in Solr and how do they work?

后端 未结 1 1584
醉酒成梦
醉酒成梦 2020-12-13 20:57

This question is a follow up to this question about infrequent, isolated read timeouts in a solr installation.

As a possible problem missing / bad autowarming querie

相关标签:
1条回答
  • 2020-12-13 21:42

    There are 2 types of warming. Query cache warming and document cache warming (There's also filters, but those are similar to queries). Query cache warming can be done through a setting which will just re-run X number of recent queries before the index was reloaded. Document cache warming is different.

    The goal of document cache warming is to get a large quantity of your most frequently accessed documents into the document caches so they don't have to be read from disk. So, your queries should focus on this. You need to try and figure out what your most frequently searched documents are and load those. Preferably with a minimal number of queries. This has nothing to do with the actual content of the fields. EDIT: To clarify. When warming document caches your primary interest is the documents that turn up in search RESULTS most often, regardless of how they are queried.

    Personally, I'd run searches for things like:

    • Loading by country, if most of your searches are for US films.
    • Loading by year, if most of your searches are for more recent films.
    • Loading by genre, if you have a short list of heavily searched genres.

    A last possibility is to load them all. Your documents look small. 70,000 of them is nothing in terms of server memory nowadays. If your document cache is large enough, and you have enough memory available, go for it. As a side note, some of your biggest benefit will be from your document cache. A query cache is only beneficial for repeated queries, which can be disappointingly low. You almost always benefit from a large document cache.

    0 讨论(0)
提交回复
热议问题