--------------------------------------------------------------------------------------------------------------------------------------
Query request handling
------------------------------------------------------------------------------------------------------------------------------------
Managing searchers
In Solr, queries are processed by a component called a searcher. There is only one “active” searcher in Solr at any given time. All query components for all search request handlers execute queries against the active searcher.
The active searcher has a read-only view of a snapshot of the underlying Lucene index. It follows that if you add a new document to Solr, then it is not visible in search results from the current searcher. This raises the question: How do new documents become visible in search results? The answer is to close the current searcher and open a new one that has a read-only view of the updated index. A commit creates a new searcher to make new documents and updates visible.
Because precomputed data, such as a cached query result set, must be invalidated and recomputed, it stands to reason that opening a new searcher on your index is potentially an expensive operation. This can have a direct impact on user experience.Solr supports the concept of warming a new searcher in the back-ground and keeping the current searcher active until the new one is fully warmed.
--------------------------------------------------------------------------------------------------------------------------------------
Cache management
Cache fundamentals
There are four main concerns when working with Solr caches:
- Cache sizing and eviction policy
- Hit ratio and evictions
- Cached-object invalidation
- Autowarming new caches
Filter cache
In Solr, a filter restricts search results to documents that meet the filter criteria, but it does not affect scoring.Autowarming the filter cache requires Solr to re-execute the filter query with the new searcher. Consequently,autowarming the filter cache can be a source of performance and resource utilization problems in Solr.
Query result cache
The query result cache holds result sets for a query. If you execute a query more than once, subsequent results are served from the query result cache,rather than re-executing the same query against the index.
<queryResultCache class="solr.LRUCache" size="512" initialSize="512" autowarmCount="0"/>
- QUERY RESULT WINDOW SIZE
Imagine your application shows 10 documents per page and in most cases your users only look at the first and second pages. You can set <queryResultWindowSize> to 20 to avoid having to re-execute the query to retrieve the second page of results.
- QUERY RESULT MAX DOCS CACHED
You have to set a maximum size for Solr caches; but this doesn’t affect the size of each individual entry in the cache. As you can imagine, a result set holding millions of documents in the cache would greatly impact available memory in Solr. The <queryResultMaxDocsCached> element allows you to limit the
number of documents cached for each entry in the query result cache. Users only look at the first couple of pages in most search applications, so you should generally set this to no more than two or three times the page size.
- ENABLE LAZY FIELD LOADING
A common design pattern in Solr is to have a query return a subset of fields for each document. For instance, in our example query, we requested the name,price, features, and score fields. But the documents in the index have many more fields, such as category, popularity, manufacturedate, and so forth. If your application adopts this common design pattern, you may want to set <enableLazyFieldLoading> to true to avoid loading unwanted fields.
Document cache
The query result cache holds a list of internal document IDs that match a query, so even if the query results are cached, Solr still needs to load the documents from disk to produce search results. The document cache is used to store documents loaded from disk in memory keyed by their internal document IDs. It follows that the query result cache uses the document cache to find cached versions of documents in the cached result set.
This raises the question of whether it makes sense to warm the document cache.There’s a good argument to be made against autowarming this cache, because there’s no way to ensure the documents you are warming have any relation to queries and filters being autowarmed from the query result and filter caches. If you are constantly indexing, and the documents a query returns are constantly changing, you could be spending time recreating documents that may not benefit your warmed filter and query result caches. Onthe other hand, if most of your index is relatively static, the document cache may provide value.
Field value cache
The last cache we’ll mention is field value, which is strictly used by Lucene and is not managed by Solr. The field value cache provides fast access to stored field values by internal document ID. It is used during sorting and when building documents for the response.
相关推荐
Node.js 的 Solr 模块参考Node.js: : Solr: : 使用npm test运行测试。 如果您没有在 127.0.0.1:8983 上运行 Solr,请编辑“test/common.js”。使用示例请参阅使用测试。 这是一个快速示例: var solr = require ( ...
使用Solr内置的Jetty服务器启动Solr (1)借助X Shell上传solr的安装包到/usr/local/目录下,使用 tar -zxvf命令进行解压. (2)使用内置的Jetty来启动Solr服务器只需要在example目录下,执行start.jar程序即可,...
== 定义:ispconfig_solr::instance 这个定义是 solr::instance 的包装器。 它创建一个 solr 实例并配置它以在 IspConfig 环境中使用 == 参数: [ instance_name ] solr 实例的名称。 实例将被称为 solr-$...
什么是Apache Solr:trade_mark:? Apache Solr具有高度的可靠性,可扩展性和容错性,可提供分布式索引,复制和负载平衡查询,自动故障转移和恢复,集中式配置等。 Solr为许多世界上最大的互联网站点提供搜索和导航...
这是Allegro CL的Solr绑定。 Solr是来自Apache Lucene项目的开源自由文本索引/搜索平台。 有关详细信息,请参见以下URL。 该软件包允许Allegro CL应用程序与正在运行的Solr服务器通信,添加和删除文档以及运行查询以...
Solr: : 用Gradle构建 建筑Lucene 参见 。 建筑太阳能 首先,您需要设置开发环境(OpenJDK 11或更高版本)。 我们假设您知道如何获取和设置JDK-如果您不了解,那么我们建议您从开始并进一步了解
solr -8.11.1.zip 文件
以solr8.11.1为基础镜像,使用docker-compose构建含中文分词器的新的镜像 文件夹内含有docker-compose.yml脚本、Dockerfile脚本以及构建镜像所需中文分词器ik-analyzer-8.5.0.jar、所有扩展词和停用词相关的配置文件...
"mir-solr:MIR SOLR配置"是一个与Solr相关的项目,可能涉及到在MIR(可能是某种特定的系统或框架)中集成和配置Apache Solr的细节。Apache Solr是一个开源的全文搜索引擎,常用于大数据量、高性能的搜索应用。在MIR...
它内置了 Solr:只需安装此模块即可。 设置完成后,Zotonic 会将其保存的每个资源推送到 Solr,以便可以查询数据库。 要将整个站点重新索引到 Solr,请按管理员中的“重建搜索索引”按钮。 安装 您需要为每个要为...
看不到源码Solr 引导程序 设置 Solr 搜索平台的 Ansible 角色 要求 系统上需要有Java,推荐角色yauh.java8。 角色变量 以下变量可与 solr 角色一起使用: solr_source: http://apache.openmirror.de/lucene/solr # ...
Solr 依存于Lucene,因为Solr底层的核心技术是使用Lucene 来实现的,Solr和Lucene的本质区别有以下三点:搜索服务器,企业级和管理。...所以说,一句话概括 Solr: Solr是Lucene面向企业搜索应用的扩展。
Solr搜索NodeBB : Solr(发音为“ solar”)是来自Apache Lucene项目的开源企业搜索平台。 它的主要功能包括全文搜索,命中突出显示,多面搜索,动态聚类,数据库集成以及丰富的文档(例如Word,PDF)处理。 此...
Laravel 4 Apache Solr Laravel 4软件包提供了一个接口,用于通过其静态接口使用(查询) 。安装首先通过Composer安装此软件包。 编辑项目的composer.json文件,以要求davispeixoto/laravel-4-solr 。 "require": {...
Spring Boot和Solr 在这个示例中,我们看到如何将spring boot与solr一起用作数据库: Sprint Boot平板电脑索尔我们要做的第一件事是在solr de vehicle中创建模式以保存车辆的信息。 使用此命令,我们将使用bash脚本...
本项目"**data_solr:CreateIndexBySolr**"聚焦于如何使用Solr的Java客户端库SolrJ来创建索引,并进行搜索操作。我们将深入探讨这个过程中的关键概念和技术细节。 首先,让我们了解**Solr**的基本概念。Solr是基于...
"cl-solr:用于 Common Lisp 的 Apache Solr API" 这个标题揭示了我们讨论的主题是一个名为 "cl-solr" 的软件库,它为 Common Lisp 编程语言提供了与 Apache Solr 的接口。Apache Solr 是一个流行的开源搜索引擎,...
**Spring Data Solr:通过Spring对Solr数据的增删改查封装** Spring Data Solr是Spring Data项目的一部分,它为Apache Solr搜索引擎提供了一种简单而强大的集成方式。Spring Data Solr允许开发者利用Spring框架的...
阿帕奇·索尔(Apache Solr) Apache Solr是一个用Java编写并使用的企业搜索平台。 主要功能包括全文搜索,索引复制和分片以及结果分面和突出显示。在线文件此自述文件仅包含基本的安装说明。 有关更全面的文档,请...
Docker中的Solr Alfresco专用的Solr docker映像,与高于4.2的Alfresco版本兼容。 创建的图像 [ alfresco-solr1 ] = solr1图片,使用tomcat [ alfresco-solr4 ] = solr4图像,使用tomcat [ alfresco-solr6 ] =使用...