Advertisement
Guest User

solrconf.xml

a guest
Apr 18th, 2012
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 31.00 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements.  See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License.  You may obtain a copy of the License at
  9.  
  10.     http://www.apache.org/licenses/LICENSE-2.0
  11.  
  12. Unless required by applicable law or agreed to in writing, software
  13. distributed under the License is distributed on an "AS IS" BASIS,
  14. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. See the License for the specific language governing permissions and
  16. limitations under the License.
  17. -->
  18.  
  19. <config name="drupal-1.4">
  20.  
  21.   <!-- Set this to 'false' if you want solr to continue working after it has
  22.       encountered an severe configuration error.  In a production environment,
  23.       you may want solr to keep working even if one handler is mis-configured.
  24.  
  25.       You may also set this to false using by setting the system property:
  26.         -Dsolr.abortOnConfigurationError=false
  27.     -->
  28.   <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
  29.  
  30.   <luceneMatchVersion>LUCENE_35</luceneMatchVersion>
  31.  
  32.   <!-- Used to specify an alternate directory to hold all index data
  33.       other than the default ./data under the Solr home.
  34.       If replication is in use, this should match the replication configuration. -->
  35. <!--
  36.  <dataDir>${solr.data.dir:./solr/data}</dataDir>
  37. -->
  38.  
  39.   <indexDefaults>
  40.    <!-- Values here affect all index writers and act as a default unless overridden. -->
  41.     <useCompoundFile>false</useCompoundFile>
  42.  
  43.     <mergeFactor>4</mergeFactor>
  44.     <!--
  45.     If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
  46.  
  47.     -->
  48.     <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
  49.     <!-- Tell Lucene when to flush documents to disk.
  50.    Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
  51.  
  52.    If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
  53.  
  54.    -->
  55.     <ramBufferSizeMB>32</ramBufferSizeMB>
  56.     <maxMergeDocs>2147483647</maxMergeDocs>
  57.     <maxFieldLength>20000</maxFieldLength>
  58.     <writeLockTimeout>1000</writeLockTimeout>
  59.     <commitLockTimeout>10000</commitLockTimeout>
  60.  
  61.     <!--
  62.     Expert: Turn on Lucene's auto commit capability.
  63.     This causes intermediate segment flushes to write a new lucene
  64.     index descriptor, enabling it to be opened by an external
  65.     IndexReader.
  66.     NOTE: Despite the name, this value does not have any relation to Solr's autoCommit functionality
  67.     -->
  68.     <!--<luceneAutoCommit>false</luceneAutoCommit>-->
  69.     <!--
  70.     Expert:
  71.     The Merge Policy in Lucene controls how merging is handled by Lucene.  The default in 2.3 is the LogByteSizeMergePolicy, previous
  72.     versions used LogDocMergePolicy.
  73.  
  74.     LogByteSizeMergePolicy chooses segments to merge based on their size.  The Lucene 2.2 default, LogDocMergePolicy chose when
  75.     to merge based on number of documents
  76.  
  77.     Other implementations of MergePolicy must have a no-argument constructor
  78.     -->
  79.     <mergePolicy>org.apache.lucene.index.LogByteSizeMergePolicy</mergePolicy>
  80.  
  81.     <!--
  82.     Expert:
  83.     The Merge Scheduler in Lucene controls how merges are performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
  84.      can perform merges in the background using separate threads.  The SerialMergeScheduler (Lucene 2.2 default) does not.
  85.     -->
  86.     <mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>
  87.  
  88.     <!--
  89.      This option specifies which Lucene LockFactory implementation to use.
  90.      
  91.      single = SingleInstanceLockFactory - suggested for a read-only index
  92.               or when there is no possibility of another process trying
  93.               to modify the index.
  94.      native = NativeFSLockFactory
  95.      simple = SimpleFSLockFactory
  96.  
  97.      (For backwards compatibility with Solr 1.2, 'simple' is the default
  98.       if not specified.)
  99.    -->
  100.     <lockType>single</lockType>
  101.   </indexDefaults>
  102.  
  103.   <mainIndex>
  104.     <infoStream file="/var/log/infostream.log">true</infoStream>
  105.     <!-- options specific to the main on-disk lucene index -->
  106.     <useCompoundFile>false</useCompoundFile>
  107.     <ramBufferSizeMB>32</ramBufferSizeMB>
  108.     <mergeFactor>4</mergeFactor>
  109.     <!-- Deprecated -->
  110.     <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
  111.     <maxMergeDocs>2147483647</maxMergeDocs>
  112.     <maxFieldLength>10000</maxFieldLength>
  113.  
  114.     <!-- If true, unlock any held write or commit locks on startup.
  115.         This defeats the locking mechanism that allows multiple
  116.         processes to safely access a lucene index, and should be
  117.         used with care.
  118.         This is not needed if lock type is 'none' or 'single'
  119.     -->
  120.     <unlockOnStartup>false</unlockOnStartup>
  121.  
  122.     <!--
  123.        Custom deletion policies can specified here. The class must
  124.        implement org.apache.lucene.index.IndexDeletionPolicy.
  125.  
  126.        http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/index/IndexDeletionPolicy.html
  127.  
  128.        The standard Solr IndexDeletionPolicy implementation supports deleting
  129.        index commit points on number of commits, age of commit point and
  130.        optimized status.
  131.  
  132.        The latest commit point should always be preserved regardless
  133.        of the criteria.
  134.    -->
  135.     <deletionPolicy class="solr.SolrDeletionPolicy">
  136.       <!-- Keep only optimized commit points -->
  137.       <str name="keepOptimizedOnly">false</str>
  138.       <!-- The maximum number of commit points to be kept -->
  139.       <str name="maxCommitsToKeep">1</str>
  140.       <!--
  141.          Delete all commit points once they have reached the given age.
  142.          Supports DateMathParser syntax e.g.
  143.          
  144.          <str name="maxCommitAge">30MINUTES</str>
  145.          <str name="maxCommitAge">1DAY</str>
  146.      -->
  147.     </deletionPolicy>
  148.  
  149.   </mainIndex>
  150.  
  151.   <!--  Enables JMX if and only if an existing MBeanServer is found, use
  152.         this if you want to configure JMX through JVM parameters. Remove
  153.         this to disable exposing Solr configuration and statistics to JMX.
  154.  
  155.         If you want to connect to a particular server, specify the agentId
  156.         e.g. <jmx agentId="myAgent" />
  157.  
  158.         If you want to start a new MBeanServer, specify the serviceUrl
  159.         e.g <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr" />
  160.  
  161.         For more details see http://wiki.apache.org/solr/SolrJmx
  162.  -->
  163.   <jmx />
  164.  
  165.   <!-- the default high-performance update handler -->
  166.   <updateHandler class="solr.DirectUpdateHandler2">
  167.  
  168.     <!-- A prefix of "solr." for class names is an alias that
  169.         causes solr to search appropriate packages, including
  170.         org.apache.solr.(search|update|request|core|analysis)
  171.     -->
  172.  
  173.     <!-- Perform a <commit/> automatically under certain conditions:
  174.         maxDocs - number of updates since last commit is greater than this
  175.         maxTime - oldest uncommited update (in ms) is this long ago
  176.    -->
  177.     <autoCommit>
  178.       <maxDocs>2000</maxDocs>
  179.       <maxTime>120000</maxTime>
  180.     </autoCommit>
  181.  
  182.  
  183.     <!-- The RunExecutableListener executes an external command.
  184.         exe - the name of the executable to run
  185.         dir - dir to use as the current working directory. default="."
  186.         wait - the calling thread waits until the executable returns. default="true"
  187.         args - the arguments to pass to the program.  default=nothing
  188.         env - environment variables to set.  default=nothing
  189.      -->
  190.     <!-- A postCommit event is fired after every commit or optimize command
  191.    <listener event="postCommit" class="solr.RunExecutableListener">
  192.      <str name="exe">solr/bin/snapshooter</str>
  193.      <str name="dir">.</str>
  194.      <bool name="wait">true</bool>
  195.      <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
  196.      <arr name="env"> <str>MYVAR=val1</str> </arr>
  197.    </listener>
  198.    -->
  199.     <!-- A postOptimize event is fired only after every optimize command, useful
  200.         in conjunction with index distribution to only distribute optimized indicies
  201.    <listener event="postOptimize" class="solr.RunExecutableListener">
  202.      <str name="exe">snapshooter</str>
  203.      <str name="dir">solr/bin</str>
  204.      <bool name="wait">true</bool>
  205.    </listener>
  206.    -->
  207.  
  208.   </updateHandler>
  209.  
  210.  
  211.   <query>
  212.     <!-- Maximum number of clauses in a boolean query... can affect
  213.        range or prefix queries that expand to big boolean
  214.        queries.  An exception is thrown if exceeded.  -->
  215.     <maxBooleanClauses>1024</maxBooleanClauses>
  216.  
  217.  
  218.     <!-- There are two implementations of cache available for Solr,
  219.         LRUCache, based on a synchronized LinkedHashMap, and
  220.         FastLRUCache, based on a ConcurrentHashMap.  FastLRUCache has faster gets
  221.         and slower puts in single threaded operation and thus is generally faster
  222.         than LRUCache when the hit ratio of the cache is high (> 75%), and may be
  223.         faster under other scenarios on multi-cpu systems. -->
  224.     <!-- Cache used by SolrIndexSearcher for filters (DocSets),
  225.         unordered sets of *all* documents that match a query.
  226.         When a new searcher is opened, its caches may be prepopulated
  227.         or "autowarmed" using data from caches in the old searcher.
  228.         autowarmCount is the number of items to prepopulate.  For LRUCache,
  229.         the autowarmed items will be the most recently accessed items.
  230.       Parameters:
  231.         class - the SolrCache implementation LRUCache or FastLRUCache
  232.         size - the maximum number of entries in the cache
  233.         initialSize - the initial capacity (number of entries) of
  234.           the cache.  (seel java.util.HashMap)
  235.         autowarmCount - the number of entries to prepopulate from
  236.           and old cache.
  237.         -->
  238.     <filterCache
  239.      class="solr.FastLRUCache"
  240.      size="512"
  241.      initialSize="512"
  242.      autowarmCount="128"/>
  243.  
  244.     <!-- Cache used to hold field values that are quickly accessible
  245.         by document id.  The fieldValueCache is created by default
  246.         even if not configured here.
  247.      <fieldValueCache
  248.        class="solr.FastLRUCache"
  249.        size="512"
  250.        autowarmCount="128"
  251.        showItems="32"
  252.      />
  253.    -->
  254.  
  255.    <!-- queryResultCache caches results of searches - ordered lists of
  256.         document ids (DocList) based on a query, a sort, and the range
  257.         of documents requested.  -->
  258.     <queryResultCache
  259.      class="solr.LRUCache"
  260.      size="512"
  261.      initialSize="512"
  262.      autowarmCount="32"/>
  263.  
  264.   <!-- documentCache caches Lucene Document objects (the stored fields for each document).
  265.       Since Lucene internal document ids are transient, this cache will not be autowarmed.  -->
  266.     <documentCache
  267.      class="solr.LRUCache"
  268.      size="512"
  269.      initialSize="512"
  270.      autowarmCount="0"/>
  271.  
  272.     <!-- If true, stored fields that are not requested will be loaded lazily.
  273.  
  274.    This can result in a significant speed improvement if the usual case is to
  275.    not load all stored fields, especially if the skipped fields are large compressed
  276.    text fields.
  277.    -->
  278.     <enableLazyFieldLoading>true</enableLazyFieldLoading>
  279.  
  280.     <!-- Example of a generic cache.  These caches may be accessed by name
  281.         through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
  282.         The purpose is to enable easy caching of user/application level data.
  283.         The regenerator argument should be specified as an implementation
  284.         of solr.search.CacheRegenerator if autowarming is desired.  -->
  285.     <!--
  286.    <cache name="myUserCache"
  287.      class="solr.LRUCache"
  288.      size="4096"
  289.      initialSize="1024"
  290.      autowarmCount="1024"
  291.      regenerator="org.mycompany.mypackage.MyRegenerator"
  292.      />
  293.    -->
  294.  
  295.    <!-- An optimization that attempts to use a filter to satisfy a search.
  296.         If the requested sort does not include score, then the filterCache
  297.         will be checked for a filter matching the query. If found, the filter
  298.         will be used as the source of document ids, and then the sort will be
  299.         applied to that.
  300.    <useFilterForSortedQuery>true</useFilterForSortedQuery>
  301.   -->
  302.  
  303.    <!-- An optimization for use with the queryResultCache.  When a search
  304.         is requested, a superset of the requested number of document ids
  305.         are collected.  For example, if a search for a particular query
  306.         requests matching documents 10 through 19, and queryWindowSize is 50,
  307.         then documents 0 through 49 will be collected and cached.  Any further
  308.         requests in that range can be satisfied via the cache.  -->
  309.     <queryResultWindowSize>50</queryResultWindowSize>
  310.  
  311.     <!-- Maximum number of documents to cache for any entry in the
  312.         queryResultCache. -->
  313.     <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
  314.  
  315.     <!-- This entry enables an int hash representation for filters (DocSets)
  316.         when the number of items in the set is less than maxSize.  For smaller
  317.         sets, this representation is more memory efficient, more efficient to
  318.         iterate over, and faster to take intersections.  -->
  319.     <HashDocSet maxSize="3000" loadFactor="0.75"/>
  320.  
  321.     <!-- a newSearcher event is fired whenever a new searcher is being prepared
  322.         and there is a current searcher handling requests (aka registered). -->
  323.     <!-- QuerySenderListener takes an array of NamedList and executes a
  324.         local query request for each NamedList in sequence. -->
  325.     <listener event="newSearcher" class="solr.QuerySenderListener">
  326.       <arr name="queries">
  327.         <lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  328.         <lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  329.         <lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst>
  330.       </arr>
  331.     </listener>
  332.  
  333.     <!-- a firstSearcher event is fired whenever a new searcher is being
  334.         prepared but there is no current registered searcher to handle
  335.         requests or to gain autowarming data from. -->
  336.     <listener event="firstSearcher" class="solr.QuerySenderListener">
  337.       <arr name="queries">
  338.         <lst> <str name="q">fast_warm</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  339.         <lst><str name="q">static firstSearcher warming query from solrconfig.xml</str></lst>
  340.       </arr>
  341.     </listener>
  342.  
  343.     <!-- If a search request comes in and there is no current registered searcher,
  344.         then immediately register the still warming searcher and use it.  If
  345.         "false" then all requests will block until the first searcher is done
  346.         warming. -->
  347.     <useColdSearcher>false</useColdSearcher>
  348.  
  349.     <!-- Maximum number of searchers that may be warming in the background
  350.      concurrently.  An error is returned if this limit is exceeded. Recommend
  351.      1-2 for read-only slaves, higher for masters w/o cache warming. -->
  352.     <maxWarmingSearchers>2</maxWarmingSearchers>
  353.  
  354.   </query>
  355.  
  356.   <!--
  357.    Let the dispatch filter handler /select?qt=XXX
  358.    handleSelect=true will use consistent error handling for /select and /update
  359.    handleSelect=false will use solr1.1 style error formatting
  360.    -->
  361.   <requestDispatcher handleSelect="true" >
  362.     <!--Make sure your system has some authentication before enabling remote streaming!  -->
  363.     <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
  364.  
  365.     <!-- Set HTTP caching related parameters (for proxy caches and clients).
  366.          
  367.         To get the behaviour of Solr 1.2 (ie: no caching related headers)
  368.         use the never304="true" option and do not specify a value for
  369.         <cacheControl>
  370.    -->
  371.     <!-- <httpCaching never304="true"> -->
  372.     <httpCaching lastModifiedFrom="openTime"
  373.                 etagSeed="Solr">
  374.        <!-- lastModFrom="openTime" is the default, the Last-Modified value
  375.            (and validation against If-Modified-Since requests) will all be
  376.            relative to when the current Searcher was opened.
  377.            You can change it to lastModFrom="dirLastMod" if you want the
  378.            value to exactly corrispond to when the physical index was last
  379.            modified.
  380.  
  381.            etagSeed="..." is an option you can change to force the ETag
  382.            header (and validation against If-None-Match requests) to be
  383.            differnet even if the index has not changed (ie: when making
  384.            significant changes to your config file)
  385.  
  386.            lastModifiedFrom and etagSeed are both ignored if you use the
  387.            never304="true" option.
  388.       -->
  389.        <!-- If you include a <cacheControl> directive, it will be used to
  390.            generate a Cache-Control header, as well as an Expires header
  391.            if the value contains "max-age="
  392.  
  393.            By default, no Cache-Control header is generated.
  394.  
  395.            You can use the <cacheControl> option even if you have set
  396.            never304="true"
  397.       -->
  398.        <!-- <cacheControl>max-age=30, public</cacheControl> -->
  399.     </httpCaching>
  400.   </requestDispatcher>
  401.  
  402.  
  403.   <!-- requestHandler plugins... incoming queries will be dispatched to the
  404.     correct handler based on the path or the qt (query type) param.
  405.     Names starting with a '/' are accessed with the a path equal to the
  406.     registered name.  Names without a leading '/' are accessed with:
  407.      http://host/app/select?qt=name
  408.     If no qt is defined, the requestHandler that declares default="true"
  409.     will be used.
  410.  -->
  411.   <requestHandler name="standard" class="solr.SearchHandler">
  412.     <!-- default values for query parameters -->
  413.      <lst name="defaults">
  414.        <str name="echoParams">explicit</str>
  415.        <bool name="omitHeader">true</bool>
  416.        <!--
  417.       <int name="rows">10</int>
  418.       <str name="fl">*</str>
  419.       <str name="version">2.1</str>
  420.        -->
  421.      </lst>
  422.   </requestHandler>
  423.  
  424. <!-- Please refer to http://wiki.apache.org/solr/SolrReplication for details on configuring replication -->
  425. <!-- MASTER_REPLICATION_START
  426. <requestHandler name="/replication" class="solr.ReplicationHandler" >
  427.    <lst name="master">
  428.        <str name="replicateAfter">commit</str>
  429.        <str name="replicateAfter">startup</str>
  430.        <str name="confFiles">schema.xml,mapping-ISOLatin1Accent.txt,protwords.txt,stopwords.txt,synonyms.txt,elevate.xml</str>
  431.    </lst>
  432. </requestHandler>
  433. MASTER_REPLICATION_END -->
  434.  
  435. <!-- SLAVE_REPLICATION_START
  436. <requestHandler name="/replication" class="solr.ReplicationHandler" >
  437.    <lst name="slave">
  438.        <str name="masterUrl">$MASTER_CORE_URL/replication</str>
  439.        <str name="pollInterval">$POLL_TIME</str>  
  440.     </lst>
  441. </requestHandler>
  442. SLAVE_REPLICATION_END -->
  443.  
  444.   <!-- DisMaxRequestHandler allows easy searching across multiple fields
  445.       for simple user-entered phrases.  It's implementation is now
  446.       just the standard SearchHandler with a default query type
  447.       of "dismax".
  448.       see http://wiki.apache.org/solr/DisMaxRequestHandler
  449.   -->
  450.   <requestHandler name="dismax" class="solr.SearchHandler">
  451.     <lst name="defaults">
  452.      <str name="defType">dismax</str>
  453.      <str name="echoParams">explicit</str>
  454.      <bool name="omitHeader">true</bool>
  455.     </lst>
  456.   </requestHandler>
  457.  
  458.   <!-- Note how you can register the same handler multiple times with
  459.       different names (and different init parameters)
  460.    -->
  461.   <requestHandler name="partitioned" class="solr.SearchHandler" default="true">
  462.     <lst name="defaults">
  463.      <str name="defType">dismax</str>
  464.      <str name="echoParams">explicit</str>
  465.      <bool name="omitHeader">true</bool>
  466.      <float name="tie">0.01</float>
  467.      <str name="qf">
  468.         body^40.0 title^5.0 name^3.0 taxonomy_names^2.0 tags_h1^5.0 tags_h2_h3^3.0 tags_h4_h5_h6^2.0 tags_inline^1.0
  469.      </str>
  470.      <str name="pf">
  471.         body^2.0
  472.      </str>
  473.      <int name="ps">15</int>
  474.      <!-- Abort any searches longer than 4 seconds -->
  475.      <!-- <int name="timeAllowed">4000</int>  -->
  476.      <str name="mm">
  477.         2&lt;-35%
  478.      </str>
  479.      <str name="q.alt">*:*</str>
  480.  
  481.    <!-- example highlighter config, enable per-query with hl=true -->
  482.      <str name="hl">true</str>
  483.      <str name="hl.fl">body</str>
  484.      <int name="hl.snippets">3</int>
  485.      <str name="hl.mergeContiguous">true</str>
  486.    <!-- instructs Solr to return the field itself if no query terms are
  487.        found -->
  488.      <str name="f.body.hl.alternateField">body</str>
  489.      <str name="f.body.hl.maxAlternateFieldLength">256</str>
  490.      <!-- JS: I wasn't getting good results here... I'm turning off for now
  491.     because I was getting periods (.) by themselves at the beginning of
  492.     snippets and don't feel like debugging anymore.  Without the regex is
  493.     faster too -->
  494.      <!--<str name="f.body.hl.fragmenter">regex</str>--> <!-- defined below -->
  495.  
  496.     <!-- By default, don't spell check -->
  497.       <str name="spellcheck">false</str>
  498.     <!-- Defaults for the spell checker when used -->
  499.       <str name="spellcheck.onlyMorePopular">true</str>
  500.       <str name="spellcheck.extendedResults">false</str>
  501.       <!--  The number of suggestions to return -->
  502.       <str name="spellcheck.count">1</str>
  503.     </lst>
  504.     <arr name="last-components">
  505.       <str>spellcheck</str>
  506.     </arr>
  507.   </requestHandler>
  508.  
  509.   <!-- The more like this handler offers many advantages over the standard handler,
  510.    when performing moreLikeThis requests.-->
  511.   <requestHandler name="mlt" class="solr.MoreLikeThisHandler">
  512.     <lst name="defaults">
  513.       <str name="mlt.mintf">1</str>
  514.       <str name="mlt.mindf">1</str>
  515.       <str name="mlt.minwl">3</str>
  516.       <str name="mlt.maxwl">15</str>
  517.       <str name="mlt.maxqt">20</str>
  518.       <str name="mlt.match.include">false</str>
  519.       <!-- Abort any searches longer than 1.5 seconds -->
  520.       <!-- <int name="timeAllowed">1500</int> -->
  521.     </lst>
  522.   </requestHandler>
  523.  
  524.  
  525.   <!--
  526.   Search components are registered to SolrCore and used by Search Handlers
  527.  
  528.   By default, the following components are avaliable:
  529.    
  530.   <searchComponent name="query"     class="org.apache.solr.handler.component.QueryComponent" />
  531.   <searchComponent name="facet"     class="org.apache.solr.handler.component.FacetComponent" />
  532.   <searchComponent name="mlt"       class="org.apache.solr.handler.component.MoreLikeThisComponent" />
  533.   <searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" />
  534.   <searchComponent name="stats"     class="org.apache.solr.handler.component.StatsComponent" />
  535.   <searchComponent name="debug"     class="org.apache.solr.handler.component.DebugComponent" />
  536.  
  537.   Default configuration in a requestHandler would look like:
  538.    <arr name="components">
  539.      <str>query</str>
  540.      <str>facet</str>
  541.      <str>mlt</str>
  542.      <str>highlight</str>
  543.      <str>stats</str>
  544.      <str>debug</str>
  545.    </arr>
  546.  
  547.    If you register a searchComponent to one of the standard names, that will be used instead.
  548.    To insert components before or after the 'standard' components, use:
  549.    
  550.    <arr name="first-components">
  551.      <str>myFirstComponentName</str>
  552.    </arr>
  553.    
  554.    <arr name="last-components">
  555.      <str>myLastComponentName</str>
  556.    </arr>
  557.  -->
  558.  
  559.    <!-- The spell check component can return a list of alternative spelling
  560.  suggestions.  -->
  561.   <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
  562.  
  563.     <str name="queryAnalyzerFieldType">textSpell</str>
  564.  
  565.     <lst name="spellchecker">
  566.       <str name="name">default</str>
  567.       <str name="field">spell</str>
  568.       <str name="spellcheckIndexDir">./spellchecker1</str>
  569.       <str name="buildOnOptimize">true</str>
  570.     </lst>
  571.     <lst name="spellchecker">
  572.       <str name="name">jarowinkler</str>
  573.       <str name="field">spell</str>
  574.       <!-- Use a different Distance Measure -->
  575.       <str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
  576.       <str name="spellcheckIndexDir">./spellchecker2</str>
  577.       <str name="buildOnOptimize">true</str>
  578.     </lst>
  579.  
  580.   </searchComponent>
  581.  
  582.   <queryConverter name="queryConverter" class="solr.SpellingQueryConverter"/>
  583.  
  584.   <!-- a search component that enables you to configure the top results for
  585.       a given query regardless of the normal lucene scoring.-->
  586.   <searchComponent name="elevator" class="solr.QueryElevationComponent" >
  587.     <!-- pick a fieldType to analyze queries -->
  588.     <str name="queryFieldType">string</str>
  589.     <str name="config-file">elevate.xml</str>
  590.   </searchComponent>
  591.  
  592.   <!-- a request handler utilizing the elevator component -->
  593.   <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
  594.     <lst name="defaults">
  595.       <str name="echoParams">explicit</str>
  596.     </lst>
  597.     <arr name="last-components">
  598.       <str>elevator</str>
  599.     </arr>
  600.   </requestHandler>
  601.  
  602.  
  603.   <!-- Update request handler.  
  604.  
  605.       Note: Since solr1.1 requestHandlers requires a valid content type header if posted in
  606.       the body. For example, curl now requires: -H 'Content-type:text/xml; charset=utf-8'
  607.       The response format differs from solr1.1 formatting and returns a standard error code.
  608.  
  609.       To enable solr1.1 behavior, remove the /update handler or change its path
  610.    -->
  611.   <requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
  612.  
  613.   <!--
  614.   Analysis request handler.  Since Solr 1.3.  Use to returnhow a document is analyzed.  Useful
  615.   for debugging and as a token server for other types of applications
  616.   -->
  617.   <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
  618.  
  619.  
  620.   <!-- CSV update handler, loaded on demand -->
  621.   <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
  622.  
  623.  
  624.   <!--
  625.   Admin Handlers - This will register all the standard admin RequestHandlers.  Adding
  626.   this single handler is equivalent to registering:
  627.  
  628.  <requestHandler name="/admin/luke"       class="org.apache.solr.handler.admin.LukeRequestHandler" />
  629.  <requestHandler name="/admin/system"     class="org.apache.solr.handler.admin.SystemInfoHandler" />
  630.  <requestHandler name="/admin/plugins"    class="org.apache.solr.handler.admin.PluginInfoHandler" />
  631.  <requestHandler name="/admin/threads"    class="org.apache.solr.handler.admin.ThreadDumpHandler" />
  632.  <requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" />
  633.  <requestHandler name="/admin/file"       class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
  634.  
  635.  If you wish to hide files under ${solr.home}/conf, explicitly register the ShowFileRequestHandler using:
  636.  <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
  637.    <lst name="invariants">
  638.     <str name="hidden">synonyms.txt</str>
  639.     <str name="hidden">anotherfile.txt</str>
  640.    </lst>
  641.  </requestHandler>
  642.  -->
  643.   <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
  644.  
  645.   <!-- ping/healthcheck -->
  646.   <requestHandler name="/admin/ping" class="PingRequestHandler">
  647.     <lst name="defaults">
  648.       <str name="qt">standard</str>
  649.       <str name="q">solrpingquery</str>
  650.       <str name="echoParams">all</str>
  651.     </lst>
  652.   </requestHandler>
  653.  
  654.   <!-- Echo the request contents back to the client -->
  655.   <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
  656.     <lst name="defaults">
  657.      <str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' -->
  658.      <str name="echoHandler">true</str>
  659.     </lst>
  660.   </requestHandler>
  661.  
  662.   <highlighting>
  663.    <!-- Configure the standard fragmenter -->
  664.    <!-- This could most likely be commented out in the "default" case -->
  665.    <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
  666.     <lst name="defaults">
  667.      <int name="hl.fragsize">100</int>
  668.     </lst>
  669.    </fragmenter>
  670.  
  671.    <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
  672.    <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
  673.     <lst name="defaults">
  674.       <!-- slightly smaller fragsizes work better because of slop -->
  675.       <int name="hl.fragsize">70</int>
  676.       <!-- allow 50% slop on fragment sizes -->
  677.       <float name="hl.regex.slop">0.5</float>
  678.       <!-- a basic sentence pattern -->
  679.       <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
  680.     </lst>
  681.    </fragmenter>
  682.  
  683.    <!-- Configure the standard formatter -->
  684.    <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
  685.     <lst name="defaults">
  686.      <str name="hl.simple.pre"><![CDATA[<strong>]]></str>
  687.      <str name="hl.simple.post"><![CDATA[</strong>]]></str>
  688.     </lst>
  689.    </formatter>
  690.   </highlighting>
  691.  
  692.  
  693.   <!-- queryResponseWriter plugins... query responses will be written using the
  694.    writer specified by the 'wt' request parameter matching the name of a registered
  695.    writer.
  696.    The "default" writer is the default and will be used if 'wt' is not specified
  697.    in the request. XMLResponseWriter will be used if nothing is specified here.
  698.    The json, python, and ruby writers are also available by default.
  699.  
  700.    <queryResponseWriter name="xml" class="org.apache.solr.request.XMLResponseWriter" default="true"/>
  701.    <queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
  702.    <queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
  703.    <queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
  704.    <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
  705.    <queryResponseWriter name="phps" class="org.apache.solr.request.PHPSerializedResponseWriter"/>
  706.  
  707.    <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
  708.  -->
  709.  
  710.   <!-- XSLT response writer transforms the XML output by any xslt file found
  711.       in Solr's conf/xslt directory.  Changes to xslt files are checked for
  712.       every xsltCacheLifetimeSeconds.  
  713.   -->
  714.   <queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
  715.     <int name="xsltCacheLifetimeSeconds">5</int>
  716.   </queryResponseWriter>
  717.  
  718.  
  719.   <!-- example of registering a query parser
  720.  <queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
  721.  -->
  722.  
  723.   <!-- example of registering a custom function parser
  724.  <valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" />
  725.  -->
  726.  
  727.   <!-- config for the admin interface -->
  728.   <admin>
  729.     <defaultQuery>solr</defaultQuery>
  730.  
  731.     <gettableFiles>
  732.          solrconfig.xml
  733.          schema.xml
  734.          elevate.xml
  735.          mapping-ISOLatin1Accent.txt
  736.          protwords.txt
  737.          stopwords.txt
  738.          synonyms.txt
  739.     </gettableFiles>  
  740.  
  741.     <!-- configure a healthcheck file for servers behind a loadbalancer
  742.    <healthcheck type="file">server-enabled</healthcheck>
  743.    -->
  744.   </admin>
  745.  
  746. </config>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement