- <?xmlversion="1.0"encoding="UTF-8"?>
- <config>
-
- <!--表示solr底层使用的是lucene版本-->
- <luceneMatchVersion>LUCENE_43</luceneMatchVersion>
-
-
- <!--表示solr引用包的位置,当dir对应的目录不存在时候,会忽略此属性-->
- <libdir="../../../contrib/extraction/lib"regex=".*\.jar"/>
- <libdir="../../../dist/"regex="solr-cell-\d.*\.jar"/>
-
- <libdir="../../../contrib/clustering/lib/"regex=".*\.jar"/>
- <libdir="../../../dist/"regex="solr-clustering-\d.*\.jar"/>
-
- <libdir="../../../contrib/langid/lib/"regex=".*\.jar"/>
- <libdir="../../../dist/"regex="solr-langid-\d.*\.jar"/>
-
- <libdir="../../../contrib/velocity/lib"regex=".*\.jar"/>
- <libdir="../../../dist/"regex="solr-velocity-\d.*\.jar"/>
-
- <libdir="/non/existent/dir/yields/warning"/>
-
- <!--定义了索引数据和日志文件的存放位置-->
- <dataDir>${solr.data.dir:}</dataDir>
-
-
- <!--
-
- 索引存储方案,共有以下存储方案
- 1、solr.StandardDirectoryFactory,这是一个基于文件系统存储目录的工厂,它会试图选择最好的实现基于你当前的操作系统和Java虚拟机版本。
- 2、solr.SimpleFSDirectoryFactory,适用于小型应用程序,不支持大数据和多线程。
- 3、solr.NIOFSDirectoryFactory,适用于多线程环境,但是不适用在windows平台(很慢),是因为JVM还存在bug。
- 4、solr.MMapDirectoryFactory,这个是solr3.1到4.0版本在linux64位系统下默认的实现。它是通过使用虚拟内存和内核特性调用
- mmap去访问存储在磁盘中的索引文件。它允许lucene或solr直接访问I/O缓存。如果不需要近实时搜索功能,使用此工厂是个不错的方案。
- 5、solr.NRTCachingDirectoryFactory,此工厂设计目的是存储部分索引在内存中,从而加快了近实时搜索的速度。
- 6、solr.RAMDirectoryFactory,这是一个内存存储方案,不能持久化存储,在系统重启或服务器crash时数据会丢失。且不支持索引复制
- <directoryFactoryclass="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"name="DirectoryFactory">
- <strname="solr.hdfs.home">${solr.hdfs.home:}</str>
- <strname="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
- <strname="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
- <strname="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
- </directoryFactory>
- -->
- <directoryFactoryname="DirectoryFactory"
- class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
-
- <!--
- 编解码工厂允许使用自定义的编解码器。例如:如果想启动per-fieldDocValues格式,可以在solrconfig.xml里面设置SchemaCodecFactory:
- docValuesFormat="Lucene42":这是默认设置,所有数据会被加载到堆内存中。
- docValuesFormat="Disk":这是另外一个实现,将部分数据存储在磁盘上。
- docValuesFormat="SimpleText":文本格式,非常慢,用于学习。
-
- 定义的格式的CodecFactory反向索引。SchemaCodecFactory默认实现,这是官方的Lucene指数格式,但挂钩的模式提供域定制
- 帖子列表和每个文档的值在fieldType元素(postingsFormat/docValuesFormat)。注意,大多数的替代实现
- 实验,所以如果你选择定制索引格式,它的好想法通过IndexWriter.addIndexes转换回官方格式如(IndexReader)
- 升级到新版本之前,以避免不必要的改变符号。
- 当指定ManagedIndexSchemaFactory作为Solr为加载的模式。他在“managedSchemaResourceName”资源命名,而不是schema.xml。
- 注意,资源不能叫schema.xml管理模式。如果管理模式不存在,Solr将创建它在阅读模式。xml,然后重命名”模式。xml的“schema.xml.bak”。
- 不要手动编辑管理模式――外部修改将被忽略和覆盖的模式修改RESTAPI调用。
- 当指定ManagedIndexSchemaFactory可变=true,模式RESTAPI调用将被允许修改,否则,错误响应为这些请求返回。
- -->
- <codecFactoryclass="solr.SchemaCodecFactory"/>
- <schemaFactoryclass="ClassicIndexSchemaFactory"/>
-
- <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- IndexConfig-Thesesettingscontrollow-levelbehaviorofindexing
- Mostexamplesettingshereshowthedefaultvalue,butarecommented
- out,tomoreeasilyseewherecustomizationshavebeenmade.
-
- Note:Thisreplaces<indexDefaults>and<mainIndex>fromolderversions
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 用于设置索引的低级别的属性
- -->
- <indexConfig>
- <!--IndexWriter等待解锁的最长时间(毫秒)-->
- <writeLockTimeout>1000</writeLockTimeout>
-
- <!--
- 同步线程的最大数量索引文件立刻IndexWriter;如果超过这一点许多线程到达他们将等待其他人完成。
- 默认Solr/Lucene是8。-->
- <maxIndexingThreads>8</maxIndexingThreads>
-
- <!--Expert:Enablingcompoundfilewilluselessfilesfortheindex,usingfewerfiledescriptorsontheexpenSEOfperformancedecrease.
- DefaultinLuceneis"true".DefaultinSolris"false"(since3.6)
- 使复合文件将使用更少的文件的索引,使用更少的文件描述符为代价的性能下降。默认在Lucene是'true'。默认Solr是'false'
- -->
- <useCompoundFile>false</useCompoundFile>
-
- <!--
- solr缓存:两个同时定义时命中较低的那个。
- ramBufferSizeMB集的数量可能使用Lucene的RAM索引缓冲文件添加和删除之前刷新到该目录。
- maxBufferedDocs集限制文件缓冲的数量在冲洗之前。
- 如果ramBufferSizeMB和maxBufferedDocs设置Lucene将刷新基于任何限制是最先受到冲击。
- -->
- <ramBufferSizeMB>100</ramBufferSizeMB>
- <maxBufferedDocs>1000</maxBufferedDocs>
-
- <!--
- 合并策略
- 合并因素控制有多少段会合并。
- TieredMergePolicy,合并因子是一个方便的参数
- 将MaxMergeAtOnce和SegmentsPerTier。
- LogByteSizeMergePolicy,合并因子决定有多少新领域可以合并成一个。
- 默认都是10合并政策。
- -->
-
- <mergePolicyclass="org.apache.lucene.index.TieredMergePolicy">
- <intname="maxMergeAtOnce">10</int>
- <intname="segmentsPerTier">10</int>
- </mergePolicy>
- <!--合并因子,每次合并多少个segments-->
- <mergeFactor>10</mergeFactor>
-
- <!--
- 合并调度器
- Lucene控制合并的合并调度器
- 执行。ConcurrentMergeScheduler(Lucene2.3默认)
- 可以使用单独的线程在后台执行合并。
- SerialMergeScheduler(Lucene2.2默认)没有。
- -->
- <mergeSchedulerclass="org.apache.lucene.index.ConcurrentMergeScheduler"/>
-
- <!--
- 设置索引库的锁方式,主要有三种:
- 1.single:适用于只读的索引库,即索引库是定死的,不会再更改
- 2.native:使用本地操作系统的文件锁方式,不能用于多个solr服务共用同一个索引库。Solr3.6及后期版本使用的默认锁机制。
- 3.simple:使用简单的文件锁机制
- -->
- <lockType>${solr.lock.type:native}</lockType>
-
- <!--
- 是否启动时先解锁
- 如果这是真的,开启任何写或提交锁在启动时举行。
- 这违背了安全锁定机制,允许多个进程访问一个lucene索引,并且应该小心使用。默认设置是“false”。
- 这是不需要如果锁类型是'single'
- -->
- <unlockOnStartup>false</unlockOnStartup>
-
- <!--
- Luceneloadstermsintomemory间隔
- 控制频率Lucene加载到内存中
- 默认是128,可能对大多数情况都有益。
- -->
- <termIndexInterval>128</termIndexInterval>
-
- <!--
- 重新打开,替代先关闭-再打开
- 如果这是truw,indexreader将重新开放(通常更有效),而不是关闭,然后打开。默认值:真正的
- -->
- <reopenReaders>true</reopenReaders>
-
- <!--
- 提交删除策略
- 可以指定自定义删除策略。类必须实现org.apache.lucene.index.IndexDeletionPolicy。
- 默认SolrIndexDeletionPolicy实现支持删除索引提交点提交,优化状态。
- 最新提交点应该保存regardlessof标准。
- -->
- <deletionPolicyclass="solr.SolrDeletionPolicy">
- <!--提交的数量保持-->
- <strname="maxCommitsToKeep">1</str>
- <!--优化的数量提交保存-->
- <strname="maxOptimizedCommitsToKeep">0</str>
- <!--
- 删除所有提交点一旦达到给定的有效期
- -->
- <strname="maxCommitAge">30MINUTES</str>
- <strname="maxCommitAge">1DAY</str>
-
- </deletionPolicy>
-
- <!--LuceneInfostream
-
- Toaidinadvanceddebugging,Luceneprovidesan"InfoStream"
- ofdetailedinformationwhenindexing.
-
- SettingThevaluetotruewillinstructtheunderlyingLucene
- IndexWritertowriteitsdebugginginfothespecifiedfile
- -->
- <!--<infoStreamfile="INFOSTREAM.txt">false</infoStream>-->
- </indexConfig>
-
-
- <!--JMX
- 这个例子使JMX当且仅当发现现有的MBeanServer,使用这个如果你想配置JMX通过JVM参数。
- 删除此禁用暴露Solr配置JMX和统计。
- -->
- <jmx/>
- <!--<jmxagentId="myAgent"/>-->
- <!--<jmxserviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>-->
-
- <!--Thedefaulthigh-performanceupdatehandler-->
- <updateHandlerclass="solr.DirectUpdateHandler2">
-
- <!--
- 设置索引库更新日志,默认路径为solrhome下面的data/tlog。随着索引库的频繁更新,tlog文件会越来越大,
- 所以建议提交索引时采用硬提交方式<autoCommit>,即批量提交。
- -->
- <updateLog>
- <strname="dir">${solr.ulog.dir:}</str>
- </updateLog>
-
- <!--自动硬提交方式
-
- maxTime:设置多长时间提交一次maxDocs:设置达到多少文档提交一次openSearcher:文档提交后是否开启新的searcher,
- 如果false,文档只是提交到index索引库,搜索结果中搜不到此次提交的文档;如果true,既提交到index索引库,也能在搜索结果中搜到此次提交的内容。
- 提交自动在一定条件下执行困难。
- 启用自动提交,而是考虑使用“commitWithin”当添加文档。
- maxDocs-最大数量的文档添加自上次提交之前自动触发一个新提交。
- maxTime――最大的时间以来,可以通过文档添加之前自动触发一个新提交。单位ms
- opensearch――如果错误,提交导致最近的指数变化刷新到稳定的存储,但不会导致一个新的搜索器被打开,使这些变化明显。
- 如果启用了updateLog,那么强烈建议有一些很难自动提交日志大小限制。
- -->
- <autoCommit>
- <maxTime>15000</maxTime>
- <openSearcher>false</openSearcher>
- </autoCommit>
-
- <!--
- 软提交VS硬提交:只要其中一个
- softAutoCommit就像autoCommit除了它会导致一个“软”提交,只有确保变化是可见的,但不保证数据同步到磁盘。
- 这是更快和更接近实时的友好比硬提交。
- -->
- <autoSoftCommit>
- <maxTime>1000</maxTime>
- </autoSoftCommit>
-
- <!--
- 更新相关事件监听器:
- 各种IndexWriter相关事件可以触发听众采取行动。
- postCommit――每次提交或优化命令之后
- postOptimize――每一个优化命令后
-
- RunExecutableListener执行外部命令从一个钩postCommit或postOptimize等。
- exe-运行可执行文件的名称
- dir-dir作为当前工作目录。(默认=“.”当前目录)
- wait-调用线程等待等到可执行的回报。(默认="true")
- args-传递给程序的参数。(默认没有)
- env-环境变量设置。(默认没有)
- -->
- <!--
- <listenerevent="postCommit"class="solr.RunExecutableListener">
- <strname="exe">solr/bin/snapshooter</str>
- <strname="dir">.</str>
- <boolname="wait">true</bool>
- <arrname="args"><str>arg1</str><str>arg2</str></arr>
- <arrname="env"><str>MYVAR=val1</str></arr>
- </listener>
- -->
-
- </updateHandler>
-
- <!--IndexReaderFactory
-
- UsethefollowingformattospecifyacustomIndexReaderFactory,whichallowsforalternateIndexReaderimplementations.
-
- **ExperimentalFeature**
-
- Pleasenote-UsingacustomIndexReaderFactorymayprevent
- certainotherfeaturesfromworking.TheAPIto
- IndexReaderFactorymaychangewithoutwarningormayevenbe
- removedfromfuturereleasesiftheproblemscannotbe
- resolved.
-
-
- **FeaturesthatmaynotworkwithcustomIndexReaderFactory**
-
- TheReplicationHandlerassumesadisk-residentindex.Usinga
- customIndexReaderimplementationmaycauseincompatibility
- withReplicationHandlerandmaycausereplicationtonotwork
- correctly.SeeSOLR-1366fordetails.
-
- -->
- <!--
- <indexReaderFactoryname="IndexReaderFactory"class="package.class">
- <strname="someArg">SomeValue</str>
- </indexReaderFactory>
- -->
- <!--ByexplicitlydeclaringtheFactory,thetermIndexDivisorcan
- bespecified.
- -->
- <!--
- <indexReaderFactoryname="IndexReaderFactory"
- class="solr.StandardIndexReaderFactory">
- <intname="setTermIndexDivisor">12</int>
- </indexReaderFactory>
- -->
-
- <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Querysection-thesesettingscontrolquerytimethingslikecaches
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
- <query>
- <!--MaxBooleanClauses
-
- 设置boolean查询中,最大条件数。在范围搜索或者前缀搜索时,会产生大量的boolean条件,
- 如果条件数达到这个数值时,将抛出异常,限制这个条件数,可以防止条件过多查询等待时间过长。
- -->
- <maxBooleanClauses>1024</maxBooleanClauses>
-
-
- <!--SOLR查询缓存
-
- 有两个可用的缓存实现Solr,LRUCache基于同步LinkedHashMap,FastLRUCache基于一个ConcurrentHashMap。
- FastLRUCache有更快的获得和单线程的操作,因此通常将放缓速度比LRUCache当缓存的命中率很高(>75%),并可能在其他场景在多cpu系统快。
- -->
-
- <!--
- 过滤器缓存
- 缓存被SolrIndexSearcher过滤器(DocSets),无序的**文档匹配查询。
- 当一个新搜索器打开,其缓存可能或“hit”使用数据缓存来填充在旧的搜索者。
- autowarmCount是取自预填充的项的数量。
- LRUCache,hit物品将最近访问过的物品。
- 参数:
- class-LRUCache是SolrCache实现或(LRUCache或FastLRUCache)
- size-在缓存条目的最大数量
- initialSize-初始容量(缓存条目的数量)。(见java.util.HashMap)
- autowarmCount-取自条目的数量从老缓存预填充。
- -->
- <filterCacheclass="solr.FastLRUCache"
- size="512"
- initialSize="512"
- autowarmCount="0"/>
-
- <!--
- 查询结果缓存
- 缓存的搜索结果――有序列表的文档id(DocList)基于查询,排序,和文件要求的范围。
- -->
- <queryResultCacheclass="solr.LRUCache"
- size="512"
- initialSize="512"
- autowarmCount="0"/>
-
- <!--
- 文件缓存
- 缓存Lucene文档对象(存储为每个文档字段)。由于Lucene内部文档id是瞬态的,这个缓存不会hit。
- -->
- <documentCacheclass="solr.LRUCache"
- size="512"
- initialSize="512"
- autowarmCount="0"/>
-
- <!--字段值缓存
- 缓存用来保存字段值快速访问的文档id。fieldValueCache创建默认情况下即使没有配置。
- -->
- <fieldValueCacheclass="solr.FastLRUCache"
- size="512"
- autowarmCount="128"
- showItems="32"/>
-
- <!--自定义缓存
-
- Exampleofagenericcache.Thesecachesmaybeaccessedby
- namethroughSolrIndexSearcher.getCache(),cacheLookup(),and
- cacheInsert().Thepurposeistoenableeasycachingof
- user/applicationleveldata.Theregeneratorargumentshould
- bespecifiedasanimplementationofsolr.CacheRegenerator
- ifautowarmingisdesired.
- -->
- <!--
- <cachename="myUserCache"
- class="solr.LRUCache"
- size="4096"
- initialSize="1024"
- autowarmCount="1024"
- regenerator="com.mycompany.MyRegenerator"
- />
- -->
-
-
- <!--
- 懒散字段加载
- 如果这是真的,存储字段不要求将装载。
- 这可能导致明显的速度提升如果通常的情况下是不加载所有存储字段,特别是如果跳过字段压缩的文本字段。
- -->
- <enableLazyFieldLoading>true</enableLazyFieldLoading>
-
- <!--UseFilterForSortedQuery
-
- Apossibleoptimizationthatattemptstouseafilterto
- satisfyasearch.Iftherequestedsortdoesnotinclude
- score,thenthefilterCachewillbecheckedforafilter
- matchingthequery.Iffound,thefilterwillbeusedasthe
- sourceofdocumentids,andthenthesortwillbeappliedto
- that.
-
- Formostsituations,thiswillnotbeusefulunlessyou
- frequentlygetthesamesearchrepeatedlywithdifferentsort
- options,andnoneofthemeveruse"score"
- -->
- <!--
- <useFilterForSortedQuery>true</useFilterForSortedQuery>
- -->
-
- <!--ResultWindowSize
-
- AnoptimizationforusewiththequeryResultCache.Whenasearch
- isrequested,asupersetoftherequestednumberofdocumentids
- arecollected.Forexample,ifasearchforaparticularquery
- requestsmatchingdocuments10through19,andqueryWindowSizeis50,thendocuments0through49willbecollectedandcached.Anyfurther
- requestsinthatrangecanbesatisfiedviathecache.
- -->
- <queryResultWindowSize>20</queryResultWindowSize>
-
- <!--Maximumnumberofdocumentstocacheforanyentryinthe
- queryResultCache.
- -->
- <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
-
- <!--QueryRelatedEventListeners
-
- VarIoUsIndexSearcherrelatedeventscantriggerListenersto
- takeactions.
-
- newSearcher-firedwheneveranewsearcherisbeingprepared
- andthereisacurrentsearcherhandlingrequests(aka
- registered).Itcanbeusedtoprimecertaincachesto
- preventlongrequesttimesforcertainrequests.
-
- firstSearcher-firedwheneveranewsearcherisbeing
- preparedbutthereisnocurrentregisteredsearchertohandle
- requestsortogainautowarmingdatafrom.
-
-
- -->
- <!--QuerySenderListenertakesanarrayofNamedListandexecutesa
- localqueryrequestforeachNamedListinsequence.
- -->
- <listenerevent="newSearcher"class="solr.QuerySenderListener">
- <arrname="queries">
- <!--
- <lst><strname="q">solr</str><strname="sort">priceasc</str></lst>
- <lst><strname="q">rocks</str><strname="sort">weightasc</str></lst>
- -->
- </arr>
- </listener>
- <listenerevent="firstSearcher"class="solr.QuerySenderListener">
- <arrname="queries">
- <lst>
- <strname="q">staticfirstSearcherwarminginsolrconfig.xml</str>
- </lst>
- </arr>
- </listener>
-
- <!--
- solr默认为false。如果为true,索引文件减少,检索性能降低,追求平衡
- -->
- <useColdSearcher>false</useColdSearcher>
-
- <!--
- 最大热搜索
- 最大数量的同时在后台搜索,可能会变慢。返回一个错误如果超过这个限制。
- 推荐1-2的值对于只读从盘,高主盘w/o缓存变暖。
- -->
- <maxWarmingSearchers>2</maxWarmingSearchers>
-
- </query>
-
-
- <!--请求转发器
- 主要是介绍当有请求访问SolrCore时SolrDispatchFilter如何处理。
- handleSelect是一个以前版本中遗留下来的属性,会影响请求的对应行为(比如/select?qt=XXX)。
- 当handleSelect="true"时导致SolrDispatchFilter将请求转发给qt指定的处理器(前提是/select已经注册)。
- 当handleSelect="false"时会直接访问/select,若/select未注册则为404。
- -->
- <requestDispatcherhandleSelect="false">
- <!--请求解析
- 这些设置说明SolrRequests如何被解析,以及对ContentStreams有什么限制。
- enableRemoteStreaming-是否允许使用stream.file和stream.url参数来指定远程streams。
- multipartUploadLimitInKB-指定多文件上传时Solr允许的最大的size。
- formdataUploadLimitInKB-表单通过POST请求发送的最大size
- ******的警告
- 下面的设置授权Solr获取远程文件,你
- 应该确保你的系统有一些认证吗
- 使用enableRemoteStreaming="true"
-
- -->
- <requestParsersenableRemoteStreaming="true"
- multipartUploadLimitInKB="2048000"
- formdataUploadLimitInKB="2048"/>
-
- <!--HTTPCaching
- 设置HTTP缓存的相关参数。
- -->
- <httpCachingnever304="true"/>
- <!--Ifyouincludea<cacheControl>directive,itwillbeusedto
- generateaCache-Controlheader(aswellasanExpiresheader
- ifthevaluecontains"max-age=")
-
- Bydefault,noCache-Controlheaderisgenerated.
-
- Youcanusethe<cacheControl>optionevenifyouhaveset
- never304="true"
- -->
- <!--
- <httpCachingnever304="true">
- <cacheControl>max-age=30,public</cacheControl>
- </httpCaching>
- -->
- <!--ToenableSolrtorespondwithautomaticallygeneratedHTTP
- Cachingheaders,andtoresponsetoCacheValidationrequests
- correctly,setthevalueofnever304="false"
-
- ThiswillcauseSolrtogenerateLast-ModifiedandETag
- headersbasedonthepropertiesoftheIndex.
-
- Thefollowingoptionscanalsobespecifiedtoaffectthe
- valuesoftheseheaders...
-
- lastModFrom-thedefaultvalueis"openTime"whichmeansthe
- Last-Modifiedvalue(andvalidationagainstIf-Modified-Since
- requests)willallberelativetowhenthecurrentSearcher
- wasopened.YoucanchangeittolastModFrom="dirLastMod"if
- youwantthevaluetoexactlycorrespondtowhenthephysical
- indexwaslastmodified.
-
- etagSeed="..."isanoptionyoucanchangetoforcetheETag
- header(andvalidationagainstIf-None-Matchrequests)tobe
- differenteveniftheindexhasnotchanged(ie:whenmaking
- significantchangestoyourconfigfile)
-
- (lastModifiedFromandetagSeedarebothignoredifyouuse
- thenever304="true"option)
- -->
- <!--
- <httpCachinglastModifiedFrom="openTime"
- etagSeed="Solr">
- <cacheControl>max-age=30,public</cacheControl>
- </httpCaching>
- -->
- </requestDispatcher>
-
- <!--RequestHandlers
- 输入的请求会通过请求中的路径被转发到特定的处理器。
- -->
- <!--SearchHandler
-
- 基本的请求处理器是SearchHandler,它提供一系列SearchComponents。
- 通过multipleshards支持分布式。
- -->
- <requestHandlername="/select"class="solr.SearchHandler">
- <!--可以指定默认值。-->
- <lstname="defaults">
- <strname="echoParams">explicit</str>
- <intname="rows">10</int>
- <strname="df">text</str>
- </lst>
- <!--添加属性-->
- <!--
- <lstname="appends">
- <strname="fq">inStock:true</str>
- </lst>
- -->
- <!--用法同上,尽量不要使用。-->
- <!--
- <lstname="invariants">
- <strname="facet.field">cat</str>
- <strname="facet.field">manu_exact</str>
- <strname="facet.query">price:[*TO500]</str>
- <strname="facet.query">price:[500TO*]</str>
- </lst>
- -->
- <!--下面的配置可以重置SearchComponents-->
- <!--
- <arrname="components">
- <str>nameOfCustomComponent1</str>
- <str>nameOfCustomComponent2</str>
- </arr>
- -->
- </requestHandler>
-
- <!--ArequesthandlerthatreturnsindentedJSONbydefault-->
- <requestHandlername="/query"class="solr.SearchHandler">
- <lstname="defaults">
- <strname="echoParams">explicit</str>
- <strname="wt">json</str>
- <strname="indent">true</str>
- <strname="df">text</str>
- </lst>
- </requestHandler>
-
-
- <!--realtimegethandler,guaranteedtoreturnthelateststoredfieldsof
- anydocument,withouttheneedtocommitoropenanewsearcher.The
- currentimplementationreliesontheupdateLogfeaturebeingenabled.-->
- <requestHandlername="/get"class="solr.RealTimeGetHandler">
- <lstname="defaults">
- <strname="omitHeader">true</str>
- <strname="wt">json</str>
- <strname="indent">true</str>
- </lst>
- </requestHandler>
-
-
- <!--ARobustExample
-
- ThisexampleSearchHandlerdeclarationshowsoffusageofthe
- SearchHandlerwithmanydefaultsdeclared
-
- NotethatmultipleinstancesofthesameRequestHandler
- (SearchHandler)canberegisteredmultipletimeswithdifferent
- names(anddifferentinitparameters)
- -->
- <requestHandlername="/browse"class="solr.SearchHandler">
- <lstname="defaults">
- <strname="echoParams">explicit</str>
-
- <!--VelocityResponseWritersettings-->
- <strname="wt">velocity</str>
- <strname="v.template">browse</str>
- <strname="v.layout">layout</str>
- <strname="title">Solritas</str>
-
- <!--Querysettings-->
- <strname="defType">edismax</str>
- <strname="qf">
- text^0.5features^1.0name^1.2sku^1.5id^10.0manu^1.1cat^1.4
- title^10.0description^5.0keywords^5.0author^2.0resourcename^1.0
- </str>
- <strname="df">text</str>
- <strname="mm">100%</str>
- <strname="q.alt">*:*</str>
- <strname="rows">10</str>
- <strname="fl">*,score</str>
-
- <strname="mlt.qf">
- text^0.5features^1.0name^1.2sku^1.5id^10.0manu^1.1cat^1.4
- title^10.0description^5.0keywords^5.0author^2.0resourcename^1.0
- </str>
- <strname="mlt.fl">text,features,name,sku,id,manu,cat,title,description,keywords,author,resourcename</str>
- <intname="mlt.count">3</int>
-
- <!--Facetingdefaults-->
- <strname="facet">on</str>
- <strname="facet.field">cat</str>
- <strname="facet.field">manu_exact</str>
- <strname="facet.field">content_type</str>
- <strname="facet.field">author_s</str>
- <strname="facet.query">ipod</str>
- <strname="facet.query">GB</str>
- <strname="facet.mincount">1</str>
- <strname="facet.pivot">cat,inStock</str>
- <strname="facet.range.other">after</str>
- <strname="facet.range">price</str>
- <intname="f.price.facet.range.start">0</int>
- <intname="f.price.facet.range.end">600</int>
- <intname="f.price.facet.range.gap">50</int>
- <strname="facet.range">popularity</str>
- <intname="f.popularity.facet.range.start">0</int>
- <intname="f.popularity.facet.range.end">10</int>
- <intname="f.popularity.facet.range.gap">3</int>
- <strname="facet.range">manufacturedate_dt</str>
- <strname="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
- <strname="f.manufacturedate_dt.facet.range.end">NOW</str>
- <strname="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
- <strname="f.manufacturedate_dt.facet.range.other">before</str>
- <strname="f.manufacturedate_dt.facet.range.other">after</str>
-
- <!--Highlightingdefaults-->
- <strname="hl">on</str>
- <strname="hl.fl">contentfeaturestitlename</str>
- <strname="hl.encoder">html</str>
- <strname="hl.simple.pre"><b></str>
- <strname="hl.simple.post"></b></str>
- <strname="f.title.hl.fragsize">0</str>
- <strname="f.title.hl.alternateField">title</str>
- <strname="f.name.hl.fragsize">0</str>
- <strname="f.name.hl.alternateField">name</str>
- <strname="f.content.hl.snippets">3</str>
- <strname="f.content.hl.fragsize">200</str>
- <strname="f.content.hl.alternateField">content</str>
- <strname="f.content.hl.maxAlternateFieldLength">750</str>
-
- <!--Spellcheckingdefaults-->
- <strname="spellcheck">on</str>
- <strname="spellcheck.extendedResults">false</str>
- <strname="spellcheck.count">5</str>
- <strname="spellcheck.alternativeTermCount">2</str>
- <strname="spellcheck.maxResultsForSuggest">5</str>
- <strname="spellcheck.collate">true</str>
- <strname="spellcheck.collateExtendedResults">true</str>
- <strname="spellcheck.maxCollationTries">5</str>
- <strname="spellcheck.maxCollations">3</str>
- </lst>
-
- <!--appendspellcheckingtoourlistofcomponents-->
- <arrname="last-components">
- <str>spellcheck</str>
- </arr>
- </requestHandler>
-
-
- <!--UpdateRequestHandler.
-
- http://wiki.apache.org/solr/UpdateXmlMessages
-
- ThecanonicalRequestHandlerforModifyingtheIndexthrough
- commandsspecifiedusingXML,JSON,CSV,orJAVABIN
-
- Note:Sincesolr1.1requestHandlersrequiresavalidcontent
- typeheaderifpostedinthebody.Forexample,curlnow
- requires:-H'Content-type:text/xml;charset=utf-8'
-
- Tooverridetherequestcontenttypeandforceaspecific
- Content-type,usetherequestparameter:
- ?update.contentType=text/csv
-
- Thishandlerwillpickaresponseformattomatchtheinput
- ifthe'wt'parameterisnotexplicit
- -->
- <requestHandlername="/update"class="solr.UpdateRequestHandler">
- <!--Seebelowforinformationondefining
- updateRequestProcessorChainsthatcanbeusedbyname
- oneachUpdateRequest
- -->
- <!--
- <lstname="defaults">
- <strname="update.chain">dedupe</str>
- </lst>
- -->
- </requestHandler>
-
- <!--forbackcompatwithclientsusing/update/jsonand/update/csv-->
- <requestHandlername="/update/json"class="solr.JsonUpdateRequestHandler">
- <lstname="defaults">
- <strname="stream.contentType">application/json</str>
- </lst>
- </requestHandler>
- <requestHandlername="/update/csv"class="solr.CSVRequestHandler">
- <lstname="defaults">
- <strname="stream.contentType">application/csv</str>
- </lst>
- </requestHandler>
-
- <!--SolrCellUpdateRequestHandler
-
- http://wiki.apache.org/solr/ExtractingRequestHandler
-
- -->
- <requestHandlername="/update/extract"
- startup="lazy"
- class="solr.extraction.ExtractingRequestHandler">
- <lstname="defaults">
- <strname="lowernames">true</str>
- <strname="uprefix">ignored_</str>
-
- <!--capturelinkhrefsbutignoredivattributes-->
- <strname="captureAttr">true</str>
- <strname="fmap.a">links</str>
- <strname="fmap.div">ignored_</str>
- </lst>
- </requestHandler>
-
-
- <!--FieldAnalysisRequestHandler
-
- RequestHandlerthatprovidesmuchthesamefunctionalityas
- analysis.jsp.Providestheabilitytospecifymultiplefield
- typesandfieldnamesinthesamerequestandoutputs
- index-timeandquery-timeanalysisforeachofthem.
-
- Requestparametersare:
- analysis.fieldname-fieldnamewhoseanalyzersaretobeused
-
- analysis.fieldtype-fieldtypewhoseanalyzersaretobeused
- analysis.fieldvalue-textforindex-timeanalysis
- q(oranalysis.q)-textforquerytimeanalysis
- analysis.showmatch(true|false)-Whensettotrueandwhen
- queryanalysisisperformed,theproducedtokensofthe
- fieldvalueanalysiswillbemarkedas"matched"forevery
- tokenthatisproducesbythequeryanalysis
- -->
- <requestHandlername="/analysis/field"
- startup="lazy"
- class="solr.FieldAnalysisRequestHandler"/>
-
-
- <!--DocumentAnalysisHandler
-
- http://wiki.apache.org/solr/AnalysisRequestHandler
-
- Ananalysishandlerthatprovidesabreakdownoftheanalysis
- processofprovideddocuments.Thishandlerexpectsa(single)
- contentstreamwiththefollowingformat:
-
- <docs>
- <doc>
- <fieldname="id">1</field>
- <fieldname="name">TheName</field>
- <fieldname="text">TheTextValue</field>
- </doc>
- <doc>...</doc>
- <doc>...</doc>
- ...
- </docs>
-
- Note:Eachdocumentmustcontainafieldwhichservesasthe
- uniquekey.Thiskeyisusedinthereturnedresponsetoassociate
- ananalysisbreakdowntotheanalyzeddocument.
-
- LiketheFieldAnalysisRequestHandler,thishandleralsosupports
- queryanalysisbysendingeitheran"analysis.query"or"q"
- requestparameterthatholdsthequerytexttobeanalyzed.It
- alsosupportsthe"analysis.showmatch"parameterwhichwhensetto
- true,allfieldtokensthatmatchthequerytokenswillbemarked
- asa"match".
- -->
- <requestHandlername="/analysis/document"
- class="solr.DocumentAnalysisRequestHandler"
- startup="lazy"/>
-
- <!--AdminHandlers
-
- AdminHandlers-Thiswillregisterallthestandardadmin
- RequestHandlers.
- -->
- <requestHandlername="/admin/"
- class="solr.admin.AdminHandlers"/>
- <!--Thissinglehandlerisequivalenttothefollowing...-->
- <!--
- <requestHandlername="/admin/luke"class="solr.admin.LukeRequestHandler"/>
- <requestHandlername="/admin/system"class="solr.admin.SystemInfoHandler"/>
- <requestHandlername="/admin/plugins"class="solr.admin.PluginInfoHandler"/>
- <requestHandlername="/admin/threads"class="solr.admin.ThreadDumpHandler"/>
- <requestHandlername="/admin/properties"class="solr.admin.PropertiesRequestHandler"/>
- <requestHandlername="/admin/file"class="solr.admin.ShowFileRequestHandler">
- -->
- <!--Ifyouwishtohidefilesunder${solr.home}/conf,explicitly
- registertheShowFileRequestHandlerusing:
- -->
- <!--
- <requestHandlername="/admin/file"
- class="solr.admin.ShowFileRequestHandler">
- <lstname="invariants">
- <strname="hidden">synonyms.txt</str>
- <strname="hidden">anotherfile.txt</str>
- </lst>
- </requestHandler>
- -->
-
- <!--ping/healthcheck-->
- <requestHandlername="/admin/ping"class="solr.PingRequestHandler">
- <lstname="invariants">
- <strname="q">solrpingquery</str>
- </lst>
- <lstname="defaults">
- <strname="echoParams">all</str>
- </lst>
- <!--AnoptionalfeatureofthePingRequestHandleristoconfigurethe
- handlerwitha"healthcheckFile"whichcanbeusedtoenable/disable
- thePingRequestHandler.
- relativepathsareresolvedagainstthedatadir
- -->
- <!--<strname="healthcheckFile">server-enabled.txt</str>-->
- </requestHandler>
-
- <!--Echotherequestcontentsbacktotheclient-->
- <requestHandlername="/debug/dump"class="solr.DumpRequestHandler">
- <lstname="defaults">
- <strname="echoParams">explicit</str>
- <strname="echoHandler">true</str>
- </lst>
- </requestHandler>
-
- <!--SolrReplication
-
- TheSolrReplicationHandlersupportsreplicatingindexesfroma
- "master"usedforindexingand"slaves"usedforqueries.
-
- http://wiki.apache.org/solr/SolrReplication
-
- ItisalsonecessaryforSolrCloudtofunction(inCloudmode,the
- replicationhandlerisusedtobulktransfersegmentswhennodes
- areaddedorneedtorecover).
-
- https://wiki.apache.org/solr/SolrCloud/
- -->
- <requestHandlername="/replication"class="solr.ReplicationHandler">
- <!--
- Toenablesimplemaster/slavereplication,uncommentoneofthe
- sectionsbelow,dependingonwhetherthissolrinstanceshouldbe
- the"master"ora"slave".Ifthisinstanceisa"slave"youwill
- alsoneedtofillinthemasterUrltopointtoarealmachine.
- -->
- <!--
- <lstname="master">
- <strname="replicateAfter">commit</str>
- <strname="replicateAfter">startup</str>
- <strname="confFiles">schema.xml,stopwords.txt</str>
- </lst>
- -->
- <!--
- <lstname="slave">
- <strname="masterUrl">http://your-master-hostname:8983/solr</str>
- <strname="pollInterval">00:00:60</str>
- </lst>
- -->
- </requestHandler>
-
- <!--SearchComponents
-
- SearchcomponentsareregisteredtoSolrCoreandusedby
- instancesofSearchHandler(whichcanaccessthembyname)
-
- Bydefault,thefollowingcomponentsareavailable:
-
- <searchComponentname="query"class="solr.QueryComponent"/>
- <searchComponentname="facet"class="solr.FacetComponent"/>
- <searchComponentname="mlt"class="solr.MoreLikeThisComponent"/>
- <searchComponentname="highlight"class="solr.HighlightComponent"/>
- <searchComponentname="stats"class="solr.StatsComponent"/>
- <searchComponentname="debug"class="solr.DebugComponent"/>
-
- DefaultconfigurationinarequestHandlerwouldlooklike:
-
- <arrname="components">
- <str>query</str>
- <str>facet</str>
- <str>mlt</str>
- <str>highlight</str>
- <str>stats</str>
- <str>debug</str>
- </arr>
-
- IfyouregisterasearchComponenttooneofthestandardnames,thatwillbeusedinsteadofthedefault.
-
- Toinsertcomponentsbeforeorafterthe'standard'components,use:
-
- <arrname="first-components">
- <str>myFirstComponentName</str>
- </arr>
-
- <arrname="last-components">
- <str>myLastComponentName</str>
- </arr>
-
- NOTE:Thecomponentregisteredwiththename"debug"will
- alwaysbeexecutedafterthe"last-components"
-
- -->
-
- <!--SpellCheck
-
- Thespellcheckcomponentcanreturnalistofalternativespelling
- suggestions.
-
- http://wiki.apache.org/solr/SpellCheckComponent
- -->
- <searchComponentname="spellcheck"class="solr.SpellCheckComponent">
-
- <strname="queryAnalyzerFieldType">text_general</str>
-
- <!--Multiple"SpellCheckers"canbedeclaredandusedbythis
- component
- -->
-
- <!--aspellcheckerbuiltfromafieldofthemainindex-->
- <lstname="spellchecker">
- <strname="name">default</str>
- <strname="field">text</str>
- <strname="classname">solr.DirectSolrSpellChecker</str>
- <!--thespellcheckdistancemeasureused,thedefaultistheinternallevenshtein-->
- <strname="distanceMeasure">internal</str>
- <!--minimumaccuracyneededtobeconsideredavalidspellchecksuggestion-->
- <floatname="accuracy">0.5</float>
- <!--themaximum#editsweconsiderwhenenumeratingterms:canbe1or2-->
- <intname="maxEdits">2</int>
- <!--theminimumsharedprefixwhenenumeratingterms-->
- <intname="minPrefix">1</int>
- <!--maximumnumberofinspectionsperresult.-->
- <intname="maxInspections">5</int>
- <!--minimumlengthofaquerytermtobeconsideredforcorrection-->
- <intname="minQueryLength">4</int>
- <!--maximumthresholdofdocumentsaquerytermcanappeartobeconsideredforcorrection-->
- <floatname="maxQueryFrequency">0.01</float>
- <!--uncommentthistorequiresuggestionstooccurin1%ofthedocuments
- <floatname="thresholdTokenFrequency">.01</float>
- -->
- </lst>
-
- <!--aspellcheckerthatcanbreakorcombinewords.See"/spell"handlerbelowforusage-->
- <lstname="spellchecker">
- <strname="name">wordbreak</str>
- <strname="classname">solr.WordBreakSolrSpellChecker</str>
- <strname="field">name</str>
- <strname="combineWords">true</str>
- <strname="breakWords">true</str>
- <intname="maxChanges">10</int>
- </lst>
-
- <!--aspellcheckerthatusesadifferentdistancemeasure-->
- <!--
- <lstname="spellchecker">
- <strname="name">jarowinkler</str>
- <strname="field">spell</str>
- <strname="classname">solr.DirectSolrSpellChecker</str>
- <strname="distanceMeasure">
- org.apache.lucene.search.spell.JaroWinklerDistance
- </str>
- </lst>
- -->
-
- <!--aspellcheckerthatuseanalternatecomparator
-
- comparatorClassbeoneof:
- 1.score(default)
- 2.freq(Frequencyfirst,thenscore)
- 3.Afullyqualifiedclassname
- -->
- <!--
- <lstname="spellchecker">
- <strname="name">freq</str>
- <strname="field">lowerfilt</str>
- <strname="classname">solr.DirectSolrSpellChecker</str>
- <strname="comparatorClass">freq</str>
- -->
-
- <!--Aspellcheckerthatreadsthelistofwordsfromafile-->
- <!--
- <lstname="spellchecker">
- <strname="classname">solr.FileBasedSpellChecker</str>
- <strname="name">file</str>
- <strname="sourceLocation">spellings.txt</str>
- <strname="characterEncoding">UTF-8</str>
- <strname="spellcheckIndexDir">spellcheckerFile</str>
- </lst>
- -->
- </searchComponent>
-
- <!--Arequesthandlerfordemonstratingthespellcheckcomponent.
-
- NOTE:Thisispurelyasanexample.ThewholepurpoSEOfthe
- SpellCheckComponentistohookitintotherequesthandlerthat
- handlesyournormaluserqueriessothataseparaterequestis
- notneededtogetsuggestions.
-
- INOTHERWORDS,THEREISREALLYGOODCHANCETHESETUPBELOWIS
- NOTWHATYOUWANTFORYOURPRODUCTIONSYSTEM!
-
- Seehttp://wiki.apache.org/solr/SpellCheckComponentfordetails
- ontherequestparameters.
- -->
- <requestHandlername="/spell"class="solr.SearchHandler"startup="lazy">
- <lstname="defaults">
- <strname="df">text</str>
- <!--Solrwillusesuggestionsfromboththe'default'spellchecker
- andfromthe'wordbreak'spellcheckerandcombinethem.
- collations(re-writtenqueries)canincludeacombinationof
- correctionsfrombothspellcheckers-->
- <strname="spellcheck.dictionary">default</str>
- <strname="spellcheck.dictionary">wordbreak</str>
- <strname="spellcheck">on</str>
- <strname="spellcheck.extendedResults">true</str>
- <strname="spellcheck.count">10</str>
- <strname="spellcheck.alternativeTermCount">5</str>
- <strname="spellcheck.maxResultsForSuggest">5</str>
- <strname="spellcheck.collate">true</str>
- <strname="spellcheck.collateExtendedResults">true</str>
- <strname="spellcheck.maxCollationTries">10</str>
- <strname="spellcheck.maxCollations">5</str>
- </lst>
- <arrname="last-components">
- <str>spellcheck</str>
- </arr>
- </requestHandler>
-
- <!--TermVectorComponent
-
- http://wiki.apache.org/solr/TermVectorComponent
- -->
- <searchComponentname="tvComponent"class="solr.TermVectorComponent"/>
-
- <!--Arequesthandlerfordemonstratingthetermvectorcomponent
-
- Thisispurelyasanexample.
-
- Inrealityyouwilllikelywanttoaddthecomponenttoyour
- alreadyspecifiedrequesthandlers.
- -->
- <requestHandlername="/tvrh"class="solr.SearchHandler"startup="lazy">
- <lstname="defaults">
- <strname="df">text</str>
- <boolname="tv">true</bool>
- </lst>
- <arrname="last-components">
- <str>tvComponent</str>
- </arr>
- </requestHandler>
-
- <!--ClusteringComponent
-
- http://wiki.apache.org/solr/ClusteringComponent
-
- You'llneedtosetthesolr.clustering.enabledsystemproperty
- whenrunningsolrtorunwithclusteringenabled:
-
- java-Dsolr.clustering.enabled=true-jarstart.jar
-
- -->
- <searchComponentname="clustering"
- enable="${solr.clustering.enabled:false}"
- class="solr.clustering.ClusteringComponent">
- <!--Declareanengine-->
- <lstname="engine">
- <!--Thename,onlyonecanbenamed"default"-->
- <strname="name">default</str>
-
- <!--ClassnameofCarrot2clusteringalgorithm.
-
- Currentlyavailablealgorithmsare:
-
- *org.carrot2.clustering.lingo.LingoClusteringAlgorithm
- *org.carrot2.clustering.stc.STCClusteringAlgorithm
- *org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
-
- Seehttp://project.carrot2.org/algorithms.htmlforthe
- algorithm'scharacteristics.
- -->
- <strname="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
-
- <!--OverridingvaluesforCarrot2defaultalgorithmattributes.
-
- Foradescriptionofallavailableattributes,see:
- http://download.carrot2.org/stable/manual/#chapter.components.
- Useattributekeyasnameattributeofstrelements
- below.Thesecanbefurtheroverriddenforindividual
- requestsbyspecifyingattributekeyasrequestparameter
- nameandattributevalueasparametervalue.
- -->
- <strname="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
-
- <!--LocationofCarrot2lexicalresources.
-
- AdirectoryfromwhichtoloadCarrot2-specificstopwords
- andstoplabels.AbsoluteorrelativetoSolrconfigdirectory.
- Ifaspecificresource(e.g.stopwords.en)ispresentinthe
- specifieddir,itwillcompletelyoverridethecorresponding
- defaultonethatshipswithCarrot2.
-
- ForanoverviewofCarrot2lexicalresources,see:
- http://download.carrot2.org/head/manual/#chapter.lexical-resources
- -->
- <strname="carrot.lexicalResourcesDir">clustering/carrot2</str>
-
- <!--Thelanguagetoassumeforthedocuments.
-
- Foralistofallowedvalues,see:
- http://download.carrot2.org/stable/manual/#section.attribute.lingo.MultilingualClustering.defaultLanguage
- -->
- <strname="MultilingualClustering.defaultLanguage">ENGLISH</str>
- </lst>
- <lstname="engine">
- <strname="name">stc</str>
- <strname="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
- </lst>
- </searchComponent>
-
- <!--Arequesthandlerfordemonstratingtheclusteringcomponent
-
- Thisispurelyasanexample.
-
- Inrealityyouwilllikelywanttoaddthecomponenttoyour
- alreadyspecifiedrequesthandlers.
- -->
- <requestHandlername="/clustering"
- startup="lazy"
- enable="${solr.clustering.enabled:false}"
- class="solr.SearchHandler">
- <lstname="defaults">
- <boolname="clustering">true</bool>
- <strname="clustering.engine">default</str>
- <boolname="clustering.results">true</bool>
- <!--Thetitlefield-->
- <strname="carrot.title">name</str>
- <strname="carrot.url">id</str>
- <!--Thefieldtoclusteron-->
- <strname="carrot.snippet">features</str>
- <!--producesummaries-->
- <boolname="carrot.produceSummary">true</bool>
- <!--themaximumnumberoflabelspercluster-->
- <!--<intname="carrot.numDescriptions">5</int>-->
- <!--producesubclusters-->
- <boolname="carrot.outputSubClusters">false</bool>
-
- <strname="defType">edismax</str>
- <strname="qf">
- text^0.5features^1.0name^1.2sku^1.5id^10.0manu^1.1cat^1.4
- </str>
- <strname="q.alt">*:*</str>
- <strname="rows">10</str>
- <strname="fl">*,score</str>
- </lst>
- <arrname="last-components">
- <str>clustering</str>
- </arr>
- </requestHandler>
-
- <!--TermsComponent
-
- http://wiki.apache.org/solr/TermsComponent
-
- Acomponenttoreturntermsanddocumentfrequencyofthose
- terms
- -->
- <searchComponentname="terms"class="solr.TermsComponent"/>
-
- <!--Arequesthandlerfordemonstratingthetermscomponent-->
- <requestHandlername="/terms"class="solr.SearchHandler"startup="lazy">
- <lstname="defaults">
- <boolname="terms">true</bool>
- <boolname="distrib">false</bool>
- </lst>
- <arrname="components">
- <str>terms</str>
- </arr>
- </requestHandler>
-
-
- <!--QueryElevationComponent
-
- http://wiki.apache.org/solr/QueryElevationComponent
-
- asearchcomponentthatenablesyoutoconfigurethetop
- resultsforagivenqueryregardlessofthenormallucene
- scoring.
- -->
- <searchComponentname="elevator"class="solr.QueryElevationComponent">
- <!--pickafieldTypetoanalyzequeries-->
- <strname="queryFieldType">string</str>
- <strname="config-file">elevate.xml</str>
- </searchComponent>
-
- <!--Arequesthandlerfordemonstratingtheelevatorcomponent-->
- <requestHandlername="/elevate"class="solr.SearchHandler"startup="lazy">
- <lstname="defaults">
- <strname="echoParams">explicit</str>
- <strname="df">text</str>
- </lst>
- <arrname="last-components">
- <str>elevator</str>
- </arr>
- </requestHandler>
-
- <!--HighlightingComponent
-
- http://wiki.apache.org/solr/HighlightingParameters
- -->
- <searchComponentclass="solr.HighlightComponent"name="highlight">
- <highlighting>
- <!--Configurethestandardfragmenter-->
- <!--Thiscouldmostlikelybecommentedoutinthe"default"case-->
- <fragmentername="gap"
- default="true"
- class="solr.highlight.GapFragmenter">
- <lstname="defaults">
- <intname="hl.fragsize">100</int>
- </lst>
- </fragmenter>
-
- <!--Aregular-expression-basedfragmenter
- (forsentenceextraction)
- -->
- <fragmentername="regex"
- class="solr.highlight.RegexFragmenter">
- <lstname="defaults">
- <!--slightlysmallerfragsizesworkbetterbecauSEOfslop-->
- <intname="hl.fragsize">70</int>
- <!--allow50%sloponfragmentsizes-->
- <floatname="hl.regex.slop">0.5</float>
- <!--abasicsentencepattern-->
- <strname="hl.regex.pattern">[-\w,/\n\"']{20,200}</str>
- </lst>
- </fragmenter>
-
- <!--Configurethestandardformatter-->
- <formattername="html"
- default="true"
- class="solr.highlight.HtmlFormatter">
- <lstname="defaults">
- <strname="hl.simple.pre"><![CDATA[<em>]]></str>
- <strname="hl.simple.post"><![CDATA[</em>]]></str>
- </lst>
- </formatter>
-
- <!--Configurethestandardencoder-->
- <encodername="html"
- class="solr.highlight.HtmlEncoder"/>
-
- <!--ConfigurethestandardfragListBuilder-->
- <fragListBuildername="simple"
- class="solr.highlight.SimpleFragListBuilder"/>
-
- <!--ConfigurethesinglefragListBuilder-->
- <fragListBuildername="single"
- class="solr.highlight.SingleFragListBuilder"/>
-
- <!--ConfiguretheweightedfragListBuilder-->
- <fragListBuildername="weighted"
- default="true"
- class="solr.highlight.WeightedFragListBuilder"/>
-
- <!--defaulttagFragmentsBuilder-->
- <fragmentsBuildername="default"
- default="true"
- class="solr.highlight.scoreOrderFragmentsBuilder">
- <!--
- <lstname="defaults">
- <strname="hl.multiValuedSeparatorChar">/</str>
- </lst>
- -->
- </fragmentsBuilder>
-
- <!--multi-coloredtagFragmentsBuilder-->
- <fragmentsBuildername="colored"
- class="solr.highlight.scoreOrderFragmentsBuilder">
- <lstname="defaults">
- <strname="hl.tag.pre"><![CDATA[
- <bstyle="background:yellow">,<bstyle="background:lawgreen">,<bstyle="background:aquamarine">,<bstyle="background:magenta">,<bstyle="background:palegreen">,<bstyle="background:coral">,<bstyle="background:wheat">,<bstyle="background:khaki">,<bstyle="background:lime">,<bstyle="background:deepskyblue">]]></str>
- <strname="hl.tag.post"><![CDATA[</b>]]></str>
- </lst>
- </fragmentsBuilder>
-
- <boundaryScannername="default"
- default="true"
- class="solr.highlight.SimpleBoundaryScanner">
- <lstname="defaults">
- <strname="hl.bs.maxScan">10</str>
- <strname="hl.bs.chars">.,!?	 </str>
- </lst>
- </boundaryScanner>
-
- <boundaryScannername="breakIterator"
- class="solr.highlight.BreakIteratorBoundaryScanner">
- <lstname="defaults">
- <!--typeshouldbeoneofCHARACTER,WORD(default),LINEandSENTENCE-->
- <strname="hl.bs.type">WORD</str>
- <!--languageandcountryareusedwhenconstructingLocaleobject.-->
- <!--AndtheLocaleobjectwillbeusedwhengettinginstanceofBreakIterator-->
- <strname="hl.bs.language">en</str>
- <strname="hl.bs.country">US</str>
- </lst>
- </boundaryScanner>
- </highlighting>
- </searchComponent>
-
- <!--UpdateProcessors
-
- ChainsofUpdateProcessorFactoriesfordealingwithUpdate
- Requestscanbedeclared,andthenusedbynameinUpdate
- RequestProcessors
-
- http://wiki.apache.org/solr/UpdateRequestProcessor
-
- -->
- <!--Deduplication
-
- Anexamplededupupdateprocessorthatcreatesthe"id"field
- ontheflybasedonthehashcodeofsomeotherfields.This
- examplehasoverwriteDupessettofalsesinceweareusingthe
- idfieldasthesignatureFieldandSolrwillmaintain
- uniquenessbasedonthatanyway.
-
- -->
- <!--
- <updateRequestProcessorChainname="dedupe">
- <processorclass="solr.processor.SignatureUpdateProcessorFactory">
- <boolname="enabled">true</bool>
- <strname="signatureField">id</str>
- <boolname="overwriteDupes">false</bool>
- <strname="fields">name,cat</str>
- <strname="signatureClass">solr.processor.Lookup3Signature</str>
- </processor>
- <processorclass="solr.LogUpdateProcessorFactory"/>
- <processorclass="solr.RunUpdateProcessorFactory"/>
- </updateRequestProcessorChain>
- -->
-
- <!--Languageidentification
-
- Thisexampleupdatechainidentifiesthelanguageoftheincoming
- documentsusingthelangidcontrib.Thedetectedlanguageis
- writtentofieldlanguage_s.Nofieldnamemappingisdone.
- Thefieldsusedfordetectionaretext,subjectanddescription,makingthisexamplesuitablefordetectinglanguagesformfull-text
- richdocumentsinjectedviaExtractingRequestHandler.
- SeemoreaboutlangIdathttp://wiki.apache.org/solr/LanguageDetection
- -->
- <!--
- <updateRequestProcessorChainname="langid">
- <processorclass="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
- <strname="langid.fl">text,subject,description</str>
- <strname="langid.langField">language_s</str>
- <strname="langid.fallback">en</str>
- </processor>
- <processorclass="solr.LogUpdateProcessorFactory"/>
- <processorclass="solr.RunUpdateProcessorFactory"/>
- </updateRequestProcessorChain>
- -->
-
- <!--Scriptupdateprocessor
-
- ThisexamplehooksinanupdateprocessorimplementedusingJavaScript.
-
- Seemoreaboutthescriptupdateprocessorathttp://wiki.apache.org/solr/ScriptUpdateProcessor
- -->
- <!--
- <updateRequestProcessorChainname="script">
- <processorclass="solr.StatelessScriptUpdateProcessorFactory">
- <strname="script">update-script.js</str>
- <lstname="params">
- <strname="config_param">exampleconfigparameter</str>
- </lst>
- </processor>
- <processorclass="solr.RunUpdateProcessorFactory"/>
- </updateRequestProcessorChain>
- -->
-
- <!--ResponseWriters
-
- http://wiki.apache.org/solr/QueryResponseWriter
-
- Requestresponseswillbewrittenusingthewriterspecifiedby
- the'wt'requestparametermatchingthenameofaregistered
- writer.
-
- The"default"writeristhedefaultandwillbeusedif'wt'is
- notspecifiedintherequest.
- -->
- <!--Thefollowingresponsewritersareimplicitlyconfiguredunless
- overridden...
- -->
- <!--
- <queryResponseWritername="xml"
- default="true"
- class="solr.XMLResponseWriter"/>
- <queryResponseWritername="json"class="solr.JSONResponseWriter"/>
- <queryResponseWritername="python"class="solr.PythonResponseWriter"/>
- <queryResponseWritername="ruby"class="solr.RubyResponseWriter"/>
- <queryResponseWritername="PHP"class="solr.PHPResponseWriter"/>
- <queryResponseWritername="PHPs"class="solr.PHPSerializedResponseWriter"/>
- <queryResponseWritername="csv"class="solr.CSVResponseWriter"/>
- <queryResponseWritername="schema.xml"class="solr.SchemaXmlResponseWriter"/>
- -->
-
- <queryResponseWritername="json"class="solr.JSONResponseWriter">
- <!--Forthepurposesofthetutorial,JSONresponsesarewrittenas
- plaintextsothattheyareeasytoreadin*any*browser.
- IfyouexpectaMIMEtypeof"application/json"justremovethisoverride.
- -->
- <strname="content-type">text/plain;charset=UTF-8</str>
- </queryResponseWriter>
-
- <!--
- Customresponsewriterscanbedeclaredasneeded...
- -->
- <queryResponseWritername="velocity"class="solr.VelocityResponseWriter"startup="lazy"/>
-
-
- <!--XSLTresponsewritertransformstheXMLoutputbyanyxsltfilefound
- inSolr'sconf/xsltdirectory.Changestoxsltfilesarecheckedfor
- everyxsltCacheLifetimeSeconds.
- -->
- <queryResponseWritername="xslt"class="solr.XSLTResponseWriter">
- <intname="xsltCacheLifetimeSeconds">5</int>
- </queryResponseWriter>
-
- <!--QueryParsers
-
- http://wiki.apache.org/solr/SolrQuerySyntax
-
- MultipleQParserPluginscanberegisteredbyname,andthen
- usedineitherthe"defType"paramfortheQueryComponent(used
- bySearchHandler)orinLocalParams
- -->
- <!--exampleofregisteringaqueryparser-->
- <!--
- <queryParsername="myparser"class="com.mycompany.MyQParserPlugin"/>
- -->
-
- <!--FunctionParsers
-
- http://wiki.apache.org/solr/FunctionQuery
-
- MultipleValueSourceParserscanberegisteredbyname,andthen
- usedasfunctionnameswhenusingthe"func"QParser.
- -->
- <!--exampleofregisteringacustomfunctionparser-->
- <!--
- <valueSourceParsername="myfunc"
- class="com.mycompany.MyValueSourceParser"/>
- -->
-
-
- <!--DocumentTransformers
- http://wiki.apache.org/solr/DocTransformers
- -->
- <!--
- Couldbesomethinglike:
- <transformername="db"class="com.mycompany.LoadFromDatabaseTransformer">
- <intname="connection">jdbc://....</int>
- </transformer>
-
- Toaddaconstantvaluetoalldocs,use:
- <transformername="mytrans2"class="org.apache.solr.response.transform.ValueAugmenterFactory">
- <intname="value">5</int>
- </transformer>
-
- Ifyouwanttheusertostillbeabletochangeitwith_value:something_usethis:
- <transformername="mytrans3"class="org.apache.solr.response.transform.ValueAugmenterFactory">
- <doublename="defaultValue">5</double>
- </transformer>
-
- IfyouareusingtheQueryElevationComponent,youmaywishtomarkdocumentsthatgetboosted.The
- EditorialMarkerFactorywilldoexactlythat:
- <transformername="qecBooster"class="org.apache.solr.response.transform.EditorialMarkerFactory"/>
- -->
-
-
- <!--Legacyconfigfortheadmininterface-->
- <admin>
- <defaultQuery>*:*</defaultQuery>
- </admin>
-
- </config>