- 浏览: 237477 次
- 性别:
- 来自: 上海
-
最新评论
-
feilian09:
怎么解决的!
httpclient 解析 dwr -
zhaiang:
你确定能够实现分组并且自定义排序?貌似不行啊...
solr facet 分组查询 -
aibrooks:
根本就不行 按照你说的
intellij idea 结合 tomcat 完成自动编译 -
epy:
很不错,谢谢。
ibatis集成c3p0 -
llscp:
楼主怎么解决的/
httpclient 解析 dwr
solrconfig.xml文件包含了大部分的参数用来配置Solr本身的。 dataDir parameter:<dataDir>/var/data/solr</dataDir>
用来指定一个替换原先在Solr目录下默认存放所有的索引数据,可以在Solr目录以外的任意目录中。如果复制使用后应该符合该参数。如果这个目录不是绝对路径的话,那么应该以当前的容器为相对路径。
mainIndex :
这个参数的值用来控制合并多个索引段。
<useCompoundFile>:通过将很多 Lucene 内部文件整合到单一一个文件来减少使用中的文件的数量。这可有助于减少 Solr 使用的文件句柄数目,代价是降低了性能。除非是应用程序用完了文件句柄,否则 false 的默认值应该就已经足够。
mergeFactor:
决定低水平的 Lucene 段被合并的频率。较小的值(最小为 2)使用的内存较少但导致的索引时间也更慢。较大的值可使索引时间变快但会牺牲较多的内存。
maxBufferedDocs:
在合并内存中文档和创建新段之前,定义所需索引的最小文档数。段 是用来存储索引信息的 Lucene 文件。较大的值可使索引时间变快但会牺牲较多的内存。
maxMergeDocs:
控制可由 Solr ,000) 最适合于具有合并的 Document 的最大数。较小的值 (< 10大量更新的应用程序。该参数不允许lucene在任何索引段里包含比这个值更多的文档,但是,多余的文档可以创建一个新的索引段进行替换。
maxFieldLength:
对于给定的 Document,控制可添加到 Field 的最大条目数,进而截断该文档。如果文档可能会很大,就需要增加这个数值。然而,若将这个值设置得过高会导致内存不足错误。
unlockOnStartup:
unlockOnStartup 告知 Solr 忽略在多线程环境中用来保护索引的锁定机制。在某些情况下,索引可能会由于不正确的关机或其他错误而一直处于锁定,这就妨碍了添加和更新。将其设置为 true 可以禁用启动锁定,进而允许进行添加和更新。
<mainIndex>
<!-- lucene options specific to the main on-disk lucene index -->
<useCompoundFile>false</useCompoundFile>
<mergeFactor>10</mergeFactor>
<maxBufferedDocs>1000</maxBufferedDocs>
<maxMergeDocs>2147483647</maxMergeDocs>
<maxFieldLength>10000</maxFieldLength>
</mainIndex>
updateHandler:
这个更新处理器主要涉及底层的关于如何更新处理内部的信息。(此参数不能跟高层次的配置参数Request Handlers对处理发自客户端的更新相混淆)。
<updateHandler class="solr.DirectUpdateHandler2">
<!-- Limit the number of deletions Solr will buffer during doc updating.
Setting this lower can help bound memory use during indexing.
-->
缓冲更新这么多的数目,设置如下比较低的值,可以约束索引时候所用的内存
<maxPendingDeletes>100000</maxPendingDeletes>
等待文档满足一定的标准后将自动提交,未来版本可以扩展现有的标准
<!-- autocommit pending docs if certain criteria are met. Future versions may expand the available
criteria -->
<autoCommit>
<maxDocs>10000</maxDocs> <!-- maximum uncommited docs before autocommit triggered -->
触发自动提交前最多可以等待提交的文档数量
<maxTime>86000</maxTime> <!-- maximum time (in MS) after adding a doc before an autocommit is triggered -->
在添加了一个文档之后,触发自动提交之前所最大的等待时间
</autoCommit>
这个参数用来配置执行外部的命令。
一个postCommit的事件被触发当每一个提交之后
<listener event="postCommit" class="solr.RunExecutableListener">
<str name="exe">snapshooter</str>
<str name="dir">solr/bin</str>
<bool name="wait">true</bool>
<!--
<arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
<arr name="env"> <str>MYVAR=val1</str> </arr>
-->
</listener>
exe--可执行的文件类型
dir--可以用该目录做为当前的工作目录。默认为"."
wait--调用线程要等到可执行的返回值
args--传递给程序的参数 默认nothing
env--环境变量的设置 默认nothing
<query>
<!-- Maximum number of clauses in a boolean query... can affect range
or wildcard queries that expand to big boolean queries.
一次布尔查询的最大数量,可以影响查询的范围或者进行通配符的查询,借此来扩展一个更强大的查询。
An exception is thrown if exceeded.
-->
<maxBooleanClauses>1024</maxBooleanClauses>
<query>:
控制跟查询相关的一切东东。
Caching:修改这个参数可以做为索引的增长和变化。
<!-- Cache used by SolrIndexSearcher for filters (DocSets),
unordered sets of *all* documents that match a query.
在过滤器中过滤文档集合的时候,或者是一个无序的所有的文档集合中将在在SolrIndexSearcher中使用缓存来匹配符合查询的所有文档。
When a new searcher is opened, its caches may be prepopulated
or "autowarmed" using data from caches in the old searcher.
当一次搜索被打开,它可以自动的或者预先从旧的搜索中使用缓存数据。
autowarmCount is the number of items to prepopulate.
autowarmCount这个值是预先设置的数值项。
For LRUCache,
the autowarmed items will be the most recently accessed items.
在LRUCache中,这个autowarmed 项中保存的是最近访问的项。
Parameters: 参数选项
class - the SolrCache implementation (currently only LRUCache)实现SolrCache接口的类 当前仅有LRUCache
size - the maximum number of entries in the cache
在cache中最大的上限值
initialSize - the initial capacity (number of entries) of
the cache. (seel java.util.HashMap)
在cache中初始化的数量
autowarmCount - the number of entries to prepopulate from
and old cache.
从旧的缓存中预先设置的项数。
-->
<filterCache
class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="256"/>
<!-- queryResultCache caches results of searches - ordered lists of
document ids (DocList) based on a query, a sort, and the range
of documents requested. -->
查询结果缓存
<queryResultCache
class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="256"/>
<!-- documentCache caches Lucene Document objects (the stored fields for each document).
documentCache缓存Lucene的文档对象(存储领域的每一个文件)
Since Lucene internal document ids are transient, this cache will not be autowarmed. -->
由于Lucene的内部文档ID标识(文档名称)是短暂的,所以这种缓存不会被自动warmed。
<documentCache
class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<!-- Example of a generic cache.
一个通用缓存的列子。
These caches may be accessed by name
through SolrIndexSearcher.getCache().cacheLookup(), and cacheInsert().
这些缓存可以通过在SolrIndexSearcher.getCache().cacheLookup()和cacheInsert()中利用缓存名称访问得到。
The purpose is to enable easy caching of user/application level data.
这样做的目的就是很方便的缓存用户级或应用程序级的数据。
The regenerator argument should be specified as an implementation
of solr.search.CacheRegenerator if autowarming is desired. -->
这么做的的关键就是应该明确规定实现solr.search.CacheRegenerator接口如果autowarming是比较理想化的设置。
<!--
<cache name="myUserCache"
class="solr.LRUCache"
size="4096"
initialSize="1024"
autowarmCount="1024"
regenerator="org.mycompany.mypackage.MyRegenerator"
/>
-->
<!-- An optimization that attempts to use a filter to satisfy a search.
一种优化方式就是利用一个过滤器,以满足搜索需求。
If the requested sort does not include a score,
如果请求的不是要求包括得分的类型,filterCache 这种过滤器将检查与过滤器相匹配的结果。如果找到,过滤器将被用来作为文档的来源识别码,并在这个基础上进行排序。
then the filterCache
will be checked for a filter matching the query. If found, the filter
will be used as the source of document ids, and then the sort will be
applied to that.
-->
<useFilterForSortedQuery>true</useFilterForSortedQuery>
<!-- An optimization for use with the queryResultCache. When a search
is requested, a superset of the requested number of document ids
are collected. For example, of a search for a particular query
requests matching documents 10 through 19, and queryWindowSize is 50,
then documents 0 through 50 will be collected and cached. Any further
requests in that range can be satisfied via the cache.
-->
一种优化用于queryResultCache,当一个搜索被请求,也会收集一定数量的文档ID做为一个超集。举个例子,一个特定的查询请求匹配的文档是10到19,此时,queryWindowSize是50,这样,文档从0到50都会被收集并缓存。这样,任何更多的在这个范围内的请求都会通过缓存来满足查询。
<queryResultWindowSize>50</queryResultWindowSize>
<!-- This entry enables an int hash representation for filters (DocSets)
when the number of items in the set is less than maxSize. For smaller
sets, this representation is more memory efficient, more efficient to
iterate over, and faster to take intersections.
-->
<HashDocSet maxSize="3000" loadFactor="0.75"/>
<!-- boolToFilterOptimizer converts boolean clauses with zero boost
cached filters if the number of docs selected by the clause exceeds the
threshold (represented as a fraction of the total index)
-->
<boolTofilterOptimizer enabled="true" cacheSize="32" threshold=".05"/>
<!-- Lazy field loading will attempt to read only parts of documents on disk that are
requested. Enabling should be faster if you aren't retrieving all stored fields.
-->
<enableLazyFieldLoading>false</enableLazyFieldLoading>
发表评论
-
solr定制文档hash
2017-08-18 19:27 431我们知道,solr在添加文档建索引的时候,通过文档id来进 ... -
Distributed Requests
2017-08-15 13:22 472Distributed Requests Query al ... -
collection async
2017-08-14 16:43 537Asynchronous Calls Since ... -
Collections API timeouts
2017-08-13 00:32 435Such timeout can occur when So ... -
Solr原子更新
2014-12-30 17:13 899Solr4.0开始支持简单的原子更新和添加字段 参数 ... -
solr分组聚合
2014-12-30 17:12 7407在大型电子商务网站中,在商品列表页,我们都可以看到商品按分类 ... -
solr 空格关键词
2011-03-16 22:57 3984在应用中,可能会遇到英文短语作为一个检索词进行索引,而索引的分 ... -
索引排序
2011-03-14 00:21 1477solr 后添加的索引或修改后的索引,在搜索时排到后面去了,有 ... -
IK自定义词库
2011-01-13 14:30 2428ik 支持api级的用户词库加载,和配置级的词库文件指定,无 ... -
解决Tomcat Too Many Open Files问题
2010-12-27 10:07 2623这个问题是第一次在Linux环境下碰到,把解决的方法记录下来。 ... -
solr 查询参数说明
2010-12-27 10:05 2358常用 q - 查询字符串,必须的。 fl - 指定返回 ... -
solrJ查询使用方法
2010-12-27 10:05 1779public class SolrJSearch { ... -
solr的复制功能
2010-12-27 10:03 2266参考朋友chenlb的文章:http://www.iteye. ... -
solr更换memcached缓存的方法
2010-12-27 09:56 19721、补丁文件2个,src/java/org/apache/so ... -
Solr调优
2010-12-27 09:54 3769Schema设计的思考 索引字段的数量(Indexed Fie ... -
solr的一些查询语法
2010-12-27 09:54 3001Solr 及 lucene 的 query 使用方法初級 ... -
Solr的检索运算符
2010-12-27 09:53 1865“:” 指定字段查指定值,如返回所有值*:*² “?” 表示 ... -
查找相似页面
2010-12-27 09:52 1436MLT 要求字段被储存或使用检索词向量,检索词向量以一种以文档 ... -
solr 1.3 更多扩展点
2010-12-27 09:51 1307在 Solr 1.3 中,扩展 Solr 以及配置和重新整理扩 ... -
solr一些概念
2010-12-27 09:50 1453一、 醒目显示的查询参 ...
相关推荐
### Solrconfig.xml 和 Schema.xml 说明 #### Solrconfig.xml 概述 Solrconfig.xml 是 Apache Solr 的核心配置文件之一,主要用于定义 Solr 实例如何处理文档的索引与查询请求。该文件中包含了多种配置项,用于...
Solr,作为一款开源的全文搜索引擎,其核心配置文件包括`schema.xml`和`solrconfig.xml`,它们是Solr工作方式的基础。在深入理解这两个文件之前,我们需要先了解Solr的基本架构。 **1. Solr架构简介** Solr采用...
【课程大纲】第01讲 solr5简介第02讲 solr5之Schema第03讲 solr5之Solrconfig第04讲 solr5单机安装与配置第05讲 solrj基础(一)第06讲 solrj基础(二)第07讲 solrj之SolrBean第08讲 solrj语法详解第09讲 Solrj之...
Solr的核心配置文件是`solrconfig.xml`和`schema.xml`,它们定义了索引的结构和处理查询的方式。 当你遇到404错误,首先检查Solr是否成功启动。查看日志文件(通常是`logs/solr.log`)以获取更详细的错误信息。如果...
3. 配置:每个核心都有自己的配置文件,主要位于`conf`目录下,包括`schema.xml`(定义字段和字段类型)、`solrconfig.xml`(配置索引和查询行为)、`managed-schema`(Solr6及以上版本,替代了`schema.xml`)等。...
将以下内容添加到 的“config”部分solrconfig.xml<queryParser name="redis" class="com.sematext.solr.redis.RedisQParserPlugin"> <str name="host">localhost</str> <str name="maxConnections">30</str> ...
9. **更新 Solrconfig.xml**:修改 `solrconfig.xml` 文件,确保引用的库指向正确的路径。这可能涉及到更新 `<lib>` 标签,指明 contrib 库的相对路径。 10. **启动 Tomcat**:最后,启动 Tomcat 服务,Solr 将会...
在 Solr 中,需要配置分词功能,例如使用 smartcn 分词器,需要在 solrconfig.xml 文件中添加相应的配置。然后,需要在 schema.xml 文件中添加分词器的配置。这样,Solr 就可以对中文文本进行分词和索引。 Solr 的...
本文将深入探讨两个关键的配置文件——`schema.xml`和`solrconfig.xml`,它们对于WPSOLR的正确配置和高效运行至关重要。 ### 1. `schema.xml` 文件 `schema.xml`是Apache Solr的核心配置文件之一,它定义了索引的...
在主服务器的 `solrconfig.xml` 中添加相关配置,如 `replicateAfter` 设置在提交或启动后进行复制,`confFiles` 指定需要同步的配置文件。 从服务器的配置中,也需要添加 ReplicationHandler,但其配置稍有不同,...
`solrconfig.xml`则包含Solr服务器的行为配置,如请求处理器、查询解析器、更新处理器链等。这两份文件的配置对于Solr的正确运作至关重要,也是优化性能的关键。 在"配置说明"文件中,你会了解到如何调整这些配置以...
1. **安装和配置Solr**: 首先,我们需要下载并安装Solr 5,然后根据项目需求配置solrconfig.xml和schema.xml文件。solrconfig.xml定义了索引和查询的行为,而schema.xml则定义了字段类型和字段。 2. **连接MySQL...
solrconfig.xml包含服务器实例的配置信息,比如DataDir、DirectoryFactory、Lib Directives、Schema Factory等。solr.xml用于定义solr core,包括每个core的名称和配置信息。solrconfig.xml中还定义了IndexConfig、...
2. **编辑solrconfig.xml**:在`solrconfig.xml`中添加DataImportHandler的配置,定义DataImportHandler的名称、数据源、请求处理器等信息。 3. **编写data-config.xml**:这是DIH的主要配置文件,定义了从数据库中...
配置`<fieldType>`标签,设置`class`为`solr.TextField`,并在`<analyzer>`部分引用之前在`solrconfig.xml`中定义的Analyzer。 4. **字段定义**:接着,为文档的各个字段指定使用这个新定义的字段类型,例如`...
"索引目录指向地址" 是指 Solr 存储索引文件的位置,这通常是在 `solrconfig.xml` 或 `web.xml` 中配置。你需要确保该路径指向你的数据目录,以便 Solr 可以正确地读取和写入索引。 安装 Solr 5.4.0 的步骤大致如下...
创建一个新的核心,定义其目录结构、schema.xml(定义字段和类型)和solrconfig.xml(配置索引和查询行为)。 4. **部署到Tomcat**:将解压后的Solr 3.5的web应用程序目录复制到Tomcat的webapps目录下,通常命名为`...
- **修改`solrconfig.xml`**:在SolrHome目录下的`conf\solrconfig.xml`文件中,设置索引文件夹路径。 ```xml ${solr.data.dir:./solr/data} ``` 6. **增加中文支持** - **修改`server.xml`**:在Tomcat的`...
3. **配置Solr核心**:在`solr/solr_home`目录下创建一个新的核心,例如`mycore`,并配置相应的`solrconfig.xml`和`schema.xml`文件。`solrconfig.xml`用于定义索引和查询的行为,`schema.xml`则用于定义字段类型和...
solrconfig.xml文件中包括lib、dataDir、indexConfig、directoryFactory、requestHandler等配置项。schema.xml文件中包括Field、Field类型、分词器等配置项。 Solr数据操作 Solr支持数据导入、索引构建、搜索等操作...