知识点
相关文章
更多最近更新
更多solr配置文件之solrconfig.xml
2019-03-27 00:22|来源: 网路
1.如果配置文件配置错误,是否提示。true要报错,false不报错。
<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
2.solr版本。
<luceneMatchVersion>LUCENE_31</luceneMatchVersion>
3. 索引文件目录,建索引的目录和查询的目录都是它。
<dataDir>${solr.data.dir:./solr/db/data}</dataDir>
4.一些基础配置
4.1多少个document进行合并
<mergeFactor>10</mergeFactor>
<!-- Sets the amount of RAM that may be used by Lucene indexingfor buffering added documents and deletions before they are
flushed to the Directory. -->
4.2 缓存大小
<ramBufferSizeMB>32</ramBufferSizeMB>
多少个文档自动合并
<mergeFactor>10</mergeFactor>
4.3.
设置域的最大长度
<maxFieldLength>10000</maxFieldLength>
设置写锁的延迟时间
<writeLockTimeout>1000</writeLockTimeout>
设置提交锁的延迟
<commitLockTimeout>10000</commitLockTimeout>
4.4
直接更新的方法:即调用solr默认的url访问。
<updateHandler class="solr.DirectUpdateHandler2">
自动提交的最大文档数,最大时间
<autoCommit>
<maxDocs>10000</maxDocs>
<maxTime>1000</maxTime>
</autoCommit>
4.5包含所有查询的参数设置 <query>
设置lru缓存
<filterCache class="solr.FastLRUCache"
size="16384"
initialSize="4096"
autowarmCount="4096"/>
设置查询结果缓存
<queryResultCache class="solr.LRUCache"
size="16384"
initialSize="4096"
autowarmCount="1024"/>
设置文档缓存
<documentCache class="solr.LRUCache"
size="16384"
initialSize="16384"/>
是否延迟加载索引域
<enableLazyFieldLoading>true</enableLazyFieldLoading>
设置查询的最大doc数
<queryResultMaxDocsCached>500</queryResultMaxDocsCached>
这个参数暂时未用
<maxWarmingSearchers>2</maxWarmingSearchers>
假如用dataimport这solr自带的导入数据命令时,的参数,即与数据库对应的文件的位置
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">C:\solr-tomcat\solr\db\conf\db-data-config.xml</str>
</lst>
</requestHandler>
这个标签是用来控制主索引服务器,与从索引服务器分发索引快照的所有属性的
<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="master">
<str name="replicateAfter">commit</str>
<str name="replicateAfter">startup</str>
<str name="confFiles">schema.xml,stopwords.txt,elevate.xml</str>
<str name="commitReserveDuration">00:00:60</str>
<str name="httpBasicAuthUser">345</str>
<str name="httpBasicAuthPassword">345</str>
</lst>
</requestHandler>
这个标签和他的名字是一样的,表示用于集群的组件所有参数
<searchComponent name="clustering"
enable="${solr.clustering.enabled:false}"
class="solr.clustering.ClusteringComponent" >
<!-- Declare an engine -->
<lst name="engine">
<!-- The name, only one can be named "default" -->
<str name="name">default</str>
<!-- Class name of Carrot2 clustering algorithm.
Currently available algorithms are:
* org.carrot2.clustering.lingo.LingoClusteringAlgorithm
* org.carrot2.clustering.stc.STCClusteringAlgorithm
See http://project.carrot2.org/algorithms.html for the
algorithm's characteristics.
-->
<str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
<!-- Overriding values for Carrot2 default algorithm attributes.
For a description of all available attributes, see:
http://download.carrot2.org/stable/manual/#chapter.components.
Use attribute key as name attribute of str elements
below. These can be further overridden for individual
requests by specifying attribute key as request parameter
name and attribute value as parameter value.
-->
<str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
<!-- The language to assume for the documents.
For a list of allowed values, see:
http://download.carrot2.org/stable/manual/#section.attribute.lingo.MultilingualClustering.defaultLanguage
-->
<str name="MultilingualClustering.defaultLanguage">ENGLISH</str>
</lst>
<lst name="engine">
<str name="name">stc</str>
<str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
</lst>
</searchComponent>
当发生集群命令时,对应的相应参数。表示是否开启集群等。
<requestHandler name="/clustering"
startup="lazy"
enable="${solr.clustering.enabled:false}"
class="solr.SearchHandler">
<lst name="defaults">
<bool name="clustering">true</bool>
<str name="clustering.engine">default</str>
<bool name="clustering.results">true</bool>
<!-- The title field -->
<str name="carrot.title">name</str>
<str name="carrot.url">id</str>
<!-- The field to cluster on -->
<str name="carrot.snippet">features</str>
<!-- produce summaries -->
<bool name="carrot.produceSummary">true</bool>
<!-- the maximum number of labels per cluster -->
<!--<int name="carrot.numDescriptions">5</int>-->
<!-- produce sub clusters -->
<bool name="carrot.outputSubClusters">false</bool>
<str name="defType">edismax</str>
<str name="qf">
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
</str>
<str name="q.alt">*:*</str>
<str name="rows">10</str>
<str name="fl">*,score</str>
</lst>
<arr name="last-components">
<str>clustering</str>
</arr>
</requestHandler>
默认查询条件
<admin>
<defaultQuery>*:*</defaultQuery>
<!-- configure a healthcheck file for servers behind a
loadbalancer
-->
<!--
<healthcheck type="file">server-enabled</healthcheck>
-->
</admin>
本文出自 “无证程序猿” 博客,请务必保留此出处http://yjflinchong.blog.51cto.com/6851233/1164964
转自:http://yjflinchong.blog.51cto.com/6851233/1164964
相关问答
更多-
Solr - 如何在solrconfig.xml中使用
标记的“dir”属性(Solr - How to use “dir” attribute of [2022-09-28]tag, in solrconfig.xml) 相对于solr instanceDir解析目录。 instanceDir是创建core.properties文件的地方。 它在instanceDir查找conf文件夹并创建data (索引数据)目录。 The directories are resolved relative to solr instanceDir. The instanceDir is place where it founds the core.properties file. It looks for a conf folder in ... -
我找到了问题的原因,似乎它只是Solr版本4.8.1中的一个错误,我升级到Solr 4.10.1现在它至少接受我的配置值,即使我仍然没有解决我的所有问题至少那个问题已经消失了。 I found the reason for the problem, seems like it was just a bug in Solr version 4.8.1, I upgraded to Solr 4.10.1 and now it at least accepts my config value, even tho ...
-
如何在solrconfig.xml中指定分片号/ zookeeper路径?(How can I specify shards number/zookeeper path in solrconfig.xml?)[2023-04-12]
您必须在[yourtomcatdir] /solr/solr.xml中执行此操作 - 在顶级节点(solr)的此文件中,您可以使用zkHost属性,在该属性中列出要连接的逗号分隔的zookeeper实例(host:port)获取核心配置。 You have to do this in [yourtomcatdir]/solr/solr.xml -- in this file at a top-level node (solr) you can have a zkHost attribute where yo ... -
每次执行软件提交或硬提交时,您的缓存或多或少都会失效,因为任何类型的提交通常都会创建一个“newsearcher”。 你可能有一个softcommit或hardcommit设置为1分钟。 检查此链接并查看软提交和硬提交部分。 It turned out that this was not related to SolR at all but to internal routing. For those interested it turned out that ipv6 DNS was checked an ...
-
您可以通过Solr模式API和Solr config API读取当前正在运行的模式和配置。 注意:此API的结果不是原始schema.xml或solrconfig.xml文件,但您可以从中重建原始文件。 同样,请注意Solr配置API仅在最新版本的Solr中可用。 在较旧的版本中(我测试版本4.8.1)没有solr配置的API,因此无法完全重建solrconfig.xml文件。 You can read the current running schema and config through the So ...
-
愚蠢的问题,愚蠢的回答。 Tomcat 6在tomcat6组下运行。 Tomcat 8作为tomcat8运行。 我的文件是-rw-rw---- amadan:tomcat6 。 解决方案: chgrp -R tomcat8 /disks/disk00/solr/ 。 Stupid problem, stupid answer. Tomcat 6 was running under the group tomcat6. Tomcat 8 runs as tomcat8. My files were -rw-r ...
-
你是对的,这是目录 请看这里http://wiki.apache.org/solr/SolrInstall#Setup 您在某些时候需要编辑的2个文件是: 的solr / CONF / solrconfig.xml中 的solr / CONF / schema.xml中 您正在安装哪个操作系统? 如果它是窗户,那么我可以帮助你...因为我已经做了很多次;) CraftyFella You are correct that's the directory see here see here http://wi ...
-
我以不同的方式完成了它。 以下示例尝试包含database.dih.prod.cr9.xml如果它不存在或无法加载,则将使用database.dih.dev2.cr9.xml代替。 solrconfig.xml中
是否可以使用solrconfig.xml过滤Solr结果?(Is it possible to filter Solr results using solrconfig.xml?)[2022-04-08]
请求处理程序wiki页面显示了如何指定默认值:10 * ...solrconfig.xml中的solr.data.dir指向哪里?(Relatively where does solr.data.dir in solrconfig.xml points to?)[2021-09-24]
那么solr.data.dir指向哪里? dataDir参数用于指定存储所有索引数据的目录。 如果此目录不是绝对目录,则它相对于启动Solr的目录。 如果文件夹为空,则在启动Solr时将自动重新创建新索引。 究竟SOLR_HOME定义在哪里? 这实际上取决于所使用的操作系统和Web服务器。 它定义了Solr的主目录。 最常见的是它可以定义: 在启动文件中, 使用系统环境变量,例如: export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/opt/solr/example ...