diff options
| author | Michael Peter Christen <mc@yacy.net> | 2017-06-09 12:25:23 +0200 |
|---|---|---|
| committer | Michael Peter Christen <mc@yacy.net> | 2017-06-09 12:25:23 +0200 |
| commit | 6fe735945da97abcbb91ac545fb11cff9d48effc (patch) | |
| tree | b5d38b409862cd963be909dabad66af791a997b7 /defaults/solr | |
| parent | ce8949231999551d1f28db6abcc0630ecfbaf7db (diff) | |
migrated Solr 5.5 -> Solr 6.6 and from Java 1.7 -> 1.8
Also: now Version 1.921
Diffstat (limited to 'defaults/solr')
| -rw-r--r-- | defaults/solr/schema.xml | 6 | ||||
| -rw-r--r-- | defaults/solr/solrconfig.xml | 1161 |
2 files changed, 453 insertions, 714 deletions
diff --git a/defaults/solr/schema.xml b/defaults/solr/schema.xml index b8b803b07..546ac5c94 100644 --- a/defaults/solr/schema.xml +++ b/defaults/solr/schema.xml @@ -111,11 +111,7 @@ </fields> <uniqueKey>id</uniqueKey> - <!-- defaultSearchField element is deprecated in Solr versions 3.6 and higher. Instead, df request parameter should be used--> - <defaultSearchField>text_t</defaultSearchField> - <!-- default operator parameter has been deprecated in Solr versions 3.6 and higher. Instead, the query parser q.op parameter should be used in request handler. --> - <solrQueryParser defaultOperator="AND"/> - + <!-- if you are using a search client using the default search field "text", then use this line to get to all indexed documents --> <!-- <copyField source="*_t" dest="text" maxChars="3000"/> --> </schema> diff --git a/defaults/solr/solrconfig.xml b/defaults/solr/solrconfig.xml index ad04908e3..eba3c1074 100644 --- a/defaults/solr/solrconfig.xml +++ b/defaults/solr/solrconfig.xml @@ -35,7 +35,7 @@ that you fully re-index after changing this setting as it can affect both how text is indexed and queried. --> - <luceneMatchVersion>5.5.0</luceneMatchVersion> + <luceneMatchVersion>6.6.0</luceneMatchVersion> <!-- <lib/> directives can be used to instruct Solr to load any Jars identified and use them to resolve any "plugins" specified in @@ -72,19 +72,16 @@ The examples below can be used to load some solr-contribs along with their external dependencies. --> - <!-- - <lib dir="../../../contrib/extraction/lib" regex=".*\.jar" /> - <lib dir="../../../dist/" regex="solr-cell-\d.*\.jar" /> + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" /> - <lib dir="../../../contrib/clustering/lib/" regex=".*\.jar" /> - <lib dir="../../../dist/" regex="solr-clustering-\d.*\.jar" /> + <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" /> + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" /> - <lib dir="../../../contrib/langid/lib/" regex=".*\.jar" /> - <lib dir="../../../dist/" regex="solr-langid-\d.*\.jar" /> + <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /> + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" /> - <lib dir="../../../contrib/velocity/lib" regex=".*\.jar" /> - <lib dir="../../../dist/" regex="solr-velocity-\d.*\.jar" /> - --> + <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" /> + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" /> <!-- an exact 'path' can be used instead of a 'dir' to specify a specific jar file. This will cause a serious error to be logged @@ -119,23 +116,7 @@ persistent, and doesn't work with replication. --> <directoryFactory name="DirectoryFactory" - class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"> - - - <!-- These will be used if you are using the solr.HdfsDirectoryFactory, - otherwise they will be ignored. If you don't plan on using hdfs, - you can safely remove this section. --> - <!-- The root directory that collection data should be written to. --> - <str name="solr.hdfs.home">${solr.hdfs.home:}</str> - <!-- The hadoop configuration files to use for the hdfs client. --> - <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str> - <!-- Enable/Disable the hdfs cache. --> - <str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str> - <!-- Enable/Disable using one global cache for all SolrCores. - The settings used will be from the first HdfsDirectoryFactory created. --> - <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str> - - </directoryFactory> + class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/> <!-- The CodecFactory for defining the format of the inverted index. The default implementation is SchemaCodecFactory, which is the official Lucene @@ -148,33 +129,6 @@ --> <codecFactory class="solr.SchemaCodecFactory"/> - <!-- To enable dynamic schema REST APIs, use the following for <schemaFactory>: - - <schemaFactory class="ManagedIndexSchemaFactory"> - <bool name="mutable">true</bool> - <str name="managedSchemaResourceName">managed-schema</str> - </schemaFactory> - - When ManagedIndexSchemaFactory is specified, Solr will load the schema from - he resource named in 'managedSchemaResourceName', rather than from schema.xml. - Note that the managed schema resource CANNOT be named schema.xml. If the managed - schema does not exist, Solr will create it after reading schema.xml, then rename - 'schema.xml' to 'schema.xml.bak'. - - Do NOT hand edit the managed schema - external modifications will be ignored and - overwritten as a result of schema modification REST API calls. - - When ManagedIndexSchemaFactory is specified with mutable = true, schema - modification REST API calls will be allowed; otherwise, error responses will be - sent back for these requests. - --> - <schemaFactory class="ClassicIndexSchemaFactory"/> - - <!-- using MMapDirectoryFactory as solution for ClosedChannelException - given in https://issues.apache.org/jira/browse/SOLR-2247 - this feature is now switched on in the startYACY.sh file using a -D option - --> - <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Index Config - These settings control low-level behavior of indexing Most example settings here show the default value, but are commented @@ -188,18 +142,12 @@ <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/> --> <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 --> - <writeLockTimeout>20000</writeLockTimeout> - - <!-- The maximum number of simultaneous threads that may be - indexing documents at once in IndexWriter; if more than this - many threads arrive they will wait for others to finish. - Default in Solr/Lucene is 8. --> - <!-- <maxIndexingThreads>8</maxIndexingThreads> --> + <!-- <writeLockTimeout>1000</writeLockTimeout> --> <!-- Expert: Enabling compound file will use less files for the index, using fewer file descriptors on the expense of performance decrease. Default in Lucene is "true". Default in Solr is "false" (since 3.6) --> - <useCompoundFile>true</useCompoundFile> + <!-- <useCompoundFile>false</useCompoundFile> --> <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene indexing for buffering added documents and deletions before they are @@ -209,8 +157,8 @@ If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first. The default is 100 MB. --> - <ramBufferSizeMB>32</ramBufferSizeMB> - <maxBufferedDocs>100</maxBufferedDocs> + <!-- <ramBufferSizeMB>100</ramBufferSizeMB> --> + <!-- <maxBufferedDocs>1000</maxBufferedDocs> --> <!-- Expert: Merge Policy The Merge Policy in Lucene controls how merging of segments is done. @@ -219,23 +167,11 @@ Even older versions of Lucene used LogDocMergePolicy. --> <!-- - <mergePolicy class="org.apache.lucene.index.TieredMergePolicy"> + <mergePolicyFactory class="solr.TieredMergePolicyFactory"> <int name="maxMergeAtOnce">10</int> <int name="segmentsPerTier">10</int> - </mergePolicy> - --> - - <!-- Merge Factor - The merge factor controls how many segments will get merged at a time. - For TieredMergePolicy, mergeFactor is a convenience parameter which - will set both MaxMergeAtOnce and SegmentsPerTier at once. - For LogByteSizeMergePolicy, mergeFactor decides how many new segments - will be allowed before they are merged into one. - Default is 10 for both merge policies. - --> - <!-- - <mergeFactor>10</mergeFactor> - --> + </mergePolicyFactory> + --> <!-- Expert: Merge Scheduler The Merge Scheduler in Lucene controls how merges are @@ -268,33 +204,6 @@ --> <lockType>${solr.lock.type:native}</lockType> - <!-- Unlock On Startup - - If true, unlock any held write or commit locks on startup. - This defeats the locking mechanism that allows multiple - processes to safely access a lucene index, and should be used - with care. Default is "false". - - This is not needed if lock type is 'single' - --> - <!-- - <unlockOnStartup>false</unlockOnStartup> - --> - - <!-- Expert: Controls how often Lucene loads terms into memory - Default is 128 and is likely good for most everyone. - --> - <!-- <termIndexInterval>128</termIndexInterval> --> - - <!-- If true, IndexReaders will be opened/reopened from the IndexWriter - instead of from the Directory. Hosts in a master/slave setup - should have this set to false while those in a SolrCloud - cluster need to be set to true. Default: true - --> - <!-- - <nrtMode>true</nrtMode> - --> - <!-- Commit Deletion Policy Custom deletion policies can be specified here. The class must implement org.apache.lucene.index.IndexDeletionPolicy. @@ -335,13 +244,6 @@ this is enabled here, and controlled through log4j.properties. --> <infoStream>true</infoStream> - - <!-- - Use true to enable this safety check, which can help - reduce the risk of propagating index corruption from older segments - into new ones, at the expense of slower merging. - --> - <checkIntegrityAtMerge>false</checkIntegrityAtMerge> </indexConfig> @@ -399,7 +301,7 @@ --> <autoCommit> <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> - <openSearcher>true</openSearcher> + <openSearcher>false</openSearcher> </autoCommit> <!-- softAutoCommit is like autoCommit except it causes a @@ -473,15 +375,6 @@ <str name="someArg">Some Value</str> </indexReaderFactory > --> - <!-- By explicitly declaring the Factory, the termIndexDivisor can - be specified. - --> - <!-- - <indexReaderFactory name="IndexReaderFactory" - class="solr.StandardIndexReaderFactory"> - <int name="setTermIndexDivisor">12</int> - </indexReaderFactory > - --> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Query section - these settings control query time things like caches @@ -535,20 +428,20 @@ and old cache. --> <filterCache class="solr.FastLRUCache" - size="100" - initialSize="100" + size="512" + initialSize="512" autowarmCount="0"/> - + <!-- Query Result Cache Caches results of searches - ordered lists of document ids (DocList) based on a query, a sort, and the range of documents requested. --> <queryResultCache class="solr.LRUCache" - size="100" - initialSize="100" + size="512" + initialSize="512" autowarmCount="0"/> - + <!-- Document Cache Caches Lucene Document objects (the stored fields for each @@ -556,10 +449,10 @@ this cache will not be autowarmed. --> <documentCache class="solr.LRUCache" - size="64" - initialSize="64" + size="512" + initialSize="512" autowarmCount="0"/> - + <!-- custom cache currently used by block join --> <cache name="perSegFilter" class="solr.search.LRUCache" @@ -567,17 +460,19 @@ initialSize="0" autowarmCount="10" regenerator="solr.NoOpRegenerator" /> - + <!-- Field Value Cache Cache used to hold field values that are quickly accessible by document id. The fieldValueCache is created by default even if not configured here. --> + <!-- <fieldValueCache class="solr.FastLRUCache" - size="64" - autowarmCount="0" + size="512" + autowarmCount="128" showItems="32" /> + --> <!-- Custom Cache @@ -684,18 +579,7 @@ warming searcher and use it. If "false" then all requests will block until the first searcher is done warming. --> - <useColdSearcher>true</useColdSearcher> - - <!-- Max Warming Searchers - - Maximum number of searchers that may be warming in the - background concurrently. An error is returned if this limit - is exceeded. - - Recommend values of 1-2 for read-only slaves, higher for - masters w/o cache warming. - --> - <maxWarmingSearchers>2</maxWarmingSearchers> + <useColdSearcher>false</useColdSearcher> </query> @@ -829,6 +713,13 @@ not be initialized until the first request that uses it. --> + + <requestHandler name="/dataimport" class="solr.DataImportHandler"> + <lst name="defaults"> + <str name="config">solr-data-config.xml</str> + </lst> + </requestHandler> + <!-- SearchHandler http://wiki.apache.org/solr/SearchHandler @@ -838,14 +729,14 @@ of SearchComponents (see below) and supports distributed queries across multiple shards --> - <requestHandler name="/select" class="solr.SearchHandler" startup="lazy"> + <requestHandler name="/select" class="solr.SearchHandler"> <!-- default values for query parameters can be specified, these will be overridden by parameters in the request --> <lst name="defaults"> <str name="echoParams">explicit</str> <int name="rows">10</int> - <str name="df">text_t</str> + <str name="df">text</str> </lst> <!-- In addition to defaults, "appends" params can be specified to identify values which should be appended to the list of @@ -902,597 +793,451 @@ </requestHandler> <!-- A request handler that returns indented JSON by default --> - <requestHandler name="/query" class="solr.SearchHandler" startup="lazy"> + <requestHandler name="/query" class="solr.SearchHandler"> <lst name="defaults"> <str name="echoParams">explicit</str> <str name="wt">json</str> <str name="indent">true</str> - <str name="df">text_t</str> + <str name="df">text</str> </lst> </requestHandler> + <!-- A Robust Example - <!-- realtime get handler, guaranteed to return the latest stored fields of - any document, without the need to commit or open a new searcher. The - current implementation relies on the updateLog feature being enabled. + This example SearchHandler declaration shows off usage of the + SearchHandler with many defaults declared - ** WARNING ** - Do NOT disable the realtime get handler at /get if you are using - SolrCloud otherwise any leader election will cause a full sync in ALL - replicas for the shard in question. Similarly, a replica recovery will - also always fetch the complete index from the leader because a partial - sync will not be possible in the absence of this handler. - --> - <requestHandler name="/get" class="solr.RealTimeGetHandler" startup="lazy"> - <lst name="defaults"> - <str name="omitHeader">true</str> - <str name="wt">json</str> - <str name="indent">true</str> - </lst> + Note that multiple instances of the same Request Handler + (SearchHandler) can be registered multiple times with different + names (and different init parameters) + --> + <requestHandler name="/browse" class="solr.SearchHandler"> + <lst name="defaults"> + <str name="echoParams">explicit</str> + + <!-- VelocityResponseWriter settings --> + <str name="wt">velocity</str> + <str name="v.template">browse</str> + <str name="v.layout">layout</str> + + <!-- Query settings --> + <str name="defType">edismax</str> + <str name="q.alt">*:*</str> + <str name="rows">10</str> + <str name="fl">*,score</str> + + <!-- Faceting defaults --> + <str name="facet">on</str> + <str name="facet.mincount">1</str> + </lst> </requestHandler> - <!-- - The export request handler is used to export full sorted result sets. - Do not change these defaults. - --> - - <requestHandler name="/export" class="solr.SearchHandler" startup="lazy"> - <lst name="invariants"> - <str name="rq">{!xport}</str> - <str name="wt">xsort</str> - <str name="distrib">false</str> + <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse"> + <lst name="defaults"> + <str name="df">text</str> </lst> + </initParams> - <arr name="components"> - <str>query</str> - </arr> - </requestHandler> + <!-- Solr Cell Update Request Handler - <!-- Update Request Handler. + http://wiki.apache.org/solr/ExtractingRequestHandler - http://wiki.apache.org/solr/UpdateXmlMessages + --> + <requestHandler name="/update/extract" + startup="lazy" + class="solr.extraction.ExtractingRequestHandler" > + <lst name="defaults"> + <str name="lowernames">true</str> + <str name="uprefix">ignored_</str> + + <!-- capture link hrefs but ignore div attributes --> + <str name="captureAttr">true</str> + <str name="fmap.a">links</str> + <str name="fmap.div">ignored_</str> + </lst> + </requestHandler> + <!-- Search Components - The canonical Request Handler for Modifying the Index through - commands specified using XML, JSON, CSV, or JAVABIN + Search components are registered to SolrCore and used by + instances of SearchHandler (which can access them by name) + + By default, the following components are available: + + <searchComponent name="query" class="solr.QueryComponent" /> + <searchComponent name="facet" class="solr.FacetComponent" /> + <searchComponent name="mlt" class="solr.MoreLikeThisComponent" /> + <searchComponent name="highlight" class="solr.HighlightComponent" /> + <searchComponent name="stats" class="solr.StatsComponent" /> + <searchComponent name="debug" class="solr.DebugComponent" /> + + Default configuration in a requestHandler would look like: - Note: Since solr1.1 requestHandlers requires a valid content - type header if posted in the body. For example, curl now - requires: -H 'Content-type:text/xml; charset=utf-8' + <arr name="components"> + <str>query</str> + <str>facet</str> + <str>mlt</str> + <str>highlight</str> + <str>stats</str> + <str>debug</str> + </arr> - To override the request content type and force a specific - Content-type, use the request parameter: - ?update.contentType=text/csv + If you register a searchComponent to one of the standard names, + that will be used instead of the default. - This handler will pick a response format to match the input - if the 'wt' parameter is not explicit - --> - <requestHandler name="/update" class="solr.UpdateRequestHandler" startup="lazy"> - <!-- See below for information on defining - updateRequestProcessorChains that can be used by name - on each Update Request - --> - <!-- - <lst name="defaults"> - <str name="update.chain">dedupe</str> - </lst> - --> - </requestHandler> - - <!-- The following are implicitly added - <requestHandler name="/update/json" class="solr.UpdateRequestHandler"> - <lst name="defaults"> - <str name="stream.contentType">application/json</str> - </lst> - </requestHandler> - <requestHandler name="/update/csv" class="solr.UpdateRequestHandler"> - <lst name="defaults"> - <str name="stream.contentType">application/csv</str> - </lst> - </requestHandler> - --> - - <!-- Solr Cell Update Request Handler - - http://wiki.apache.org/solr/ExtractingRequestHandler - - --> - <requestHandler name="/update/extract" - startup="lazy" - class="solr.extraction.ExtractingRequestHandler" > - <lst name="defaults"> - <str name="lowernames">true</str> - <str name="uprefix">ignored_</str> - - <!-- capture link hrefs but ignore div attributes --> - <str name="captureAttr">true</str> - <str name="fmap.a">links</str> - <str name="fmap.div">ignored_</str> - </lst> - </requestHandler> + To insert components before or after the 'standard' components, use: + <arr name="first-components"> + <str>myFirstComponentName</str> + </arr> - <!-- Field Analysis Request Handler - - RequestHandler that provides much the same functionality as - analysis.jsp. Provides the ability to specify multiple field - types and field names in the same request and outputs - index-time and query-time analysis for each of them. - - Request parameters are: - analysis.fieldname - field name whose analyzers are to be used - - analysis.fieldtype - field type whose analyzers are to be used - analysis.fieldvalue - text for index-time analysis - q (or analysis.q) - text for query time analysis - analysis.showmatch (true|false) - When set to true and when - query analysis is performed, the produced tokens of the - field value analysis will be marked as "matched" for every - token that is produces by the query analysis + <arr name="last-components"> + <str>myLastComponentName</str> + </arr> + + NOTE: The component registered with the name "debug" will + always be executed after the "last-components" + --> - <requestHandler name="/analysis/field" - startup="lazy" - class="solr.FieldAnalysisRequestHandler" /> - - - <!-- Document Analysis Handler - - http://wiki.apache.org/solr/AnalysisRequestHandler - - An analysis handler that provides a breakdown of the analysis - process of provided documents. This handler expects a (single) - content stream with the following format: - - <docs> - <doc> - <field name="id">1</field> - <field name="name">The Name</field> - <field name="text">The Text Value</field> - </doc> - <doc>...</doc> - <doc>...</doc> - ... - </docs> - - Note: Each document must contain a field which serves as the - unique key. This key is used in the returned response to associate - an analysis breakdown to the analyzed document. - - Like the FieldAnalysisRequestHandler, this handler also supports - query analysis by sending either an "analysis.query" or "q" - request parameter that holds the query text to be analyzed. It - also supports the "analysis.showmatch" parameter which when set to - true, all field tokens that match the query tokens will be marked - as a "match". + + <!-- Spell Check + + The spell check component can return a list of alternative spelling + suggestions. + + http://wiki.apache.org/solr/SpellCheckComponent --> - <requestHandler name="/analysis/document" - class="solr.DocumentAnalysisRequestHandler" - startup="lazy" /> + <searchComponent name="spellcheck" class="solr.SpellCheckComponent"> + + <str name="queryAnalyzerFieldType">text_general</str> + + <!-- Multiple "Spell Checkers" can be declared and used by this + component + --> + + <!-- a spellchecker built from a field of the main index --> + <lst name="spellchecker"> + <str name="name">default</str> + <str name="field">text</str> + <str name="classname">solr.DirectSolrSpellChecker</str> + <!-- the spellcheck distance measure used, the default is the internal levenshtein --> + <str name="distanceMeasure">internal</str> + <!-- minimum accuracy needed to be considered a valid spellcheck suggestion --> + <float name="accuracy">0.5</float> + <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 --> + <int name="maxEdits">2</int> + <!-- the minimum shared prefix when enumerating terms --> + <int name="minPrefix">1</int> + <!-- maximum number of inspections per result. --> + <int name="maxInspections">5</int> + <!-- minimum length of a query term to be considered for correction --> + <int name="minQueryLength">4</int> + <!-- maximum threshold of documents a query term can appear to be considered for correction --> + <float name="maxQueryFrequency">0.01</float> + <!-- uncomment this to require suggestions to occur in 1% of the documents + <float name="thresholdTokenFrequency">.01</float> + --> + </lst> - <!-- Admin Handlers - - Admin Handlers - This will register all the standard admin - RequestHandlers. - <requestHandler name="/admin/" - class="solr.admin.AdminHandlers" /> - --> - <!-- This single handler is equivalent to the following... --> + <!-- a spellchecker that can break or combine words. See "/spell" handler below for usage --> + <lst name="spellchecker"> + <str name="name">wordbreak</str> + <str name="classname">solr.WordBreakSolrSpellChecker</str> + <str name="field">name</str> + <str name="combineWords">true</str> + <str name="breakWords">true</str> + <int name="maxChanges">10</int> + </lst> + + <!-- a spellchecker that uses a different distance measure --> <!-- - <requestHandler name="/admin/luke" class="solr.admin.LukeRequestHandler" /> - <requestHandler name="/admin/system" class="solr.admin.SystemInfoHandler" /> - <requestHandler name="/admin/plugins" class="solr.admin.PluginInfoHandler" /> - <requestHandler name="/admin/threads" class="solr.admin.ThreadDumpHandler" /> - <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" /> - <requestHandler name="/admin/file" class="solr.admin.ShowFileRequestHandler" > - --> - <!-- If you wish to hide files under ${solr.home}/conf, explicitly - register the ShowFileRequestHandler using the definition below. - NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will - not exclude all files ending in '.xml'. Use it to exclude _all_ updates + <lst name="spellchecker"> + <str name="name">jarowinkler</str> + <str name="field">spell</str> + <str name="classname">solr.DirectSolrSpellChecker</str> + <str name="distanceMeasure"> + org.apache.lucene.search.spell.JaroWinklerDistance + </str> + </lst> --> + + <!-- a spellchecker that use an alternate comparator + + comparatorClass be one of: + 1. score (default) + 2. freq (Frequency first, then score) + 3. A fully qualified class name + --> <!-- - <requestHandler name="/admin/file" - class="solr.admin.ShowFileRequestHandler" > - <lst name="invariants"> - <str name="hidden">synonyms.txt</str> - <str name="hidden">anotherfile.txt</str> - <str name="hidden">*</str> - </lst> - </requestHandler> - --> - - <!-- ping/healthcheck --> - <requestHandler name="/admin/ping" class="solr.PingRequestHandler" startup="lazy"> - <lst name="invariants"> - <str name="q">solrpingquery</str> - </lst> + <lst name="spellchecker"> + <str name="name">freq</str> + <str name="field">lowerfilt</str> + <str name="classname">solr.DirectSolrSpellChecker</str> + <str name="comparatorClass">freq</str> + --> + + <!-- A spellchecker that reads the list of words from a file --> + <!-- + <lst name="spellchecker"> + <str name="classname">solr.FileBasedSpellChecker</str> + <str name="name">file</str> + <str name="sourceLocation">spellings.txt</str> + <str name="characterEncoding">UTF-8</str> + <str name="spellcheckIndexDir">spellcheckerFile</str> + </lst> + --> + </searchComponent> + + <!-- A request handler for demonstrating the spellcheck component. + + NOTE: This is purely as an example. The whole purpose of the + SpellCheckComponent is to hook it into the request handler that + handles your normal user queries so that a separate request is + not needed to get suggestions. + + IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS + NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM! + + See http://wiki.apache.org/solr/SpellCheckComponent for details + on the request parameters. + --> + <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy"> + <lst name="defaults"> + <str name="df">text</str> + <!-- Solr will use suggestions from both the 'default' spellchecker + and from the 'wordbreak' spellchecker and combine them. + collations (re-written queries) can include a combination of + corrections from both spellcheckers --> + <str name="spellcheck.dictionary">default</str> + <str name="spellcheck.dictionary">wordbreak</str> + <str name="spellcheck">on</str> + <str name="spellcheck.extendedResults">true</str> + <str name="spellcheck.count">10</str> + <str name="spellcheck.alternativeTermCount">5</str> + <str name="spellcheck.maxResultsForSuggest">5</str> + <str name="spellcheck.collate">true</str> + <str name="spellcheck.collateExtendedResults">true</str> + <str name="spellcheck.maxCollationTries">10</str> + <str name="spellcheck.maxCollations">5</str> + </lst> + <arr name="last-components"> + <str>spellcheck</str> + </arr> + </requestHandler> + + <searchComponent name="suggest" class="solr.SuggestComponent"> + <lst name="suggester"> + <str name="name">mySuggester</str> + <str name="lookupImpl">FuzzyLookupFactory</str> <!-- org.apache.solr.spelling.suggest.fst --> + <str name="dictionaryImpl">DocumentDictionaryFactory</str> <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory --> + <str name="field">cat</str> + <str name="weightField">price</str> + <str name="suggestAnalyzerFieldType">string</str> + </lst> + </searchComponent> + + <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy"> + <lst name="defaults"> + <str name="suggest">true</str> + <str name="suggest.count">10</str> + </lst> + <arr name="components"> + <str>suggest</str> + </arr> + </requestHandler> + <!-- Term Vector Component + + http://wiki.apache.org/solr/TermVectorComponent + --> + <searchComponent name="tvComponent" class="solr.TermVectorComponent"/> + + <!-- A request handler for demonstrating the term vector component + + This is purely as an example. + + In reality you will likely want to add the component to your + already specified request handlers. + --> + <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy"> + <lst name="defaults"> + <str name="df">text</str> + <bool name="tv">true</bool> + </lst> + <arr name="last-components"> + <str>tvComponent</str> + </arr> + </requestHandler> + + <!-- Terms Component + + http://wiki.apache.org/solr/TermsComponent + + A component to return terms and document frequency of those + terms + --> + <searchComponent name="terms" class="solr.TermsComponent"/> + + <!-- A request handler for demonstrating the terms component --> + <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy"> + <lst name="defaults"> + <bool name="terms">true</bool> + <bool name="distrib">false</bool> + </lst> + <arr name="components"> + <str>terms</str> + </arr> + </requestHandler> + + + <!-- Query Elevation Component + + http://wiki.apache.org/solr/QueryElevationComponent + + a search component that enables you to configure the top + results for a given query regardless of the normal lucene + scoring. + --> + <searchComponent name="elevator" class="solr.QueryElevationComponent" > + <!-- pick a fieldType to analyze queries --> + <str name="queryFieldType">string</str> + <str name="config-file">elevate.xml</str> + </searchComponent> + + <!-- A request handler for demonstrating the elevator component --> + <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy"> + <lst name="defaults"> + <str name="echoParams">explicit</str> + <str name="df">text</str> + </lst> + <arr name="last-components"> + <str>elevator</str> + </arr> + </requestHandler> + + <!-- Highlighting Component + + http://wiki.apache.org/solr/HighlightingParameters + --> + <searchComponent class="solr.HighlightComponent" name="highlight"> + <highlighting> + <!-- Configure the standard fragmenter --> + <!-- This could most likely be commented out in the "default" case --> + <fragmenter name="gap" + default="true" + class="solr.highlight.GapFragmenter"> <lst name="defaults"> - <str name="echoParams">all</str> + <int name="hl.fragsize">100</int> </lst> - <!-- An optional feature of the PingRequestHandler is to configure the - handler with a "healthcheckFile" which can be used to enable/disable - the PingRequestHandler. - relative paths are resolved against the data dir - --> - <!-- <str name="healthcheckFile">server-enabled.txt</str> --> - </requestHandler> - - <!-- Echo the request contents back to the client --> - <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" startup="lazy"> + </fragmenter> + + <!-- A regular-expression-based fragmenter + (for sentence extraction) + --> + <fragmenter name="regex" + class="solr.highlight.RegexFragmenter"> <lst name="defaults"> - <str name="echoParams">explicit</str> - <str name="echoHandler">true</str> + <!-- slightly smaller fragsizes work better because of slop --> + <int name="hl.fragsize">70</int> + <!-- allow 50% slop on fragment sizes --> + <float name="hl.regex.slop">0.5</float> + <!-- a basic sentence pattern --> + <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str> </lst> - </requestHandler> - - <!-- Solr Replication - - The SolrReplicationHandler supports replicating indexes from a - "master" used for indexing and "slaves" used for queries. - - http://wiki.apache.org/solr/SolrReplication - - It is also necessary for SolrCloud to function (in Cloud mode, the - replication handler is used to bulk transfer segments when nodes - are added or need to recover). - - https://wiki.apache.org/solr/SolrCloud/ - --> - <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy"> - <!-- - To enable simple master/slave replication, uncomment one of the - sections below, depending on whether this solr instance should be - the "master" or a "slave". If this instance is a "slave" you will - also need to fill in the masterUrl to point to a real machine. - --> - <!-- - <lst name="master"> - <str name="replicateAfter">commit</str> - <str name="replicateAfter">startup</str> - <str name="confFiles">schema.xml,stopwords.txt</str> - </lst> - --> - <!-- - <lst name="slave"> - <str name="masterUrl">http://your-master-hostname:8983/solr</str> - <str name="pollInterval">00:00:60</str> - </lst> - --> - </requestHandler> - - <!-- Search Components - - Search components are registered to SolrCore and used by - instances of SearchHandler (which can access them by name) - - By default, the following components are available: - - <searchComponent name="query" class="solr.QueryComponent" /> - <searchComponent name="facet" class="solr.FacetComponent" /> - <searchComponent name="mlt" class="solr.MoreLikeThisComponent" /> - <searchComponent name="highlight" class="solr.HighlightComponent" /> - <searchComponent name="stats" class="solr.StatsComponent" /> - <searchComponent name="debug" class="solr.DebugComponent" /> - - Default configuration in a requestHandler would look like: - - <arr name="components"> - <str>query</str> - <str>facet</str> - <str>mlt</str> - <str>highlight</str> - <str>stats</str> - <str>debug</str> - </arr> - - If you register a searchComponent to one of the standard names, - that will be used instead of the default. - - To insert components before or after the 'standard' components, use: - - <arr name="first-components"> - <str>myFirstComponentName</str> - </arr> - - <arr name="last-components"> - <str>myLastComponentName</str> - </arr> - - NOTE: The component registered with the name "debug" will - always be executed after the "last-components" - - --> - - <!-- Term Vector Component - - http://wiki.apache.org/solr/TermVectorComponent - --> - <searchComponent name="tvComponent" class="solr.TermVectorComponent"/> - - <!-- A request handler for demonstrating the term vector component - - This is purely as an example. - - In reality you will likely want to add the component to your - already specified request handlers. - --> - <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy"> + </fragmenter> + + <!-- Configure the standard formatter --> + <formatter name="html" + default="true" + class="solr.highlight.HtmlFormatter"> <lst name="defaults"> - <str name="df">text_t</str> - <bool name="tv">true</bool> - </lst> - <arr name="last-components"> - <str>tvComponent</str> - </arr> - </requestHandler> - - <!-- Clustering Component - - You'll need to set the solr.clustering.enabled system property - when running solr to run with clustering enabled: - - java -Dsolr.clustering.enabled=true -jar start.jar - - http://wiki.apache.org/solr/ClusteringComponent - http://carrot2.github.io/solr-integration-strategies/ - --> - <searchComponent name="clustering" - enable="${solr.clustering.enabled:false}" - class="solr.clustering.ClusteringComponent" > - <lst name="engine"> - <str name="name">lingo</str> - - <!-- Class name of a clustering algorithm compatible with the Carrot2 framework. - - Currently available open source algorithms are: - * org.carrot2.clustering.lingo.LingoClusteringAlgorithm - * org.carrot2.clustering.stc.STCClusteringAlgorithm - * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm - - See http://project.carrot2.org/algorithms.html for more information. - - A commercial algorithm Lingo3G (needs to be installed separately) is defined as: - * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm - --> - <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str> - - <!-- Override location of the clustering algorithm's resources - (attribute definitions and lexical resources). - - A directory from which to load algorithm-specific stop words, - stop labels and attribute definition XMLs. - - For an overview of Carrot2 lexical resources, see: - http://download.carrot2.org/head/manual/#chapter.lexical-resources - - For an overview of Lingo3G lexical resources, see: - http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources - --> - <str name="carrot.resourcesDir">clustering/carrot2</str> + <str name="hl.simple.pre"><![CDATA[<em>]]></str> + <str name="hl.simple.post"><![CDATA[</em>]]></str> </lst> - <!-- An example definition for the STC clustering algorithm. --> - <lst name="engine"> - <str name="name">stc</str> - <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str> + </formatter> + + <!-- Configure the standard encoder --> + <encoder name="html" + class="solr.highlight.HtmlEncoder" /> + + <!-- Configure the standard fragListBuilder --> + <fragListBuilder name="simple" + class="solr.highlight.SimpleFragListBuilder"/> + + <!-- Configure the single fragListBuilder --> + <fragListBuilder name="single" + class="solr.highlight.SingleFragListBuilder"/> + + <!-- Configure the weighted fragListBuilder --> + <fragListBuilder name="weighted" + default="true" + class="solr.highlight.WeightedFragListBuilder"/> + + <!-- default tag FragmentsBuilder --> + <fragmentsBuilder name="default" + default="true" + class="solr.highlight.ScoreOrderFragmentsBuilder"> + <!-- + <lst name="defaults"> + <str name="hl.multiValuedSeparatorChar">/</str> </lst> - <!-- An example definition for the bisecting kmeans clustering algorithm. --> - <lst name="engine"> - <str name="name">kmeans</str> - <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str> - </lst> - </searchComponent> - - <!-- A request handler for demonstrating the clustering component - - This is purely as an example. - - In reality you will likely want to add the component to your - already specified request handlers. - --> - <requestHandler name="/clustering" - startup="lazy" - enable="${solr.clustering.enabled:false}" - class="solr.SearchHandler"> + --> + </fragmentsBuilder> + + <!-- multi-colored tag FragmentsBuilder --> + <fragmentsBuilder name="colored" + class="solr.highlight.ScoreOrderFragmentsBuilder"> <lst name="defaults"> - <bool name="clustering">true</bool> - <bool name="clustering.results">true</bool> - <!-- Field name with the logical "title" of a each document (optional) --> - <str name="carrot.title">name</str> - <!-- Field name with the logical "URL" of a each document (optional) --> - <str name="carrot.url">id</str> - <!-- Field name with the logical "content" of a each document (optional) --> - <str name="carrot.snippet">features</str> - <!-- Apply highlighter to the title/ content and use this for clustering. --> - <bool name="carrot.produceSummary">true</bool> - <!-- the maximum number of labels per cluster --> - <!--<int name="carrot.numDescriptions">5</int>--> - <!-- produce sub clusters --> - <bool name="carrot.outputSubClusters">false</bool> - - <!-- Configure the remaining request handler parameters. --> - <str name="defType">edismax</str> - <str name="qf"> - text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4 - </str> - <str name="q.alt">*:*</str> - <str name="rows">10</str> - <str name="fl">*,score</str> + <str name="hl.tag.pre"><![CDATA[ + <b style="background:yellow">,<b style="background:lawgreen">, + <b style="background:aquamarine">,<b style="background:magenta">, + <b style="background:palegreen">,<b style="background:coral">, + <b style="background:wheat">,<b style="background:khaki">, + <b style="background:lime">,<b style="background:deepskyblue">]]></str> + <str name="hl.tag.post"><![CDATA[</b>]]></str> </lst> - <arr name="last-components"> - <str>clustering</str> - </arr> - </requestHandler> - - <!-- Terms Component - - http://wiki.apache.org/solr/TermsComponent - - A component to return terms and document frequency of those - terms - --> - <searchComponent name="terms" class="solr.TermsComponent"/> - - <!-- A request handler for demonstrating the terms component --> - <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy"> + </fragmentsBuilder> + + <boundaryScanner name="default" + default="true" + class="solr.highlight.SimpleBoundaryScanner"> <lst name="defaults"> - <bool name="terms">true</bool> - <bool name="distrib">false</bool> + <str name="hl.bs.maxScan">10</str> + <str name="hl.bs.chars">.,!? 	 </str> </lst> - <arr name="components"> - <str>terms</str> - </arr> - </requestHandler> - - - <!-- Query Elevation Component - - http://wiki.apache.org/solr/QueryElevationComponent - - a search component that enables you to configure the top - results for a given query regardless of the normal lucene - scoring. - --> - <searchComponent name="elevator" class="solr.QueryElevationComponent" > - <!-- pick a fieldType to analyze queries --> - <str name="queryFieldType">string</str> - <str name="config-file">elevate.xml</str> - </searchComponent> - - <!-- A request handler for demonstrating the elevator component --> - <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy"> + </boundaryScanner> + + <boundaryScanner name="breakIterator" + class="solr.highlight.BreakIteratorBoundaryScanner"> <lst name="defaults"> - <str name="echoParams">explicit</str> - <str name="df">text_t</str> + <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE --> + <str name="hl.bs.type">WORD</str> + <!-- language and country are used when constructing Locale object. --> + <!-- And the Locale object will be used when getting instance of BreakIterator --> + <str name="hl.bs.language">en</str> + <str name="hl.bs.country">US</str> </lst> - <arr name="last-components"> - <str>elevator</str> - </arr> - </requestHandler> - - <!-- Highlighting Component - - http://wiki.apache.org/solr/HighlightingParameters - --> - <searchComponent class="solr.HighlightComponent" name="highlight"> - <highlighting> - <!-- Configure the standard fragmenter --> - <!-- This could most likely be commented out in the "default" case --> - <fragmenter name="gap" - default="true" - class="solr.highlight.GapFragmenter"> - <lst name="defaults"> - <int name="hl.fragsize">100</int> - </lst> - </fragmenter> - - <!-- A regular-expression-based fragmenter - (for sentence extraction) - --> - <fragmenter name="regex" - class="solr.highlight.RegexFragmenter"> - <lst name="defaults"> - <!-- slightly smaller fragsizes work better because of slop --> - <int name="hl.fragsize">70</int> - <!-- allow 50% slop on fragment sizes --> - <float name="hl.regex.slop">0.5</float> - <!-- a basic sentence pattern --> - <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str> - </lst> - </fragmenter> - - <!-- Configure the standard formatter --> - <formatter name="html" - default="true" - class="solr.highlight.HtmlFormatter"> - <lst name="defaults"> - <str name="hl.simple.pre"><![CDATA[<em>]]></str> - <str name="hl.simple.post"><![CDATA[</em>]]></str> - </lst> - </formatter> - - <!-- Configure the standard encoder --> - <encoder name="html" - class="solr.highlight.HtmlEncoder" /> - - <!-- Configure the standard fragListBuilder --> - <fragListBuilder name="simple" - class="solr.highlight.SimpleFragListBuilder"/> - - <!-- Configure the single fragListBuilder --> - <fragListBuilder name="single" - class="solr.highlight.SingleFragListBuilder"/> - - <!-- Configure the weighted fragListBuilder --> - <fragListBuilder name="weighted" - default="true" - class="solr.highlight.WeightedFragListBuilder"/> - - <!-- default tag FragmentsBuilder --> - <fragmentsBuilder name="default" - default="true" - class="solr.highlight.ScoreOrderFragmentsBuilder"> - <!-- - <lst name="defaults"> - <str name="hl.multiValuedSeparatorChar">/</str> - </lst> - --> - </fragmentsBuilder> - - <!-- multi-colored tag FragmentsBuilder --> - <fragmentsBuilder name="colored" - class="solr.highlight.ScoreOrderFragmentsBuilder"> - <lst name="defaults"> - <str name="hl.tag.pre"><![CDATA[ - <b style="background:yellow">,<b style="background:lawgreen">, - <b style="background:aquamarine">,<b style="background:magenta">, - <b style="background:palegreen">,<b style="background:coral">, - <b style="background:wheat">,<b style="background:khaki">, - <b style="background:lime">,<b style="background:deepskyblue">]]></str> - <str name="hl.tag.post"><![CDATA[</b>]]></str> - </lst> - </fragmentsBuilder> - - <boundaryScanner name="default" - default="true" - class="solr.highlight.SimpleBoundaryScanner"> - <lst name="defaults"> - <str name="hl.bs.maxScan">10</str> - <str name="hl.bs.chars">.,!? 	 </str> - </lst> - </boundaryScanner> - - <boundaryScanner name="breakIterator" - class="solr.highlight.BreakIteratorBoundaryScanner"> - <lst name="defaults"> - <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE --> - <str name="hl.bs.type">WORD</str> - <!-- language and country are used when constructing Locale object. --> - <!-- And the Locale object will be used when getting instance of BreakIterator --> - <str name="hl.bs.language">en</str> - <str name="hl.bs.country">US</str> - </lst> - </boundaryScanner> - </highlighting> - </searchComponent> - - <!-- Update Processors - - Chains of Update Processor Factories for dealing with Update - Requests can be declared, and then used by name in Update - Request Processors - - http://wiki.apache.org/solr/UpdateRequestProcessor - - --> - <!-- Deduplication - - An example dedup update processor that creates the "id" field - on the fly based on the hash code of some other fields. This - example has overwriteDupes set to false since we are using the - id field as the signatureField and Solr will maintain - uniqueness based on that anyway. - - --> - <!-- + </boundaryScanner> + </highlighting> + </searchComponent> + + <!-- Update Processors + + Chains of Update Processor Factories for dealing with Update + Requests can be declared, and then used by name in Update + Request Processors + + http://wiki.apache.org/solr/UpdateRequestProcessor + + --> + <!-- Deduplication + + An example dedup update processor that creates the "id" field + on the fly based on the hash code of some other fields. This + example has overwriteDupes set to false since we are using the + id field as the signatureField and Solr will maintain + uniqueness based on that anyway. + + --> + <!-- <updateRequestProcessorChain name="dedupe"> <processor class="solr.processor.SignatureUpdateProcessorFactory"> <bool name="enabled">true</bool> @@ -1584,8 +1329,9 @@ <!-- Custom response writers can be declared as needed... --> - <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"/> - + <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"> + <str name="template.base.dir">${velocity.template.base.dir:}</str> + </queryResponseWriter> <!-- XSLT response writer transforms the XML output by any xslt file found in Solr's conf/xslt directory. Changes to xslt files are checked for @@ -1597,7 +1343,7 @@ <!-- Query Parsers - http://wiki.apache.org/solr/SolrQuerySyntax + https://cwiki.apache.org/confluence/display/solr/Query+Syntax+and+Parsing Multiple QParserPlugins can be registered by name, and then used in either the "defType" param for the QueryComponent (used @@ -1640,13 +1386,10 @@ <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" > <double name="defaultValue">5</double> </transformer> + If you are using the QueryElevationComponent, you may wish to mark documents that get boosted. The EditorialMarkerFactory will do exactly that: <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" /> --> - - <!-- Legacy config for the admin interface --> - <admin> - <defaultQuery>*:*</defaultQuery> - </admin> + </config> |
