Advertisement
Guest User

solrconfig.xml

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