如何清除Solr中的缓存?

发布于 2025-01-01 00:41:34 字数 93 浏览 4 评论 0原文

我正在尝试比较不同 Solr 查询的性能。为了得到公平的测试,我想清除查询之间的缓存。

这是怎么做到的?当然,可以重新启动服务器,我很好奇是否有更快的方法。

I'm trying to compare the performance of different Solr queries. In order to get a fair test, I want to clear the cache between queries.

How is this done? Of course, one can restart the server, I was curious if there is a quicker way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

晨与橙与城 2025-01-08 00:41:34

我使用的是 4.2.1 版本,即使使用 autowarmCount="0" ,执行数据导入后缓存也不会更新。

在这种情况下,在 Solr Admin(通常是 http://localhost:8983/)上

转到 Core Admin 并单击重新加载
刷新后,您应该在“当前”字段上看到一个绿色的复选标记。

I'm using version 4.2.1 and even with autowarmCount="0" the cache is not updated after doing a Dataimport.

In that case, on Solr Admin (usually http://localhost:8983/)

Go to Core Admin and click Reload.
When refreshed, you should see a green check mark on the "current" field.

避讳 2025-01-08 00:41:34

禁用 solrconfig.xml 中的所有缓存。

请注意,Lucene FieldCache 仍将启用。

Disable all the caches from solrconfig.xml.

Note that the Lucene FieldCache will still be enabled.

花伊自在美 2025-01-08 00:41:34

只是为了了解详细信息

如果您想禁用缓存(或全部),请注释掉 solrconfig.xml 中的这些部分并重新启动 solr。

禁用 queryResultCache 示例

   <!-- 
   <queryResultCache class="solr.LRUCache"
                      size="5000"
                      initialSize="5000"
                      autowarmCount="2000"/>

-->

Just for thorough details

If you want to disable a cache (or all), comment out those sections in solrconfig.xml and restart solr.

example diable queryResultCache

   <!-- 
   <queryResultCache class="solr.LRUCache"
                      size="5000"
                      initialSize="5000"
                      autowarmCount="2000"/>

-->
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文