Advertisement
Guest User

solrconfig.xml

a guest
Jan 7th, 2014
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 40.29 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2.  
  3. <config>
  4.  
  5.   <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
  6.  
  7.     <luceneMatchVersion>4.4</luceneMatchVersion>
  8.    
  9.     <lib dir="../../contrib/extraction/lib" regex=".*\.jar" />
  10.     <lib dir="../../dist/" regex="solr-cell-\d.*\.jar" />
  11.    
  12.     <lib dir="../../contrib/clustering/lib/" regex=".*\.jar" />
  13.     <lib dir="../../dist/" regex="solr-clustering-\d.*\.jar" />
  14.    
  15.     <lib dir="../../contrib/langid/lib/" regex=".*\.jar" />
  16.     <lib dir="../../dist/" regex="solr-langid-\d.*\.jar" />
  17.    
  18.     <lib dir="../../contrib/velocity/lib" regex=".*\.jar" />
  19.     <lib dir="../../dist/" regex="solr-velocity-\d.*\.jar" />
  20.    
  21.    
  22.  
  23.  
  24.   <!-- Used to specify an alternate directory to hold all index data
  25.       other than the default ./data under the Solr home.
  26.       If replication is in use, this should match the replication configuration. -->
  27.   <dataDir>${solr.data.dir:}</dataDir>
  28.  
  29.   <directoryFactory name="DirectoryFactory"
  30.                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
  31.  
  32.  
  33.    <indexConfig>
  34.     <!-- options specific to the main on-disk lucene index -->
  35.     <useCompoundFile>false</useCompoundFile>
  36.     <ramBufferSizeMB>128</ramBufferSizeMB>
  37.     <mergeFactor>10</mergeFactor>
  38.     <!-- Deprecated -->
  39.     <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
  40.     <!--<maxMergeDocs>2147483647</maxMergeDocs>-->
  41.  
  42.     <!-- inherit from indexDefaults <maxFieldLength>10000</maxFieldLength> -->
  43.  
  44.     <!-- If true, unlock any held write or commit locks on startup.
  45.         This defeats the locking mechanism that allows multiple
  46.         processes to safely access a lucene index, and should be
  47.         used with care.
  48.         This is not needed if lock type is 'none' or 'single'
  49.     -->
  50.     <unlockOnStartup>false</unlockOnStartup>
  51.    
  52.     <!-- If true, IndexReaders will be reopened (often more efficient) instead
  53.         of closed and then opened.  -->
  54.     <reopenReaders>true</reopenReaders>
  55.  
  56.     <!--
  57.     Expert:
  58.    Controls how often Lucene loads terms into memory.  Default is 128 and is likely good for most everyone. -->
  59.     <!--<termIndexInterval>256</termIndexInterval>-->
  60.  
  61.     <!--
  62.        Custom deletion policies can specified here. The class must
  63.        implement org.apache.lucene.index.IndexDeletionPolicy.
  64.  
  65.        http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/index/IndexDeletionPolicy.html
  66.  
  67.        The standard Solr IndexDeletionPolicy implementation supports deleting
  68.        index commit points on number of commits, age of commit point and
  69.        optimized status.
  70.  
  71.        The latest commit point should always be preserved regardless
  72.        of the criteria.
  73.    -->
  74.     <deletionPolicy class="solr.SolrDeletionPolicy">
  75.       <!-- The number of commit points to be kept -->
  76.       <str name="maxCommitsToKeep">1</str>
  77.       <!-- The number of optimized commit points to be kept -->
  78.       <str name="maxOptimizedCommitsToKeep">0</str>
  79.       <!--
  80.          Delete all commit points once they have reached the given age.
  81.          Supports DateMathParser syntax e.g.
  82.          
  83.          <str name="maxCommitAge">30MINUTES</str>
  84.          <str name="maxCommitAge">1DAY</str>
  85.      -->
  86.     </deletionPolicy>
  87.  
  88.     <!--  To aid in advanced debugging, you may turn on IndexWriter debug logging.
  89.      Setting to true will set the file that the underlying Lucene IndexWriter
  90.      will write its debug infostream to.  -->
  91.      <infoStream file="INFOSTREAM.txt">false</infoStream>
  92.  
  93.   </indexConfig>
  94.  
  95.   <!--  Enables JMX if and only if an existing MBeanServer is found, use this
  96.    if you want to configure JMX through JVM parameters. Remove this to disable
  97.    exposing Solr configuration and statistics to JMX.
  98.  
  99.         If you want to connect to a particular server, specify the agentId
  100.         e.g. <jmx agentId="myAgent" />
  101.  
  102.         If you want to start a new MBeanServer, specify the serviceUrl
  103.         e.g <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
  104.  
  105.         For more details see http://wiki.apache.org/solr/SolrJmx
  106.  -->
  107.   <jmx />
  108.  
  109.   <!-- the default high-performance update handler -->
  110.   <updateHandler class="solr.DirectUpdateHandler2">
  111.    
  112.     <updateLog>
  113.       <str name="dir">${solr.ulog.dir:}</str>
  114.     </updateLog>
  115.  
  116.     <!-- A prefix of "solr." for class names is an alias that
  117.         causes solr to search appropriate packages, including
  118.         org.apache.solr.(search|update|request|core|analysis)
  119.     -->
  120.  
  121.     <!-- Perform a <commit/> automatically under certain conditions:
  122.         maxDocs - number of updates since last commit is greater than this
  123.         maxTime - oldest uncommited update (in ms) is this long ago
  124.         Instead of enabling autoCommit, consider using "commitWithin"
  125.         when adding documents. http://wiki.apache.org/solr/UpdateXmlMessages
  126.     -->
  127.     <autoCommit>
  128.       <maxDocs>10000</maxDocs>
  129.       <maxTime>10000</maxTime>
  130.     </autoCommit>
  131.    
  132.  
  133.  
  134.     <!-- The RunExecutableListener executes an external command from a
  135.      hook such as postCommit or postOptimize.
  136.         exe - the name of the executable to run
  137.         dir - dir to use as the current working directory. default="."
  138.         wait - the calling thread waits until the executable returns. default="true"
  139.         args - the arguments to pass to the program.  default=nothing
  140.         env - environment variables to set.  default=nothing
  141.      -->
  142.     <!-- A postCommit event is fired after every commit or optimize command
  143.    <listener event="postCommit" class="solr.RunExecutableListener">
  144.      <str name="exe">solr/bin/snapshooter</str>
  145.      <str name="dir">.</str>
  146.      <bool name="wait">true</bool>
  147.      <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
  148.      <arr name="env"> <str>MYVAR=val1</str> </arr>
  149.    </listener>
  150.    -->
  151.     <!-- A postOptimize event is fired only after every optimize command
  152.    <listener event="postOptimize" class="solr.RunExecutableListener">
  153.      <str name="exe">snapshooter</str>
  154.      <str name="dir">solr/bin</str>
  155.      <bool name="wait">true</bool>
  156.    </listener>
  157.    -->
  158.  
  159.   </updateHandler>
  160.  
  161.   <!-- Use the following format to specify a custom IndexReaderFactory - allows for alternate
  162.       IndexReader implementations.
  163.  
  164.       ** Experimental Feature **
  165.       Please note - Using a custom IndexReaderFactory may prevent certain other features
  166.       from working. The API to IndexReaderFactory may change without warning or may even
  167.       be removed from future releases if the problems cannot be resolved.
  168.  
  169.       ** Features that may not work with custom IndexReaderFactory **
  170.       The ReplicationHandler assumes a disk-resident index. Using a custom
  171.       IndexReader implementation may cause incompatibility with ReplicationHandler and
  172.       may cause replication to not work correctly. See SOLR-1366 for details.
  173.  
  174.  <indexReaderFactory name="IndexReaderFactory" class="package.class">
  175.    Parameters as required by the implementation
  176.  </indexReaderFactory >
  177.  -->
  178.   <!-- To set the termInfosIndexDivisor, do this: -->
  179.   <!--<indexReaderFactory name="IndexReaderFactory" class="org.apache.solr.core.StandardIndexReaderFactory">
  180.    <int name="termInfosIndexDivisor">12</int>
  181.  </indexReaderFactory >-->
  182.  
  183.  
  184.   <query>
  185.     <!-- Maximum number of clauses in a boolean query... in the past, this affected
  186.        range or prefix queries that expanded to big boolean queries - built in Solr
  187.        query parsers no longer create queries with this limitation.
  188.        An exception is thrown if exceeded.  -->
  189.     <maxBooleanClauses>1024</maxBooleanClauses>
  190.  
  191.  
  192.     <!-- There are two implementations of cache available for Solr,
  193.         LRUCache, based on a synchronized LinkedHashMap, and
  194.         FastLRUCache, based on a ConcurrentHashMap.  FastLRUCache has faster gets
  195.         and slower puts in single threaded operation and thus is generally faster
  196.         than LRUCache when the hit ratio of the cache is high (> 75%), and may be
  197.         faster under other scenarios on multi-cpu systems. -->
  198.     <!-- Cache used by SolrIndexSearcher for filters (DocSets),
  199.         unordered sets of *all* documents that match a query.
  200.         When a new searcher is opened, its caches may be prepopulated
  201.         or "autowarmed" using data from caches in the old searcher.
  202.         autowarmCount is the number of items to prepopulate.  For LRUCache,
  203.         the autowarmed items will be the most recently accessed items.
  204.       Parameters:
  205.         class - the SolrCache implementation LRUCache or FastLRUCache
  206.         size - the maximum number of entries in the cache
  207.         initialSize - the initial capacity (number of entries) of
  208.           the cache.  (seel java.util.HashMap)
  209.         autowarmCount - the number of entries to prepopulate from
  210.           and old cache.
  211.         -->
  212.     <filterCache
  213.      class="solr.FastLRUCache"
  214.      size="512"
  215.      initialSize="512"
  216.      autowarmCount="0"/>
  217.  
  218.     <!-- Cache used to hold field values that are quickly accessible
  219.         by document id.  The fieldValueCache is created by default
  220.         even if not configured here.
  221.      <fieldValueCache
  222.        class="solr.FastLRUCache"
  223.        size="512"
  224.        autowarmCount="128"
  225.        showItems="32"
  226.      />
  227.    -->
  228.  
  229.    <!-- queryResultCache caches results of searches - ordered lists of
  230.         document ids (DocList) based on a query, a sort, and the range
  231.         of documents requested.  -->
  232.     <queryResultCache
  233.      class="solr.LRUCache"
  234.      size="512"
  235.      initialSize="512"
  236.      autowarmCount="0"/>
  237.  
  238.   <!-- documentCache caches Lucene Document objects (the stored fields for each document).
  239.       Since Lucene internal document ids are transient, this cache will not be autowarmed.  -->
  240.     <documentCache
  241.      class="solr.LRUCache"
  242.      size="512"
  243.      initialSize="512"
  244.      autowarmCount="0"/>
  245.  
  246.     <!-- If true, stored fields that are not requested will be loaded lazily.
  247.      This can result in a significant speed improvement if the usual case is to
  248.      not load all stored fields, especially if the skipped fields are large
  249.      compressed text fields.
  250.    -->
  251.     <enableLazyFieldLoading>true</enableLazyFieldLoading>
  252.  
  253.     <!-- Example of a generic cache.  These caches may be accessed by name
  254.         through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
  255.         The purpose is to enable easy caching of user/application level data.
  256.         The regenerator argument should be specified as an implementation
  257.         of solr.search.CacheRegenerator if autowarming is desired.  -->
  258.     <!--
  259.    <cache name="myUserCache"
  260.      class="solr.LRUCache"
  261.      size="4096"
  262.      initialSize="1024"
  263.      autowarmCount="1024"
  264.      regenerator="org.mycompany.mypackage.MyRegenerator"
  265.      />
  266.    -->
  267.  
  268.    <!-- An optimization that attempts to use a filter to satisfy a search.
  269.         If the requested sort does not include score, then the filterCache
  270.         will be checked for a filter matching the query. If found, the filter
  271.         will be used as the source of document ids, and then the sort will be
  272.         applied to that.
  273.    <useFilterForSortedQuery>true</useFilterForSortedQuery>
  274.   -->
  275. <useFilterForSortedQuery>true</useFilterForSortedQuery>
  276.    <!-- An optimization for use with the queryResultCache.  When a search
  277.         is requested, a superset of the requested number of document ids
  278.         are collected.  For example, if a search for a particular query
  279.         requests matching documents 10 through 19, and queryWindowSize is 50,
  280.         then documents 0 through 49 will be collected and cached.  Any further
  281.         requests in that range can be satisfied via the cache.  -->
  282.     <queryResultWindowSize>20</queryResultWindowSize>
  283.  
  284.     <!-- Maximum number of documents to cache for any entry in the
  285.         queryResultCache. -->
  286.     <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
  287.  
  288.     <!-- a newSearcher event is fired whenever a new searcher is being prepared
  289.      and there is a current searcher handling requests (aka registered).
  290.      It can be used to prime certain caches to prevent long request times for
  291.      certain requests.
  292.    -->
  293.     <!-- QuerySenderListener takes an array of NamedList and executes a
  294.         local query request for each NamedList in sequence. -->
  295.     <listener event="newSearcher" class="solr.QuerySenderListener">
  296.       <arr name="queries">
  297.         <!--
  298.        <lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  299.        <lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  300.        <lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst>
  301.        -->
  302.       </arr>
  303.     </listener>
  304.  
  305.     <!-- a firstSearcher event is fired whenever a new searcher is being
  306.         prepared but there is no current registered searcher to handle
  307.         requests or to gain autowarming data from. -->
  308.     <listener event="firstSearcher" class="solr.QuerySenderListener">
  309.       <arr name="queries">
  310.         <lst> <str name="q">solr rocks</str><str name="start">0</str><str name="rows">10</str></lst>
  311.         <lst><str name="q">static firstSearcher warming query from solrconfig.xml</str></lst>
  312.       </arr>
  313.     </listener>
  314.  
  315.     <!-- If a search request comes in and there is no current registered searcher,
  316.         then immediately register the still warming searcher and use it.  If
  317.         "false" then all requests will block until the first searcher is done
  318.         warming. -->
  319.     <useColdSearcher>false</useColdSearcher>
  320.  
  321.     <!-- Maximum number of searchers that may be warming in the background
  322.      concurrently.  An error is returned if this limit is exceeded. Recommend
  323.      1-2 for read-only slaves, higher for masters w/o cache warming. -->
  324.     <maxWarmingSearchers>2</maxWarmingSearchers>
  325.  
  326.   </query>
  327.    
  328.   <!--
  329.    Let the dispatch filter handler /select?qt=XXX
  330.    handleSelect=true will use consistent error handling for /select and /update
  331.    handleSelect=false will use solr1.1 style error formatting
  332.    -->
  333.   <requestDispatcher handleSelect="true" >
  334.     <!--Make sure your system has some authentication before enabling remote streaming!  -->
  335.     <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000" />
  336.  
  337.     <!-- Set HTTP caching related parameters (for proxy caches and clients).
  338.          
  339.         To get the behaviour of Solr 1.2 (ie: no caching related headers)
  340.         use the never304="true" option and do not specify a value for
  341.         <cacheControl>
  342.    -->
  343.     <!-- <httpCaching never304="true"> -->
  344.     <httpCaching lastModifiedFrom="openTime"
  345.                 etagSeed="Solr">
  346.        <!-- lastModFrom="openTime" is the default, the Last-Modified value
  347.            (and validation against If-Modified-Since requests) will all be
  348.            relative to when the current Searcher was opened.
  349.            You can change it to lastModFrom="dirLastMod" if you want the
  350.            value to exactly corrispond to when the physical index was last
  351.            modified.
  352.  
  353.            etagSeed="..." is an option you can change to force the ETag
  354.            header (and validation against If-None-Match requests) to be
  355.            differnet even if the index has not changed (ie: when making
  356.            significant changes to your config file)
  357.  
  358.            lastModifiedFrom and etagSeed are both ignored if you use the
  359.            never304="true" option.
  360.       -->
  361.        <!-- If you include a <cacheControl> directive, it will be used to
  362.            generate a Cache-Control header, as well as an Expires header
  363.            if the value contains "max-age="
  364.  
  365.            By default, no Cache-Control header is generated.
  366.  
  367.            You can use the <cacheControl> option even if you have set
  368.            never304="true"
  369.       -->
  370.        <!-- <cacheControl>max-age=30, public</cacheControl> -->
  371.     </httpCaching>
  372.   </requestDispatcher>
  373.  
  374.  
  375.   <!-- requestHandler plugins... incoming queries will be dispatched to the
  376.     correct handler based on the path or the qt (query type) param.
  377.     Names starting with a '/' are accessed with the a path equal to the
  378.     registered name.  Names without a leading '/' are accessed with:
  379.      http://host/app/select?qt=name
  380.     If no qt is defined, the requestHandler that declares default="true"
  381.     will be used.
  382.  -->
  383.   <requestHandler name="standard" class="solr.SearchHandler" default="true">
  384.     <!-- default values for query parameters -->
  385.      <lst name="defaults">
  386.        <str name="echoParams">explicit</str>
  387.        <!--
  388.       <int name="rows">10</int>
  389.       <str name="fl">*</str>
  390.       <str name="version">2.1</str>
  391.        -->
  392.      </lst>
  393.      <arr name="last-components">
  394.       <str>spellcheck</str>
  395.     </arr>
  396.   </requestHandler>
  397.  
  398. <!-- Please refer to http://wiki.apache.org/solr/SolrReplication for details on configuring replication -->
  399. <!-- remove the <lst name="master"> section if this is just a slave -->
  400. <!-- remove  the <lst name="slave"> section if this is just a master -->
  401. <!--
  402. <requestHandler name="/replication" class="solr.ReplicationHandler" >
  403.    <lst name="master">
  404.      <str name="replicateAfter">commit</str>
  405.      <str name="replicateAfter">startup</str>
  406.      <str name="confFiles">schema.xml,stopwords.txt</str>
  407.    </lst>
  408.    <lst name="slave">
  409.      <str name="masterUrl">http://localhost:8983/solr/replication</str>
  410.      <str name="pollInterval">00:00:60</str>
  411.    </lst>
  412. </requestHandler>-->
  413.  
  414.   <!-- DisMaxRequestHandler allows easy searching across multiple fields
  415.       for simple user-entered phrases.  It's implementation is now
  416.       just the standard SearchHandler with a default query type
  417.       of "dismax".
  418.       see http://wiki.apache.org/solr/DisMaxRequestHandler
  419.   -->
  420.   <requestHandler name="dismax" class="solr.SearchHandler" >
  421.     <lst name="defaults">
  422.      <str name="defType">dismax</str>
  423.      <str name="echoParams">explicit</str>
  424.      <float name="tie">0.01</float>
  425.      <str name="qf">
  426.         text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
  427.      </str>
  428.      <str name="pf">
  429.         text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9
  430.      </str>
  431.      <str name="bf">
  432.         popularity^0.5 recip(price,1,1000,1000)^0.3
  433.      </str>
  434.      <str name="fl">
  435.         id,name,price,score
  436.      </str>
  437.      <str name="mm">
  438.         2&lt;-1 5&lt;-2 6&lt;90%
  439.      </str>
  440.      <int name="ps">100</int>
  441.      <str name="q.alt">*:*</str>
  442.      <!-- example highlighter config, enable per-query with hl=true -->
  443.      <str name="hl.fl">text features name</str>
  444.      <!-- for this field, we want no fragmenting, just highlighting -->
  445.      <str name="f.name.hl.fragsize">0</str>
  446.      <!-- instructs Solr to return the field itself if no query terms are
  447.          found -->
  448.      <str name="f.name.hl.alternateField">name</str>
  449.      <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
  450.     </lst>
  451.   </requestHandler>
  452.  
  453.   <!-- Note how you can register the same handler multiple times with
  454.       different names (and different init parameters)
  455.    -->
  456.   <requestHandler name="partitioned" class="solr.SearchHandler" >
  457.     <lst name="defaults">
  458.      <str name="defType">dismax</str>
  459.      <str name="echoParams">explicit</str>
  460.      <str name="qf">text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0</str>
  461.      <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
  462.      <!-- This is an example of using Date Math to specify a constantly
  463.          moving date range in a config...
  464.       -->
  465.      <str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str>
  466.     </lst>
  467.     <!-- In addition to defaults, "appends" params can be specified
  468.         to identify values which should be appended to the list of
  469.         multi-val params from the query (or the existing "defaults").
  470.  
  471.         In this example, the param "fq=instock:true" will be appended to
  472.         any query time fq params the user may specify, as a mechanism for
  473.         partitioning the index, independent of any user selected filtering
  474.         that may also be desired (perhaps as a result of faceted searching).
  475.  
  476.         NOTE: there is *absolutely* nothing a client can do to prevent these
  477.         "appends" values from being used, so don't use this mechanism
  478.         unless you are sure you always want it.
  479.      -->
  480.     <lst name="appends">
  481.       <str name="fq">inStock:true</str>
  482.     </lst>
  483.     <!-- "invariants" are a way of letting the Solr maintainer lock down
  484.         the options available to Solr clients.  Any params values
  485.         specified here are used regardless of what values may be specified
  486.         in either the query, the "defaults", or the "appends" params.
  487.  
  488.         In this example, the facet.field and facet.query params are fixed,
  489.         limiting the facets clients can use.  Faceting is not turned on by
  490.         default - but if the client does specify facet=true in the request,
  491.         these are the only facets they will be able to see counts for;
  492.         regardless of what other facet.field or facet.query params they
  493.         may specify.
  494.  
  495.         NOTE: there is *absolutely* nothing a client can do to prevent these
  496.         "invariants" values from being used, so don't use this mechanism
  497.         unless you are sure you always want it.
  498.      -->
  499.     <lst name="invariants">
  500.       <str name="facet.field">cat</str>
  501.       <str name="facet.field">manu_exact</str>
  502.       <str name="facet.query">price:[* TO 500]</str>
  503.       <str name="facet.query">price:[500 TO *]</str>
  504.     </lst>
  505.   </requestHandler>
  506.  
  507.  
  508.   <!--
  509.   Search components are registered to SolrCore and used by Search Handlers
  510.  
  511.   By default, the following components are avaliable:
  512.    
  513.   <searchComponent name="query"     class="org.apache.solr.handler.component.QueryComponent" />
  514.   <searchComponent name="facet"     class="org.apache.solr.handler.component.FacetComponent" />
  515.   <searchComponent name="mlt"       class="org.apache.solr.handler.component.MoreLikeThisComponent" />
  516.   <searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" />
  517.   <searchComponent name="stats"     class="org.apache.solr.handler.component.StatsComponent" />
  518.   <searchComponent name="debug"     class="org.apache.solr.handler.component.DebugComponent" />
  519.  
  520.   Default configuration in a requestHandler would look like:
  521.    <arr name="components">
  522.      <str>query</str>
  523.      <str>facet</str>
  524.      <str>mlt</str>
  525.      <str>highlight</str>
  526.      <str>stats</str>
  527.      <str>debug</str>
  528.    </arr>
  529.  
  530.    If you register a searchComponent to one of the standard names, that will be used instead.
  531.    To insert components before or after the 'standard' components, use:
  532.    
  533.    <arr name="first-components">
  534.      <str>myFirstComponentName</str>
  535.    </arr>
  536.    
  537.    <arr name="last-components">
  538.      <str>myLastComponentName</str>
  539.    </arr>
  540.  -->
  541.  
  542.    <!-- The spell check component can return a list of alternative spelling
  543.  suggestions.  -->
  544.   <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
  545.  
  546.     <str name="queryAnalyzerFieldType">textSpell</str>
  547.  
  548.     <lst name="spellchecker">
  549.       <str name="name">default</str>
  550.       <str name="field">textSpell</str>
  551.       <str name="spellcheckIndexDir">./spellchecker</str>
  552.       <str name="buildOnCommit">true</str>
  553.     </lst>
  554.  
  555.     <!-- a spellchecker that uses a different distance measure
  556.    <lst name="spellchecker">
  557.      <str name="name">jarowinkler</str>
  558.      <str name="field">spell</str>
  559.      <str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
  560.      <str name="spellcheckIndexDir">./spellchecker2</str>
  561.    </lst>
  562.     -->
  563.  
  564.     <!-- a file based spell checker
  565.    <lst name="spellchecker">
  566.      <str name="classname">solr.FileBasedSpellChecker</str>
  567.      <str name="name">file</str>
  568.      <str name="sourceLocation">spellings.txt</str>
  569.      <str name="characterEncoding">UTF-8</str>
  570.      <str name="spellcheckIndexDir">./spellcheckerFile</str>
  571.    </lst>
  572.    -->
  573.   </searchComponent>
  574.  
  575.   <!-- A request handler utilizing the spellcheck component.  
  576.  #############################################################################
  577.  NOTE: This is purely as an example.  The whole purpose of the
  578.  SpellCheckComponent is to hook it into the request handler that handles (i.e.
  579.  the standard or dismax SearchHandler) queries such that a separate request is
  580.  not needed to get suggestions.
  581.  
  582.  IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS NOT WHAT YOU
  583.  WANT FOR YOUR PRODUCTION SYSTEM!
  584.  #############################################################################
  585.  -->
  586.   <requestHandler name="/spell" class="solr.SearchHandler" lazy="true">
  587.     <lst name="defaults">
  588.       <!-- omp = Only More Popular -->
  589.       <str name="spellcheck.onlyMorePopular">false</str>
  590.       <!-- exr = Extended Results -->
  591.       <str name="spellcheck.extendedResults">false</str>
  592.       <!--  The number of suggestions to return -->
  593.       <str name="spellcheck.count">1</str>
  594.     </lst>
  595.     <arr name="last-components">
  596.       <str>spellcheck</str>
  597.     </arr>
  598.   </requestHandler>
  599.  
  600.   <searchComponent name="tvComponent" class="org.apache.solr.handler.component.TermVectorComponent"/>
  601.   <!-- A Req Handler for working with the tvComponent.  This is purely as an example.
  602.  You will likely want to add the component to your already specified request handlers. -->
  603.   <requestHandler name="tvrh" class="org.apache.solr.handler.component.SearchHandler">
  604.     <lst name="defaults">
  605.       <bool name="tv">true</bool>
  606.     </lst>
  607.     <arr name="last-components">
  608.       <str>tvComponent</str>
  609.     </arr>
  610.   </requestHandler>
  611.  
  612.   <!-- Clustering Component
  613.       http://wiki.apache.org/solr/ClusteringComponent
  614.       This relies on third party jars which are not included in the release.
  615.       To use this component (and the "/clustering" handler)
  616.       Those jars will need to be downloaded, and you'll need to set the
  617.       solr.cluster.enabled system property when running solr...
  618.          java -Dsolr.clustering.enabled=true -jar start.jar
  619.    -->
  620.   <searchComponent
  621.    name="clusteringComponent"
  622.    enable="${solr.clustering.enabled:false}"
  623.    class="org.apache.solr.handler.clustering.ClusteringComponent" >
  624.     <!-- Declare an engine -->
  625.     <lst name="engine">
  626.       <!-- The name, only one can be named "default" -->
  627.       <str name="name">default</str>
  628.       <!--
  629.           Class name of Carrot2 clustering algorithm. Currently available algorithms are:
  630.          
  631.           * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
  632.           * org.carrot2.clustering.stc.STCClusteringAlgorithm
  633.          
  634.           See http://project.carrot2.org/algorithms.html for the algorithm's characteristics.
  635.        -->
  636.       <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
  637.       <!--
  638.           Overriding values for Carrot2 default algorithm attributes. For a description
  639.           of all available attributes, see: http://download.carrot2.org/stable/manual/#chapter.components.
  640.           Use attribute key as name attribute of str elements below. These can be further
  641.           overridden for individual requests by specifying attribute key as request
  642.           parameter name and attribute value as parameter value.
  643.        -->
  644.       <str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
  645.     </lst>
  646.     <lst name="engine">
  647.       <str name="name">stc</str>
  648.       <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
  649.     </lst>
  650.   </searchComponent>
  651.   <requestHandler name="/clustering"
  652.                  enable="${solr.clustering.enabled:false}"
  653.                  class="solr.SearchHandler">
  654.      <lst name="defaults">
  655.        <bool name="clustering">true</bool>
  656.        <str name="clustering.engine">default</str>
  657.        <bool name="clustering.results">true</bool>
  658.        <!-- The title field -->
  659.        <str name="carrot.title">name</str>
  660.        <str name="carrot.url">id</str>
  661.        <!-- The field to cluster on -->
  662.        <str name="carrot.snippet">features</str>
  663.        <!-- produce summaries -->
  664.        <bool name="carrot.produceSummary">true</bool>
  665.        <!-- the maximum number of labels per cluster -->
  666.        <!--<int name="carrot.numDescriptions">5</int>-->
  667.        <!-- produce sub clusters -->
  668.        <bool name="carrot.outputSubClusters">false</bool>
  669.     </lst>    
  670.     <arr name="last-components">
  671.       <str>clusteringComponent</str>
  672.     </arr>
  673.   </requestHandler>
  674.  
  675.   <!-- Solr Cell: http://wiki.apache.org/solr/ExtractingRequestHandler -->
  676.   <requestHandler name="/update/extract" class="org.apache.solr.handler.extraction.ExtractingRequestHandler" startup="lazy">
  677.     <lst name="defaults">
  678.       <!-- All the main content goes into "text"... if you need to return
  679.           the extracted text or do highlighting, use a stored field. -->
  680.       <str name="fmap.content">text</str>
  681.       <str name="lowernames">true</str>
  682.       <str name="uprefix">ignored_</str>
  683.  
  684.       <!-- capture link hrefs but ignore div attributes -->
  685.       <str name="captureAttr">true</str>
  686.       <str name="fmap.a">links</str>
  687.       <str name="fmap.div">ignored_</str>
  688.     </lst>
  689.   </requestHandler>
  690.  
  691.  
  692.   <!-- A component to return terms and document frequency of those terms.
  693.       This component does not yet support distributed search. -->
  694.   <searchComponent name="termsComponent" class="org.apache.solr.handler.component.TermsComponent"/>
  695.  
  696.   <requestHandler name="/terms" class="org.apache.solr.handler.component.SearchHandler">
  697.      <lst name="defaults">
  698.       <bool name="terms">true</bool>
  699.     </lst>    
  700.     <arr name="components">
  701.       <str>termsComponent</str>
  702.     </arr>
  703.   </requestHandler>
  704.  
  705.   <!-- JSON Update Request Handler
  706.       http://wiki.apache.org/solr/UpdateJSON
  707.    -->
  708.   <requestHandler name="/update/json"
  709.                  class="solr.JsonUpdateRequestHandler"
  710.                  startup="lazy" />
  711.  
  712.  
  713.   <!-- a search component that enables you to configure the top results for
  714.       a given query regardless of the normal lucene scoring.-->
  715.   <searchComponent name="elevator" class="solr.QueryElevationComponent" >
  716.     <!-- pick a fieldType to analyze queries -->
  717.     <str name="queryFieldType">string</str>
  718.     <str name="config-file">elevate.xml</str>
  719.   </searchComponent>
  720.  
  721.   <!-- a request handler utilizing the elevator component -->
  722.   <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
  723.     <lst name="defaults">
  724.       <str name="echoParams">explicit</str>
  725.     </lst>
  726.     <arr name="last-components">
  727.       <str>elevator</str>
  728.     </arr>
  729.   </requestHandler>
  730.  
  731.  
  732.   <!-- Update request handler.  
  733.  
  734.       Note: Since solr1.1 requestHandlers requires a valid content type header if posted in
  735.       the body. For example, curl now requires: -H 'Content-type:text/xml; charset=utf-8'
  736.       The response format differs from solr1.1 formatting and returns a standard error code.
  737.       To enable solr1.1 behavior, remove the /update handler or change its path
  738.    -->
  739.   <requestHandler name="/update" class="solr.UpdateRequestHandler" />
  740.  
  741.  
  742.   <requestHandler name="/update/javabin" class="solr.UpdateRequestHandler" />
  743.  
  744.   <!--
  745.   Analysis request handler.  Since Solr 1.3.  Use to return how a document is analyzed.  Useful
  746.   for debugging and as a token server for other types of applications.
  747.  
  748.   This is deprecated in favor of the improved DocumentAnalysisRequestHandler and FieldAnalysisRequestHandler
  749.  
  750.   <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
  751.   -->
  752.  
  753.   <!--
  754.    An analysis handler that provides a breakdown of the analysis process of provided docuemnts. This handler expects a
  755.    (single) content stream with the following format:
  756.  
  757.    <docs>
  758.      <doc>
  759.        <field name="id">1</field>
  760.        <field name="name">The Name</field>
  761.        <field name="text">The Text Value</field>
  762.      <doc>
  763.      <doc>...</doc>
  764.      <doc>...</doc>
  765.      ...
  766.    </docs>
  767.  
  768.    Note: Each document must contain a field which serves as the unique key. This key is used in the returned
  769.    response to assoicate an analysis breakdown to the analyzed document.
  770.  
  771.    Like the FieldAnalysisRequestHandler, this handler also supports query analysis by
  772.    sending either an "analysis.query" or "q" request paraemter that holds the query text to be analyized. It also
  773.    supports the "analysis.showmatch" parameter which when set to true, all field tokens that match the query
  774.    tokens will be marked as a "match".
  775.  -->
  776.   <requestHandler name="/analysis/document" class="solr.DocumentAnalysisRequestHandler" />
  777.  
  778.   <!--
  779.    RequestHandler that provides much the same functionality as analysis.jsp. Provides the ability
  780.    to specify multiple field types and field names in the same request and outputs index-time and
  781.    query-time analysis for each of them.
  782.  
  783.    Request parameters are:
  784.    analysis.fieldname - The field name whose analyzers are to be used
  785.    analysis.fieldtype - The field type whose analyzers are to be used
  786.    analysis.fieldvalue - The text for index-time analysis
  787.    q (or analysis.q) - The text for query time analysis
  788.    analysis.showmatch (true|false) - When set to true and when query analysis is performed, the produced
  789.                                      tokens of the field value analysis will be marked as "matched" for every
  790.                                      token that is produces by the query analysis
  791.   -->
  792.   <requestHandler name="/analysis/field" class="solr.FieldAnalysisRequestHandler" />
  793.  
  794.  
  795.   <!-- CSV update handler, loaded on demand -->
  796.   <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
  797.  
  798.  
  799.   <!--
  800.   Admin Handlers - This will register all the standard admin RequestHandlers.  Adding
  801.   this single handler is equivalent to registering:
  802.  
  803.  <requestHandler name="/admin/luke"       class="org.apache.solr.handler.admin.LukeRequestHandler" />
  804.  <requestHandler name="/admin/system"     class="org.apache.solr.handler.admin.SystemInfoHandler" />
  805.  <requestHandler name="/admin/plugins"    class="org.apache.solr.handler.admin.PluginInfoHandler" />
  806.  <requestHandler name="/admin/threads"    class="org.apache.solr.handler.admin.ThreadDumpHandler" />
  807.  <requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" />
  808.  <requestHandler name="/admin/file"       class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
  809.  
  810.  If you wish to hide files under ${solr.home}/conf, explicitly register the ShowFileRequestHandler using:
  811.  <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
  812.    <lst name="invariants">
  813.     <str name="hidden">synonyms.txt</str>
  814.     <str name="hidden">anotherfile.txt</str>
  815.    </lst>
  816.  </requestHandler>
  817.  -->
  818.   <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
  819.  
  820.   <!-- ping/healthcheck -->
  821.   <requestHandler name="/admin/ping" class="PingRequestHandler">
  822.     <lst name="defaults">
  823.       <str name="qt">standard</str>
  824.       <str name="q">solrpingquery</str>
  825.       <str name="echoParams">all</str>
  826.     </lst>
  827.   </requestHandler>
  828.  
  829.   <!-- Echo the request contents back to the client -->
  830.   <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
  831.     <lst name="defaults">
  832.      <str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' -->
  833.      <str name="echoHandler">true</str>
  834.     </lst>
  835.   </requestHandler>
  836.  
  837.   <highlighting>
  838.    <!-- Configure the standard fragmenter -->
  839.    <!-- This could most likely be commented out in the "default" case -->
  840.    <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
  841.     <lst name="defaults">
  842.      <int name="hl.fragsize">100</int>
  843.     </lst>
  844.    </fragmenter>
  845.  
  846.    <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
  847.    <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
  848.     <lst name="defaults">
  849.       <!-- slightly smaller fragsizes work better because of slop -->
  850.       <int name="hl.fragsize">70</int>
  851.       <!-- allow 50% slop on fragment sizes -->
  852.       <float name="hl.regex.slop">0.5</float>
  853.       <!-- a basic sentence pattern -->
  854.       <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
  855.     </lst>
  856.    </fragmenter>
  857.  
  858.    <!-- Configure the standard formatter -->
  859.    <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
  860.     <lst name="defaults">
  861.      <str name="hl.simple.pre"><![CDATA[<em>]]></str>
  862.      <str name="hl.simple.post"><![CDATA[</em>]]></str>
  863.     </lst>
  864.    </formatter>
  865.   </highlighting>
  866.  
  867.   <!-- An example dedup update processor that creates the "id" field on the fly
  868.       based on the hash code of some other fields.  This example has overwriteDupes
  869.       set to false since we are using the id field as the signatureField and Solr
  870.       will maintain uniqueness based on that anyway.
  871.      
  872.       You have to link the chain to an update handler above to use it ie:
  873.         <requestHandler name="/update "class="solr.UpdateRequestHandler">
  874.           <lst name="defaults">
  875.             <str name="update.processor">dedupe</str>
  876.           </lst>
  877.         </requestHandler>  
  878.  -->
  879.   <!--
  880.  <updateRequestProcessorChain name="dedupe">
  881.    <processor class="org.apache.solr.update.processor.SignatureUpdateProcessorFactory">
  882.      <bool name="enabled">true</bool>
  883.      <str name="signatureField">id</str>
  884.      <bool name="overwriteDupes">false</bool>
  885.      <str name="fields">name,features,cat</str>
  886.      <str name="signatureClass">org.apache.solr.update.processor.Lookup3Signature</str>
  887.    </processor>
  888.    <processor class="solr.LogUpdateProcessorFactory" />
  889.    <processor class="solr.RunUpdateProcessorFactory" />
  890.  </updateRequestProcessorChain>
  891.  -->
  892.  
  893.  
  894.   <!-- Response Writers
  895.  
  896.       http://wiki.apache.org/solr/QueryResponseWriter
  897.  
  898.       Request responses will be written using the writer specified by
  899.       the 'wt' request parameter matching the name of a registered
  900.       writer.
  901.  
  902.       The "default" writer is the default and will be used if 'wt' is
  903.       not specified in the request.
  904.    -->
  905.   <!-- The following response writers are implicitly configured unless
  906.       overridden...
  907.    -->
  908.   <!--
  909.     <queryResponseWriter name="xml"
  910.                          default="true"
  911.                          class="solr.XMLResponseWriter" />
  912.     <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
  913.     <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
  914.     <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
  915.     <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
  916.     <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
  917.     <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
  918.    -->
  919.  
  920.   <queryResponseWriter name="json" class="solr.JSONResponseWriter">
  921.      <!-- For the purposes of the tutorial, JSON responses are written as
  922.      plain text so that they are easy to read in *any* browser.
  923.      If you expect a MIME type of "application/json" just remove this override.
  924.     -->
  925.     <str name="content-type">text/plain; charset=UTF-8</str>
  926.   </queryResponseWriter>
  927.  
  928.   <!--
  929.     Custom response writers can be declared as needed...
  930.    -->
  931.     <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"/>
  932.  
  933.  
  934.   <!-- XSLT response writer transforms the XML output by any xslt file found
  935.       in Solr's conf/xslt directory.  Changes to xslt files are checked for
  936.       every xsltCacheLifetimeSeconds.  
  937.    -->
  938.   <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
  939.     <int name="xsltCacheLifetimeSeconds">5</int>
  940.   </queryResponseWriter>
  941.  
  942.  
  943.   <!-- example of registering a query parser
  944.  <queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
  945.  -->
  946.  
  947.   <!-- example of registering a custom function parser
  948.  <valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" />
  949.  -->
  950.  
  951.   <!-- config for the admin interface -->
  952.   <admin>
  953.     <defaultQuery>solr</defaultQuery>
  954.  
  955.     <!-- configure a healthcheck file for servers behind a loadbalancer
  956.    <healthcheck type="file">server-enabled</healthcheck>
  957.    -->
  958.   </admin>
  959.  
  960. </config>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement