Showing
8 changed files
with
3007 additions
and
0 deletions
config/solr/accounts/elevate.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!-- | ||
3 | + Licensed to the Apache Software Foundation (ASF) under one or more | ||
4 | + contributor license agreements. See the NOTICE file distributed with | ||
5 | + this work for additional information regarding copyright ownership. | ||
6 | + The ASF licenses this file to You under the Apache License, Version 2.0 | ||
7 | + (the "License"); you may not use this file except in compliance with | ||
8 | + the License. You may obtain a copy of the License at | ||
9 | + | ||
10 | + http://www.apache.org/licenses/LICENSE-2.0 | ||
11 | + | ||
12 | + Unless required by applicable law or agreed to in writing, software | ||
13 | + distributed under the License is distributed on an "AS IS" BASIS, | ||
14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
15 | + See the License for the specific language governing permissions and | ||
16 | + limitations under the License. | ||
17 | +--> | ||
18 | + | ||
19 | +<!-- If this file is found in the config directory, it will only be | ||
20 | + loaded once at startup. If it is found in Solr's data | ||
21 | + directory, it will be re-loaded every commit. | ||
22 | + | ||
23 | + See http://wiki.apache.org/solr/QueryElevationComponent for more info | ||
24 | + | ||
25 | +--> | ||
26 | +<elevate> | ||
27 | + <!-- Query elevation examples | ||
28 | + <query text="foo bar"> | ||
29 | + <doc id="1" /> | ||
30 | + <doc id="2" /> | ||
31 | + <doc id="3" /> | ||
32 | + </query> | ||
33 | + | ||
34 | +for use with techproducts example | ||
35 | + | ||
36 | + <query text="ipod"> | ||
37 | + <doc id="MA147LL/A" /> put the actual ipod at the top | ||
38 | + <doc id="IW-02" exclude="true" /> exclude this cable | ||
39 | + </query> | ||
40 | +--> | ||
41 | + | ||
42 | +</elevate> |
config/solr/accounts/schema.xml
0 → 100644
1 | +<schema name="account" version="1.5"><!-- Confirmer choix version--> | ||
2 | + <fieldType name="int" class="solr.TrieIntField"/> | ||
3 | + <fieldType name="long" class="solr.TrieLongField"/> | ||
4 | + <fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true" /> | ||
5 | + <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true"/> | ||
6 | + <fieldType name="tdates" class="solr.TrieDateField" docValues="true" precisionStep="6" positionIncrementGap="0"/> | ||
7 | + <fieldType name="tlongs" class="solr.TrieLongField" docValues="true" precisionStep="8" positionIncrementGap="0"/> | ||
8 | + <fieldType name="tdoubles" class="solr.TrieDoubleField" docValues="true" precisionStep="8" positionIncrementGap="0"/> | ||
9 | + <fieldType name="ICUtext" class="solr.TextField"> | ||
10 | + <analyzer type="index"> | ||
11 | + <charFilter class="solr.HTMLStripCharFilterFactory"/> | ||
12 | + <tokenizer class="solr.ICUTokenizerFactory"/> | ||
13 | + <filter class="solr.ICUFoldingFilterFactory"/> | ||
14 | + </analyzer> | ||
15 | + <analyzer type="query"> | ||
16 | + <tokenizer class="solr.ICUTokenizerFactory"/> | ||
17 | + <filter class="solr.ICUFoldingFilterFactory"/> | ||
18 | + </analyzer> | ||
19 | + </fieldType> | ||
20 | + <fieldType name="namestr" class="solr.StrField"/> | ||
21 | + | ||
22 | + <field name="presentation" type="ICUtext" indexed="true" stored="true" multiValued="false" required="false"/> | ||
23 | + <field name="userId" type="int" indexed="true" multiValued="false" required="true"/> | ||
24 | + <field name="_version_" type="long" indexed="true" multiValued="false" required="true"/> | ||
25 | + <field name="_text_" type="ICUtext" indexed="true" multiValued="true" required="true"/> | ||
26 | + | ||
27 | + <uniqueKey>userId</uniqueKey> | ||
28 | + | ||
29 | + <copyField source="presentation" dest="_text_" /> | ||
30 | +</schema> | ||
31 | + |
config/solr/accounts/solrconfig.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!-- | ||
3 | + Licensed to the Apache Software Foundation (ASF) under one or more | ||
4 | + contributor license agreements. See the NOTICE file distributed with | ||
5 | + this work for additional information regarding copyright ownership. | ||
6 | + The ASF licenses this file to You under the Apache License, Version 2.0 | ||
7 | + (the "License"); you may not use this file except in compliance with | ||
8 | + the License. You may obtain a copy of the License at | ||
9 | + | ||
10 | + http://www.apache.org/licenses/LICENSE-2.0 | ||
11 | + | ||
12 | + Unless required by applicable law or agreed to in writing, software | ||
13 | + distributed under the License is distributed on an "AS IS" BASIS, | ||
14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
15 | + See the License for the specific language governing permissions and | ||
16 | + limitations under the License. | ||
17 | +--> | ||
18 | + | ||
19 | +<!-- | ||
20 | + For more details about configurations options that may appear in | ||
21 | + this file, see http://wiki.apache.org/solr/SolrConfigXml. | ||
22 | +--> | ||
23 | +<config> | ||
24 | +<schemaFactory class="ClassicIndexSchemaFactory"/> | ||
25 | + <!-- In all configuration below, a prefix of "solr." for class names | ||
26 | + is an alias that causes solr to search appropriate packages, | ||
27 | + including org.apache.solr.(search|update|request|core|analysis) | ||
28 | + | ||
29 | + You may also specify a fully qualified Java classname if you | ||
30 | + have your own custom plugins. | ||
31 | + --> | ||
32 | + | ||
33 | + <!-- Controls what version of Lucene various components of Solr | ||
34 | + adhere to. Generally, you want to use the latest version to | ||
35 | + get all bug fixes and improvements. It is highly recommended | ||
36 | + that you fully re-index after changing this setting as it can | ||
37 | + affect both how text is indexed and queried. | ||
38 | + --> | ||
39 | + <luceneMatchVersion>6.3.0</luceneMatchVersion> | ||
40 | + | ||
41 | + <!-- <lib/> directives can be used to instruct Solr to load any Jars | ||
42 | + identified and use them to resolve any "plugins" specified in | ||
43 | + your solrconfig.xml or publishersSchema.xml (ie: Analyzers, Request | ||
44 | + Handlers, etc...). | ||
45 | + | ||
46 | + All directories and paths are resolved relative to the | ||
47 | + instanceDir. | ||
48 | + | ||
49 | + Please note that <lib/> directives are processed in the order | ||
50 | + that they appear in your solrconfig.xml file, and are "stacked" | ||
51 | + on top of each other when building a ClassLoader - so if you have | ||
52 | + plugin jars with dependencies on other jars, the "lower level" | ||
53 | + dependency jars should be loaded first. | ||
54 | + | ||
55 | + If a "./lib" directory exists in your instanceDir, all files | ||
56 | + found in it are included as if you had used the following | ||
57 | + syntax... | ||
58 | + | ||
59 | + <lib dir="./lib" /> | ||
60 | + --> | ||
61 | + | ||
62 | + <!-- A 'dir' option by itself adds any files found in the directory | ||
63 | + to the classpath, this is useful for including all jars in a | ||
64 | + directory. | ||
65 | + | ||
66 | + When a 'regex' is specified in addition to a 'dir', only the | ||
67 | + files in that directory which completely match the regex | ||
68 | + (anchored on both ends) will be included. | ||
69 | + | ||
70 | + If a 'dir' option (with or without a regex) is used and nothing | ||
71 | + is found that matches, a warning will be logged. | ||
72 | + | ||
73 | + The examples below can be used to load some solr-contribs along | ||
74 | + with their external dependencies. | ||
75 | + --> | ||
76 | + <lib dir="${solr.install.dir:..}/contrib/analysis-extras/lucene-libs" regex="lucene-analyzers-icu-.*\.jar" /> | ||
77 | + <lib dir="${solr.install.dir:..}/contrib/analysis-extras/lib" regex="icu4j-.*\.jar" /> | ||
78 | + <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" /> | ||
79 | + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" /> | ||
80 | + | ||
81 | + <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" /> | ||
82 | + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" /> | ||
83 | + | ||
84 | + <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /> | ||
85 | + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" /> | ||
86 | + | ||
87 | + <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" /> | ||
88 | + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" /> | ||
89 | + <!-- an exact 'path' can be used instead of a 'dir' to specify a | ||
90 | + specific jar file. This will cause a serious error to be logged | ||
91 | + if it can't be loaded. | ||
92 | + --> | ||
93 | + <!-- | ||
94 | + <lib path="../a-jar-that-does-not-exist.jar" /> | ||
95 | + --> | ||
96 | + | ||
97 | + <!-- Data Directory | ||
98 | + | ||
99 | + Used to specify an alternate directory to hold all index data | ||
100 | + other than the default ./data under the Solr home. If | ||
101 | + replication is in use, this should match the replication | ||
102 | + configuration. | ||
103 | + --> | ||
104 | + <dataDir>${solr.data.dir:}</dataDir> | ||
105 | + | ||
106 | + | ||
107 | + <!-- The DirectoryFactory to use for indexes. | ||
108 | + | ||
109 | + solr.StandardDirectoryFactory is filesystem | ||
110 | + based and tries to pick the best implementation for the current | ||
111 | + JVM and platform. solr.NRTCachingDirectoryFactory, the default, | ||
112 | + wraps solr.StandardDirectoryFactory and caches small files in memory | ||
113 | + for better NRT performance. | ||
114 | + | ||
115 | + One can force a particular implementation via solr.MMapDirectoryFactory, | ||
116 | + solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory. | ||
117 | + | ||
118 | + solr.RAMDirectoryFactory is memory based, not | ||
119 | + persistent, and doesn't work with replication. | ||
120 | + --> | ||
121 | + <directoryFactory name="DirectoryFactory" | ||
122 | + class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/> | ||
123 | + | ||
124 | + <!-- The CodecFactory for defining the format of the inverted index. | ||
125 | + The default implementation is SchemaCodecFactory, which is the official Lucene | ||
126 | + index format, but hooks into the schema to provide per-field customization of | ||
127 | + the postings lists and per-document values in the fieldType element | ||
128 | + (postingsFormat/docValuesFormat). Note that most of the alternative implementations | ||
129 | + are experimental, so if you choose to customize the index format, it's a good | ||
130 | + idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader) | ||
131 | + before upgrading to a newer version to avoid unnecessary reindexing. | ||
132 | + A "compressionMode" string element can be added to <codecFactory> to choose | ||
133 | + between the existing compression modes in the default codec: "BEST_SPEED" (default) | ||
134 | + or "BEST_COMPRESSION". | ||
135 | + --> | ||
136 | + <codecFactory class="solr.SchemaCodecFactory"/> | ||
137 | + | ||
138 | + <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
139 | + Index Config - These settings control low-level behavior of indexing | ||
140 | + Most example settings here show the default value, but are commented | ||
141 | + out, to more easily see where customizations have been made. | ||
142 | + | ||
143 | + Note: This replaces <indexDefaults> and <mainIndex> from older versions | ||
144 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> | ||
145 | + <indexConfig> | ||
146 | + <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a | ||
147 | + LimitTokenCountFilterFactory in your fieldType definition. E.g. | ||
148 | + <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/> | ||
149 | + --> | ||
150 | + <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 --> | ||
151 | + <!-- <writeLockTimeout>1000</writeLockTimeout> --> | ||
152 | + | ||
153 | + <!-- Expert: Enabling compound file will use less files for the index, | ||
154 | + using fewer file descriptors on the expense of performance decrease. | ||
155 | + Default in Lucene is "true". Default in Solr is "false" (since 3.6) --> | ||
156 | + <!-- <useCompoundFile>false</useCompoundFile> --> | ||
157 | + | ||
158 | + <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene | ||
159 | + indexing for buffering added documents and deletions before they are | ||
160 | + flushed to the Directory. | ||
161 | + maxBufferedDocs sets a limit on the number of documents buffered | ||
162 | + before flushing. | ||
163 | + If both ramBufferSizeMB and maxBufferedDocs is set, then | ||
164 | + Lucene will flush based on whichever limit is hit first. --> | ||
165 | + <!-- <ramBufferSizeMB>100</ramBufferSizeMB> --> | ||
166 | + <!-- <maxBufferedDocs>1000</maxBufferedDocs> --> | ||
167 | + | ||
168 | + <!-- Expert: Merge Policy | ||
169 | + The Merge Policy in Lucene controls how merging of segments is done. | ||
170 | + The default since Solr/Lucene 3.3 is TieredMergePolicy. | ||
171 | + The default since Lucene 2.3 was the LogByteSizeMergePolicy, | ||
172 | + Even older versions of Lucene used LogDocMergePolicy. | ||
173 | + --> | ||
174 | + <!-- | ||
175 | + <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory"> | ||
176 | + <int name="maxMergeAtOnce">10</int> | ||
177 | + <int name="segmentsPerTier">10</int> | ||
178 | + <double name="noCFSRatio">0.1</double> | ||
179 | + </mergePolicyFactory> | ||
180 | + --> | ||
181 | + | ||
182 | + <!-- Expert: Merge Scheduler | ||
183 | + The Merge Scheduler in Lucene controls how merges are | ||
184 | + performed. The ConcurrentMergeScheduler (Lucene 2.3 default) | ||
185 | + can perform merges in the background using separate threads. | ||
186 | + The SerialMergeScheduler (Lucene 2.2 default) does not. | ||
187 | + --> | ||
188 | + <!-- | ||
189 | + <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/> | ||
190 | + --> | ||
191 | + | ||
192 | + <!-- LockFactory | ||
193 | + | ||
194 | + This option specifies which Lucene LockFactory implementation | ||
195 | + to use. | ||
196 | + | ||
197 | + single = SingleInstanceLockFactory - suggested for a | ||
198 | + read-only index or when there is no possibility of | ||
199 | + another process trying to modify the index. | ||
200 | + native = NativeFSLockFactory - uses OS native file locking. | ||
201 | + Do not use when multiple solr webapps in the same | ||
202 | + JVM are attempting to share a single index. | ||
203 | + simple = SimpleFSLockFactory - uses a plain file for locking | ||
204 | + | ||
205 | + Defaults: 'native' is default for Solr3.6 and later, otherwise | ||
206 | + 'simple' is the default | ||
207 | + | ||
208 | + More details on the nuances of each LockFactory... | ||
209 | + http://wiki.apache.org/lucene-java/AvailableLockFactories | ||
210 | + --> | ||
211 | + <lockType>${solr.lock.type:native}</lockType> | ||
212 | + | ||
213 | + <!-- Commit Deletion Policy | ||
214 | + Custom deletion policies can be specified here. The class must | ||
215 | + implement org.apache.lucene.index.IndexDeletionPolicy. | ||
216 | + | ||
217 | + The default Solr IndexDeletionPolicy implementation supports | ||
218 | + deleting index commit points on number of commits, age of | ||
219 | + commit point and optimized status. | ||
220 | + | ||
221 | + The latest commit point should always be preserved regardless | ||
222 | + of the criteria. | ||
223 | + --> | ||
224 | + <!-- | ||
225 | + <deletionPolicy class="solr.SolrDeletionPolicy"> | ||
226 | + --> | ||
227 | + <!-- The number of commit points to be kept --> | ||
228 | + <!-- <str name="maxCommitsToKeep">1</str> --> | ||
229 | + <!-- The number of optimized commit points to be kept --> | ||
230 | + <!-- <str name="maxOptimizedCommitsToKeep">0</str> --> | ||
231 | + <!-- | ||
232 | + Delete all commit points once they have reached the given age. | ||
233 | + Supports DateMathParser syntax e.g. | ||
234 | + --> | ||
235 | + <!-- | ||
236 | + <str name="maxCommitAge">30MINUTES</str> | ||
237 | + <str name="maxCommitAge">1DAY</str> | ||
238 | + --> | ||
239 | + <!-- | ||
240 | + </deletionPolicy> | ||
241 | + --> | ||
242 | + | ||
243 | + <!-- Lucene Infostream | ||
244 | + | ||
245 | + To aid in advanced debugging, Lucene provides an "InfoStream" | ||
246 | + of detailed information when indexing. | ||
247 | + | ||
248 | + Setting The value to true will instruct the underlying Lucene | ||
249 | + IndexWriter to write its debugging info the specified file | ||
250 | + --> | ||
251 | + <!-- <infoStream file="INFOSTREAM.txt">false</infoStream> --> | ||
252 | + </indexConfig> | ||
253 | + | ||
254 | + | ||
255 | + <!-- JMX | ||
256 | + | ||
257 | + This example enables JMX if and only if an existing MBeanServer | ||
258 | + is found, use this if you want to configure JMX through JVM | ||
259 | + parameters. Remove this to disable exposing Solr configuration | ||
260 | + and statistics to JMX. | ||
261 | + | ||
262 | + For more details see http://wiki.apache.org/solr/SolrJmx | ||
263 | + --> | ||
264 | + <jmx /> | ||
265 | + <!-- If you want to connect to a particular server, specify the | ||
266 | + agentId | ||
267 | + --> | ||
268 | + <!-- <jmx agentId="myAgent" /> --> | ||
269 | + <!-- If you want to start a new MBeanServer, specify the serviceUrl --> | ||
270 | + <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/> | ||
271 | + --> | ||
272 | + | ||
273 | + <!-- The default high-performance update handler --> | ||
274 | + <updateHandler class="solr.DirectUpdateHandler2"> | ||
275 | + | ||
276 | + <!-- Enables a transaction log, used for real-time get, durability, and | ||
277 | + and solr cloud replica recovery. The log can grow as big as | ||
278 | + uncommitted changes to the index, so use of a hard autoCommit | ||
279 | + is recommended (see below). | ||
280 | + "dir" - the target directory for transaction logs, defaults to the | ||
281 | + solr data directory. | ||
282 | + "numVersionBuckets" - sets the number of buckets used to keep | ||
283 | + track of max version values when checking for re-ordered | ||
284 | + updates; increase this value to reduce the cost of | ||
285 | + synchronizing access to version buckets during high-volume | ||
286 | + indexing, this requires 8 bytes (long) * numVersionBuckets | ||
287 | + of heap space per Solr core. | ||
288 | + --> | ||
289 | + <updateLog> | ||
290 | + <str name="dir">${solr.ulog.dir:}</str> | ||
291 | + <int name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}</int> | ||
292 | + </updateLog> | ||
293 | + | ||
294 | + <!-- AutoCommit | ||
295 | + | ||
296 | + Perform a hard commit automatically under certain conditions. | ||
297 | + Instead of enabling autoCommit, consider using "commitWithin" | ||
298 | + when adding documents. | ||
299 | + | ||
300 | + http://wiki.apache.org/solr/UpdateXmlMessages | ||
301 | + | ||
302 | + maxDocs - Maximum number of documents to add since the last | ||
303 | + commit before automatically triggering a new commit. | ||
304 | + | ||
305 | + maxTime - Maximum amount of time in ms that is allowed to pass | ||
306 | + since a document was added before automatically | ||
307 | + triggering a new commit. | ||
308 | + openSearcher - if false, the commit causes recent index changes | ||
309 | + to be flushed to stable storage, but does not cause a new | ||
310 | + searcher to be opened to make those changes visible. | ||
311 | + | ||
312 | + If the updateLog is enabled, then it's highly recommended to | ||
313 | + have some sort of hard autoCommit to limit the log size. | ||
314 | + --> | ||
315 | + <autoCommit> | ||
316 | + <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> | ||
317 | + <openSearcher>false</openSearcher> | ||
318 | + </autoCommit> | ||
319 | + | ||
320 | + <!-- softAutoCommit is like autoCommit except it causes a | ||
321 | + 'soft' commit which only ensures that changes are visible | ||
322 | + but does not ensure that data is synced to disk. This is | ||
323 | + faster and more near-realtime friendly than a hard commit. | ||
324 | + --> | ||
325 | + | ||
326 | + <autoSoftCommit> | ||
327 | + <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime> | ||
328 | + </autoSoftCommit> | ||
329 | + | ||
330 | + <!-- Update Related Event Listeners | ||
331 | + | ||
332 | + Various IndexWriter related events can trigger Listeners to | ||
333 | + take actions. | ||
334 | + | ||
335 | + postCommit - fired after every commit or optimize command | ||
336 | + postOptimize - fired after every optimize command | ||
337 | + --> | ||
338 | + <!-- The RunExecutableListener executes an external command from a | ||
339 | + hook such as postCommit or postOptimize. | ||
340 | + | ||
341 | + exe - the name of the executable to run | ||
342 | + dir - dir to use as the current working directory. (default=".") | ||
343 | + wait - the calling thread waits until the executable returns. | ||
344 | + (default="true") | ||
345 | + args - the arguments to pass to the program. (default is none) | ||
346 | + env - environment variables to set. (default is none) | ||
347 | + --> | ||
348 | + <!-- This example shows how RunExecutableListener could be used | ||
349 | + with the script based replication... | ||
350 | + http://wiki.apache.org/solr/CollectionDistribution | ||
351 | + --> | ||
352 | + <!-- | ||
353 | + <listener event="postCommit" class="solr.RunExecutableListener"> | ||
354 | + <str name="exe">solr/bin/snapshooter</str> | ||
355 | + <str name="dir">.</str> | ||
356 | + <bool name="wait">true</bool> | ||
357 | + <arr name="args"> <str>arg1</str> <str>arg2</str> </arr> | ||
358 | + <arr name="env"> <str>MYVAR=val1</str> </arr> | ||
359 | + </listener> | ||
360 | + --> | ||
361 | + | ||
362 | + </updateHandler> | ||
363 | + | ||
364 | + <!-- IndexReaderFactory | ||
365 | + | ||
366 | + Use the following format to specify a custom IndexReaderFactory, | ||
367 | + which allows for alternate IndexReader implementations. | ||
368 | + | ||
369 | + ** Experimental Feature ** | ||
370 | + | ||
371 | + Please note - Using a custom IndexReaderFactory may prevent | ||
372 | + certain other features from working. The API to | ||
373 | + IndexReaderFactory may change without warning or may even be | ||
374 | + removed from future releases if the problems cannot be | ||
375 | + resolved. | ||
376 | + | ||
377 | + | ||
378 | + ** Features that may not work with custom IndexReaderFactory ** | ||
379 | + | ||
380 | + The ReplicationHandler assumes a disk-resident index. Using a | ||
381 | + custom IndexReader implementation may cause incompatibility | ||
382 | + with ReplicationHandler and may cause replication to not work | ||
383 | + correctly. See SOLR-1366 for details. | ||
384 | + | ||
385 | + --> | ||
386 | + <!-- | ||
387 | + <indexReaderFactory name="IndexReaderFactory" class="package.class"> | ||
388 | + <str name="someArg">Some Value</str> | ||
389 | + </indexReaderFactory > | ||
390 | + --> | ||
391 | + | ||
392 | + <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
393 | + Query section - these settings control query time things like caches | ||
394 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> | ||
395 | + <query> | ||
396 | + <!-- Max Boolean Clauses | ||
397 | + | ||
398 | + Maximum number of clauses in each BooleanQuery, an exception | ||
399 | + is thrown if exceeded. | ||
400 | + | ||
401 | + ** WARNING ** | ||
402 | + | ||
403 | + This option actually modifies a global Lucene property that | ||
404 | + will affect all SolrCores. If multiple solrconfig.xml files | ||
405 | + disagree on this property, the value at any given moment will | ||
406 | + be based on the last SolrCore to be initialized. | ||
407 | + | ||
408 | + --> | ||
409 | + <maxBooleanClauses>1024</maxBooleanClauses> | ||
410 | + | ||
411 | + | ||
412 | + <!-- Solr Internal Query Caches | ||
413 | + | ||
414 | + There are two implementations of cache available for Solr, | ||
415 | + LRUCache, based on a synchronized LinkedHashMap, and | ||
416 | + FastLRUCache, based on a ConcurrentHashMap. | ||
417 | + | ||
418 | + FastLRUCache has faster gets and slower puts in single | ||
419 | + threaded operation and thus is generally faster than LRUCache | ||
420 | + when the hit ratio of the cache is high (> 75%), and may be | ||
421 | + faster under other scenarios on multi-cpu systems. | ||
422 | + --> | ||
423 | + | ||
424 | + <!-- Filter Cache | ||
425 | + | ||
426 | + Cache used by SolrIndexSearcher for filters (DocSets), | ||
427 | + unordered sets of *all* documents that match a query. When a | ||
428 | + new searcher is opened, its caches may be prepopulated or | ||
429 | + "autowarmed" using data from caches in the old searcher. | ||
430 | + autowarmCount is the number of items to prepopulate. For | ||
431 | + LRUCache, the autowarmed items will be the most recently | ||
432 | + accessed items. | ||
433 | + | ||
434 | + Parameters: | ||
435 | + class - the SolrCache implementation LRUCache or | ||
436 | + (LRUCache or FastLRUCache) | ||
437 | + size - the maximum number of entries in the cache | ||
438 | + initialSize - the initial capacity (number of entries) of | ||
439 | + the cache. (see java.util.HashMap) | ||
440 | + autowarmCount - the number of entries to prepopulate from | ||
441 | + and old cache. | ||
442 | + --> | ||
443 | + <filterCache class="solr.FastLRUCache" | ||
444 | + size="512" | ||
445 | + initialSize="512" | ||
446 | + autowarmCount="0"/> | ||
447 | + | ||
448 | + <!-- Query Result Cache | ||
449 | + | ||
450 | + Caches results of searches - ordered lists of document ids | ||
451 | + (DocList) based on a query, a sort, and the range of documents requested. | ||
452 | + Additional supported parameter by LRUCache: | ||
453 | + maxRamMB - the maximum amount of RAM (in MB) that this cache is allowed | ||
454 | + to occupy | ||
455 | + --> | ||
456 | + <queryResultCache class="solr.LRUCache" | ||
457 | + size="512" | ||
458 | + initialSize="512" | ||
459 | + autowarmCount="0"/> | ||
460 | + | ||
461 | + <!-- Document Cache | ||
462 | + | ||
463 | + Caches Lucene Document objects (the stored fields for each | ||
464 | + document). Since Lucene internal document ids are transient, | ||
465 | + this cache will not be autowarmed. | ||
466 | + --> | ||
467 | + <documentCache class="solr.LRUCache" | ||
468 | + size="512" | ||
469 | + initialSize="512" | ||
470 | + autowarmCount="0"/> | ||
471 | + | ||
472 | + <!-- custom cache currently used by block join --> | ||
473 | + <cache name="perSegFilter" | ||
474 | + class="solr.search.LRUCache" | ||
475 | + size="10" | ||
476 | + initialSize="0" | ||
477 | + autowarmCount="10" | ||
478 | + regenerator="solr.NoOpRegenerator" /> | ||
479 | + | ||
480 | + <!-- Field Value Cache | ||
481 | + | ||
482 | + Cache used to hold field values that are quickly accessible | ||
483 | + by document id. The fieldValueCache is created by default | ||
484 | + even if not configured here. | ||
485 | + --> | ||
486 | + <!-- | ||
487 | + <fieldValueCache class="solr.FastLRUCache" | ||
488 | + size="512" | ||
489 | + autowarmCount="128" | ||
490 | + showItems="32" /> | ||
491 | + --> | ||
492 | + | ||
493 | + <!-- Custom Cache | ||
494 | + | ||
495 | + Example of a generic cache. These caches may be accessed by | ||
496 | + name through SolrIndexSearcher.getCache(),cacheLookup(), and | ||
497 | + cacheInsert(). The purpose is to enable easy caching of | ||
498 | + user/application level data. The regenerator argument should | ||
499 | + be specified as an implementation of solr.CacheRegenerator | ||
500 | + if autowarming is desired. | ||
501 | + --> | ||
502 | + <!-- | ||
503 | + <cache name="myUserCache" | ||
504 | + class="solr.LRUCache" | ||
505 | + size="4096" | ||
506 | + initialSize="1024" | ||
507 | + autowarmCount="1024" | ||
508 | + regenerator="com.mycompany.MyRegenerator" | ||
509 | + /> | ||
510 | + --> | ||
511 | + | ||
512 | + | ||
513 | + <!-- Lazy Field Loading | ||
514 | + | ||
515 | + If true, stored fields that are not requested will be loaded | ||
516 | + lazily. This can result in a significant speed improvement | ||
517 | + if the usual case is to not load all stored fields, | ||
518 | + especially if the skipped fields are large compressed text | ||
519 | + fields. | ||
520 | + --> | ||
521 | + <enableLazyFieldLoading>true</enableLazyFieldLoading> | ||
522 | + | ||
523 | + <!-- Use Filter For Sorted Query | ||
524 | + | ||
525 | + A possible optimization that attempts to use a filter to | ||
526 | + satisfy a search. If the requested sort does not include | ||
527 | + score, then the filterCache will be checked for a filter | ||
528 | + matching the query. If found, the filter will be used as the | ||
529 | + source of document ids, and then the sort will be applied to | ||
530 | + that. | ||
531 | + | ||
532 | + For most situations, this will not be useful unless you | ||
533 | + frequently get the same search repeatedly with different sort | ||
534 | + options, and none of them ever use "score" | ||
535 | + --> | ||
536 | + <!-- | ||
537 | + <useFilterForSortedQuery>true</useFilterForSortedQuery> | ||
538 | + --> | ||
539 | + | ||
540 | + <!-- Result Window Size | ||
541 | + | ||
542 | + An optimization for use with the queryResultCache. When a search | ||
543 | + is requested, a superset of the requested number of document ids | ||
544 | + are collected. For example, if a search for a particular query | ||
545 | + requests matching documents 10 through 19, and queryWindowSize is 50, | ||
546 | + then documents 0 through 49 will be collected and cached. Any further | ||
547 | + requests in that range can be satisfied via the cache. | ||
548 | + --> | ||
549 | + <queryResultWindowSize>20</queryResultWindowSize> | ||
550 | + | ||
551 | + <!-- Maximum number of documents to cache for any entry in the | ||
552 | + queryResultCache. | ||
553 | + --> | ||
554 | + <queryResultMaxDocsCached>200</queryResultMaxDocsCached> | ||
555 | + | ||
556 | + <!-- Query Related Event Listeners | ||
557 | + | ||
558 | + Various IndexSearcher related events can trigger Listeners to | ||
559 | + take actions. | ||
560 | + | ||
561 | + newSearcher - fired whenever a new searcher is being prepared | ||
562 | + and there is a current searcher handling requests (aka | ||
563 | + registered). It can be used to prime certain caches to | ||
564 | + prevent long request times for certain requests. | ||
565 | + | ||
566 | + firstSearcher - fired whenever a new searcher is being | ||
567 | + prepared but there is no current registered searcher to handle | ||
568 | + requests or to gain autowarming data from. | ||
569 | + | ||
570 | + | ||
571 | + --> | ||
572 | + <!-- QuerySenderListener takes an array of NamedList and executes a | ||
573 | + local query request for each NamedList in sequence. | ||
574 | + --> | ||
575 | + <listener event="newSearcher" class="solr.QuerySenderListener"> | ||
576 | + <arr name="queries"> | ||
577 | + <!-- | ||
578 | + <lst><str name="q">solr</str><str name="sort">price asc</str></lst> | ||
579 | + <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst> | ||
580 | + --> | ||
581 | + </arr> | ||
582 | + </listener> | ||
583 | + <listener event="firstSearcher" class="solr.QuerySenderListener"> | ||
584 | + <arr name="queries"> | ||
585 | + <!-- | ||
586 | + <lst> | ||
587 | + <str name="q">static firstSearcher warming in solrconfig.xml</str> | ||
588 | + </lst> | ||
589 | + --> | ||
590 | + </arr> | ||
591 | + </listener> | ||
592 | + | ||
593 | + <!-- Use Cold Searcher | ||
594 | + | ||
595 | + If a search request comes in and there is no current | ||
596 | + registered searcher, then immediately register the still | ||
597 | + warming searcher and use it. If "false" then all requests | ||
598 | + will block until the first searcher is done warming. | ||
599 | + --> | ||
600 | + <useColdSearcher>false</useColdSearcher> | ||
601 | + | ||
602 | + <!-- Max Warming Searchers | ||
603 | + | ||
604 | + Maximum number of searchers that may be warming in the | ||
605 | + background concurrently. An error is returned if this limit | ||
606 | + is exceeded. | ||
607 | + | ||
608 | + Recommend values of 1-2 for read-only slaves, higher for | ||
609 | + masters w/o cache warming. | ||
610 | + --> | ||
611 | + <maxWarmingSearchers>2</maxWarmingSearchers> | ||
612 | + | ||
613 | + </query> | ||
614 | + | ||
615 | + | ||
616 | + <!-- Request Dispatcher | ||
617 | + | ||
618 | + This section contains instructions for how the SolrDispatchFilter | ||
619 | + should behave when processing requests for this SolrCore. | ||
620 | + | ||
621 | + handleSelect is a legacy option that affects the behavior of requests | ||
622 | + such as /select?qt=XXX | ||
623 | + | ||
624 | + handleSelect="true" will cause the SolrDispatchFilter to process | ||
625 | + the request and dispatch the query to a handler specified by the | ||
626 | + "qt" param, assuming "/select" isn't already registered. | ||
627 | + | ||
628 | + handleSelect="false" will cause the SolrDispatchFilter to | ||
629 | + ignore "/select" requests, resulting in a 404 unless a handler | ||
630 | + is explicitly registered with the name "/select" | ||
631 | + | ||
632 | + handleSelect="true" is not recommended for new users, but is the default | ||
633 | + for backwards compatibility | ||
634 | + --> | ||
635 | + <requestDispatcher handleSelect="false" > | ||
636 | + <!-- Request Parsing | ||
637 | + | ||
638 | + These settings indicate how Solr Requests may be parsed, and | ||
639 | + what restrictions may be placed on the ContentStreams from | ||
640 | + those requests | ||
641 | + | ||
642 | + enableRemoteStreaming - enables use of the stream.file | ||
643 | + and stream.url parameters for specifying remote streams. | ||
644 | + | ||
645 | + multipartUploadLimitInKB - specifies the max size (in KiB) of | ||
646 | + Multipart File Uploads that Solr will allow in a Request. | ||
647 | + | ||
648 | + formdataUploadLimitInKB - specifies the max size (in KiB) of | ||
649 | + form data (application/x-www-form-urlencoded) sent via | ||
650 | + POST. You can use POST to pass request parameters not | ||
651 | + fitting into the URL. | ||
652 | + | ||
653 | + addHttpRequestToContext - if set to true, it will instruct | ||
654 | + the requestParsers to include the original HttpServletRequest | ||
655 | + object in the context map of the SolrQueryRequest under the | ||
656 | + key "httpRequest". It will not be used by any of the existing | ||
657 | + Solr components, but may be useful when developing custom | ||
658 | + plugins. | ||
659 | + | ||
660 | + *** WARNING *** | ||
661 | + The settings below authorize Solr to fetch remote files, You | ||
662 | + should make sure your system has some authentication before | ||
663 | + using enableRemoteStreaming="true" | ||
664 | + | ||
665 | + --> | ||
666 | + <requestParsers enableRemoteStreaming="true" | ||
667 | + multipartUploadLimitInKB="2048000" | ||
668 | + formdataUploadLimitInKB="2048" | ||
669 | + addHttpRequestToContext="false"/> | ||
670 | + | ||
671 | + <!-- HTTP Caching | ||
672 | + | ||
673 | + Set HTTP caching related parameters (for proxy caches and clients). | ||
674 | + | ||
675 | + The options below instruct Solr not to output any HTTP Caching | ||
676 | + related headers | ||
677 | + --> | ||
678 | + <httpCaching never304="true" /> | ||
679 | + <!-- If you include a <cacheControl> directive, it will be used to | ||
680 | + generate a Cache-Control header (as well as an Expires header | ||
681 | + if the value contains "max-age=") | ||
682 | + | ||
683 | + By default, no Cache-Control header is generated. | ||
684 | + | ||
685 | + You can use the <cacheControl> option even if you have set | ||
686 | + never304="true" | ||
687 | + --> | ||
688 | + <!-- | ||
689 | + <httpCaching never304="true" > | ||
690 | + <cacheControl>max-age=30, public</cacheControl> | ||
691 | + </httpCaching> | ||
692 | + --> | ||
693 | + <!-- To enable Solr to respond with automatically generated HTTP | ||
694 | + Caching headers, and to response to Cache Validation requests | ||
695 | + correctly, set the value of never304="false" | ||
696 | + | ||
697 | + This will cause Solr to generate Last-Modified and ETag | ||
698 | + headers based on the properties of the Index. | ||
699 | + | ||
700 | + The following options can also be specified to affect the | ||
701 | + values of these headers... | ||
702 | + | ||
703 | + lastModFrom - the default value is "openTime" which means the | ||
704 | + Last-Modified value (and validation against If-Modified-Since | ||
705 | + requests) will all be relative to when the current Searcher | ||
706 | + was opened. You can change it to lastModFrom="dirLastMod" if | ||
707 | + you want the value to exactly correspond to when the physical | ||
708 | + index was last modified. | ||
709 | + | ||
710 | + etagSeed="..." is an option you can change to force the ETag | ||
711 | + header (and validation against If-None-Match requests) to be | ||
712 | + different even if the index has not changed (ie: when making | ||
713 | + significant changes to your config file) | ||
714 | + | ||
715 | + (lastModifiedFrom and etagSeed are both ignored if you use | ||
716 | + the never304="true" option) | ||
717 | + --> | ||
718 | + <!-- | ||
719 | + <httpCaching lastModifiedFrom="openTime" | ||
720 | + etagSeed="Solr"> | ||
721 | + <cacheControl>max-age=30, public</cacheControl> | ||
722 | + </httpCaching> | ||
723 | + --> | ||
724 | + </requestDispatcher> | ||
725 | + | ||
726 | + <!-- Request Handlers | ||
727 | + | ||
728 | + http://wiki.apache.org/solr/SolrRequestHandler | ||
729 | + | ||
730 | + Incoming queries will be dispatched to a specific handler by name | ||
731 | + based on the path specified in the request. | ||
732 | + | ||
733 | + Legacy behavior: If the request path uses "/select" but no Request | ||
734 | + Handler has that name, and if handleSelect="true" has been specified in | ||
735 | + the requestDispatcher, then the Request Handler is dispatched based on | ||
736 | + the qt parameter. Handlers without a leading '/' are accessed this way | ||
737 | + like so: http://host/app/[core/]select?qt=name If no qt is | ||
738 | + given, then the requestHandler that declares default="true" will be | ||
739 | + used or the one named "standard". | ||
740 | + | ||
741 | + If a Request Handler is declared with startup="lazy", then it will | ||
742 | + not be initialized until the first request that uses it. | ||
743 | + | ||
744 | + --> | ||
745 | + <!-- SearchHandler | ||
746 | + | ||
747 | + http://wiki.apache.org/solr/SearchHandler | ||
748 | + | ||
749 | + For processing Search Queries, the primary Request Handler | ||
750 | + provided with Solr is "SearchHandler" It delegates to a sequent | ||
751 | + of SearchComponents (see below) and supports distributed | ||
752 | + queries across multiple shards | ||
753 | + --> | ||
754 | + <requestHandler name="/select" class="solr.SearchHandler"> | ||
755 | + <!-- default values for query parameters can be specified, these | ||
756 | + will be overridden by parameters in the request | ||
757 | + --> | ||
758 | + <lst name="defaults"> | ||
759 | + <str name="echoParams">explicit</str> | ||
760 | + <int name="rows">10</int> | ||
761 | + <!-- <str name="df">text</str> --> | ||
762 | + </lst> | ||
763 | + <!-- In addition to defaults, "appends" params can be specified | ||
764 | + to identify values which should be appended to the list of | ||
765 | + multi-val params from the query (or the existing "defaults"). | ||
766 | + --> | ||
767 | + <!-- In this example, the param "fq=instock:true" would be appended to | ||
768 | + any query time fq params the user may specify, as a mechanism for | ||
769 | + partitioning the index, independent of any user selected filtering | ||
770 | + that may also be desired (perhaps as a result of faceted searching). | ||
771 | + | ||
772 | + NOTE: there is *absolutely* nothing a client can do to prevent these | ||
773 | + "appends" values from being used, so don't use this mechanism | ||
774 | + unless you are sure you always want it. | ||
775 | + --> | ||
776 | + <!-- | ||
777 | + <lst name="appends"> | ||
778 | + <str name="fq">inStock:true</str> | ||
779 | + </lst> | ||
780 | + --> | ||
781 | + <!-- "invariants" are a way of letting the Solr maintainer lock down | ||
782 | + the options available to Solr clients. Any params values | ||
783 | + specified here are used regardless of what values may be specified | ||
784 | + in either the query, the "defaults", or the "appends" params. | ||
785 | + | ||
786 | + In this example, the facet.field and facet.query params would | ||
787 | + be fixed, limiting the facets clients can use. Faceting is | ||
788 | + not turned on by default - but if the client does specify | ||
789 | + facet=true in the request, these are the only facets they | ||
790 | + will be able to see counts for; regardless of what other | ||
791 | + facet.field or facet.query params they may specify. | ||
792 | + | ||
793 | + NOTE: there is *absolutely* nothing a client can do to prevent these | ||
794 | + "invariants" values from being used, so don't use this mechanism | ||
795 | + unless you are sure you always want it. | ||
796 | + --> | ||
797 | + <!-- | ||
798 | + <lst name="invariants"> | ||
799 | + <str name="facet.field">cat</str> | ||
800 | + <str name="facet.field">manu_exact</str> | ||
801 | + <str name="facet.query">price:[* TO 500]</str> | ||
802 | + <str name="facet.query">price:[500 TO *]</str> | ||
803 | + </lst> | ||
804 | + --> | ||
805 | + <!-- If the default list of SearchComponents is not desired, that | ||
806 | + list can either be overridden completely, or components can be | ||
807 | + prepended or appended to the default list. (see below) | ||
808 | + --> | ||
809 | + <!-- | ||
810 | + <arr name="components"> | ||
811 | + <str>nameOfCustomComponent1</str> | ||
812 | + <str>nameOfCustomComponent2</str> | ||
813 | + </arr> | ||
814 | + --> | ||
815 | + </requestHandler> | ||
816 | + | ||
817 | + <!-- A request handler that returns indented JSON by default --> | ||
818 | + <requestHandler name="/query" class="solr.SearchHandler"> | ||
819 | + <lst name="defaults"> | ||
820 | + <str name="echoParams">explicit</str> | ||
821 | + <str name="wt">json</str> | ||
822 | + <str name="indent">true</str> | ||
823 | + </lst> | ||
824 | + </requestHandler> | ||
825 | + | ||
826 | + | ||
827 | + <!-- A Robust Example | ||
828 | + | ||
829 | + This example SearchHandler declaration shows off usage of the | ||
830 | + SearchHandler with many defaults declared | ||
831 | + | ||
832 | + Note that multiple instances of the same Request Handler | ||
833 | + (SearchHandler) can be registered multiple times with different | ||
834 | + names (and different init parameters) | ||
835 | + --> | ||
836 | + <requestHandler name="/browse" class="solr.SearchHandler" useParams="query,facets,velocity,browse"> | ||
837 | + <lst name="defaults"> | ||
838 | + <str name="echoParams">explicit</str> | ||
839 | + </lst> | ||
840 | + </requestHandler> | ||
841 | + | ||
842 | + <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse"> | ||
843 | + <lst name="defaults"> | ||
844 | + <str name="df">_text_</str> | ||
845 | + </lst> | ||
846 | + </initParams> | ||
847 | + | ||
848 | + <initParams path="/update/**"> | ||
849 | + <lst name="defaults"> | ||
850 | + <str name="update.chain">add-unknown-fields-to-the-schema</str> | ||
851 | + </lst> | ||
852 | + </initParams> | ||
853 | + | ||
854 | + <!-- Solr Cell Update Request Handler | ||
855 | + | ||
856 | + http://wiki.apache.org/solr/ExtractingRequestHandler | ||
857 | + | ||
858 | + --> | ||
859 | + <requestHandler name="/update/extract" | ||
860 | + startup="lazy" | ||
861 | + class="solr.extraction.ExtractingRequestHandler" > | ||
862 | + <lst name="defaults"> | ||
863 | + <str name="lowernames">true</str> | ||
864 | + <str name="fmap.meta">ignored_</str> | ||
865 | + <str name="fmap.content">_text_</str> | ||
866 | + </lst> | ||
867 | + </requestHandler> | ||
868 | + | ||
869 | + <!-- Search Components | ||
870 | + | ||
871 | + Search components are registered to SolrCore and used by | ||
872 | + instances of SearchHandler (which can access them by name) | ||
873 | + | ||
874 | + By default, the following components are available: | ||
875 | + | ||
876 | + <searchComponent name="query" class="solr.QueryComponent" /> | ||
877 | + <searchComponent name="facet" class="solr.FacetComponent" /> | ||
878 | + <searchComponent name="mlt" class="solr.MoreLikeThisComponent" /> | ||
879 | + <searchComponent name="highlight" class="solr.HighlightComponent" /> | ||
880 | + <searchComponent name="stats" class="solr.StatsComponent" /> | ||
881 | + <searchComponent name="debug" class="solr.DebugComponent" /> | ||
882 | + | ||
883 | + Default configuration in a requestHandler would look like: | ||
884 | + | ||
885 | + <arr name="components"> | ||
886 | + <str>query</str> | ||
887 | + <str>facet</str> | ||
888 | + <str>mlt</str> | ||
889 | + <str>highlight</str> | ||
890 | + <str>stats</str> | ||
891 | + <str>debug</str> | ||
892 | + </arr> | ||
893 | + | ||
894 | + If you register a searchComponent to one of the standard names, | ||
895 | + that will be used instead of the default. | ||
896 | + | ||
897 | + To insert components before or after the 'standard' components, use: | ||
898 | + | ||
899 | + <arr name="first-components"> | ||
900 | + <str>myFirstComponentName</str> | ||
901 | + </arr> | ||
902 | + | ||
903 | + <arr name="last-components"> | ||
904 | + <str>myLastComponentName</str> | ||
905 | + </arr> | ||
906 | + | ||
907 | + NOTE: The component registered with the name "debug" will | ||
908 | + always be executed after the "last-components" | ||
909 | + | ||
910 | + --> | ||
911 | + | ||
912 | + <!-- Spell Check | ||
913 | + | ||
914 | + The spell check component can return a list of alternative spelling | ||
915 | + suggestions. | ||
916 | + | ||
917 | + http://wiki.apache.org/solr/SpellCheckComponent | ||
918 | + --> | ||
919 | + <searchComponent name="spellcheck" class="solr.SpellCheckComponent"> | ||
920 | + | ||
921 | + <str name="queryAnalyzerFieldType">text_general</str> | ||
922 | + | ||
923 | + <!-- Multiple "Spell Checkers" can be declared and used by this | ||
924 | + component | ||
925 | + --> | ||
926 | + | ||
927 | + <!-- a spellchecker built from a field of the main index --> | ||
928 | + <lst name="spellchecker"> | ||
929 | + <str name="name">default</str> | ||
930 | + <str name="field">_text_</str> | ||
931 | + <str name="classname">solr.DirectSolrSpellChecker</str> | ||
932 | + <!-- the spellcheck distance measure used, the default is the internal levenshtein --> | ||
933 | + <str name="distanceMeasure">internal</str> | ||
934 | + <!-- minimum accuracy needed to be considered a valid spellcheck suggestion --> | ||
935 | + <float name="accuracy">0.5</float> | ||
936 | + <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 --> | ||
937 | + <int name="maxEdits">2</int> | ||
938 | + <!-- the minimum shared prefix when enumerating terms --> | ||
939 | + <int name="minPrefix">1</int> | ||
940 | + <!-- maximum number of inspections per result. --> | ||
941 | + <int name="maxInspections">5</int> | ||
942 | + <!-- minimum length of a query term to be considered for correction --> | ||
943 | + <int name="minQueryLength">4</int> | ||
944 | + <!-- maximum threshold of documents a query term can appear to be considered for correction --> | ||
945 | + <float name="maxQueryFrequency">0.01</float> | ||
946 | + <!-- uncomment this to require suggestions to occur in 1% of the documents | ||
947 | + <float name="thresholdTokenFrequency">.01</float> | ||
948 | + --> | ||
949 | + </lst> | ||
950 | + | ||
951 | + <!-- a spellchecker that can break or combine words. See "/spell" handler below for usage --> | ||
952 | + <!-- | ||
953 | + <lst name="spellchecker"> | ||
954 | + <str name="name">wordbreak</str> | ||
955 | + <str name="classname">solr.WordBreakSolrSpellChecker</str> | ||
956 | + <str name="field">name</str> | ||
957 | + <str name="combineWords">true</str> | ||
958 | + <str name="breakWords">true</str> | ||
959 | + <int name="maxChanges">10</int> | ||
960 | + </lst> | ||
961 | + --> | ||
962 | + </searchComponent> | ||
963 | + | ||
964 | + <!-- A request handler for demonstrating the spellcheck component. | ||
965 | + | ||
966 | + NOTE: This is purely as an example. The whole purpose of the | ||
967 | + SpellCheckComponent is to hook it into the request handler that | ||
968 | + handles your normal user queries so that a separate request is | ||
969 | + not needed to get suggestions. | ||
970 | + | ||
971 | + IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS | ||
972 | + NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM! | ||
973 | + | ||
974 | + See http://wiki.apache.org/solr/SpellCheckComponent for details | ||
975 | + on the request parameters. | ||
976 | + --> | ||
977 | + <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy"> | ||
978 | + <lst name="defaults"> | ||
979 | + <!-- Solr will use suggestions from both the 'default' spellchecker | ||
980 | + and from the 'wordbreak' spellchecker and combine them. | ||
981 | + collations (re-written queries) can include a combination of | ||
982 | + corrections from both spellcheckers --> | ||
983 | + <str name="spellcheck.dictionary">default</str> | ||
984 | + <str name="spellcheck">on</str> | ||
985 | + <str name="spellcheck.extendedResults">true</str> | ||
986 | + <str name="spellcheck.count">10</str> | ||
987 | + <str name="spellcheck.alternativeTermCount">5</str> | ||
988 | + <str name="spellcheck.maxResultsForSuggest">5</str> | ||
989 | + <str name="spellcheck.collate">true</str> | ||
990 | + <str name="spellcheck.collateExtendedResults">true</str> | ||
991 | + <str name="spellcheck.maxCollationTries">10</str> | ||
992 | + <str name="spellcheck.maxCollations">5</str> | ||
993 | + </lst> | ||
994 | + <arr name="last-components"> | ||
995 | + <str>spellcheck</str> | ||
996 | + </arr> | ||
997 | + </requestHandler> | ||
998 | + | ||
999 | + <!-- Term Vector Component | ||
1000 | + | ||
1001 | + http://wiki.apache.org/solr/TermVectorComponent | ||
1002 | + --> | ||
1003 | + <searchComponent name="tvComponent" class="solr.TermVectorComponent"/> | ||
1004 | + | ||
1005 | + <!-- A request handler for demonstrating the term vector component | ||
1006 | + | ||
1007 | + This is purely as an example. | ||
1008 | + | ||
1009 | + In reality you will likely want to add the component to your | ||
1010 | + already specified request handlers. | ||
1011 | + --> | ||
1012 | + <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy"> | ||
1013 | + <lst name="defaults"> | ||
1014 | + <bool name="tv">true</bool> | ||
1015 | + </lst> | ||
1016 | + <arr name="last-components"> | ||
1017 | + <str>tvComponent</str> | ||
1018 | + </arr> | ||
1019 | + </requestHandler> | ||
1020 | + | ||
1021 | + <!-- Clustering Component. (Omitted here. See the default Solr example for a typical configuration.) --> | ||
1022 | + | ||
1023 | + <!-- Terms Component | ||
1024 | + | ||
1025 | + http://wiki.apache.org/solr/TermsComponent | ||
1026 | + | ||
1027 | + A component to return terms and document frequency of those | ||
1028 | + terms | ||
1029 | + --> | ||
1030 | + <searchComponent name="terms" class="solr.TermsComponent"/> | ||
1031 | + | ||
1032 | + <!-- A request handler for demonstrating the terms component --> | ||
1033 | + <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy"> | ||
1034 | + <lst name="defaults"> | ||
1035 | + <bool name="terms">true</bool> | ||
1036 | + <bool name="distrib">false</bool> | ||
1037 | + </lst> | ||
1038 | + <arr name="components"> | ||
1039 | + <str>terms</str> | ||
1040 | + </arr> | ||
1041 | + </requestHandler> | ||
1042 | + | ||
1043 | + | ||
1044 | + <!-- Query Elevation Component | ||
1045 | + | ||
1046 | + http://wiki.apache.org/solr/QueryElevationComponent | ||
1047 | + | ||
1048 | + a search component that enables you to configure the top | ||
1049 | + results for a given query regardless of the normal lucene | ||
1050 | + scoring. | ||
1051 | + --> | ||
1052 | + <searchComponent name="elevator" class="solr.QueryElevationComponent" > | ||
1053 | + <!-- pick a fieldType to analyze queries --> | ||
1054 | + <str name="queryFieldType">string</str> | ||
1055 | + <str name="config-file">elevate.xml</str> | ||
1056 | + </searchComponent> | ||
1057 | + | ||
1058 | + <!-- A request handler for demonstrating the elevator component --> | ||
1059 | + <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy"> | ||
1060 | + <lst name="defaults"> | ||
1061 | + <str name="echoParams">explicit</str> | ||
1062 | + </lst> | ||
1063 | + <arr name="last-components"> | ||
1064 | + <str>elevator</str> | ||
1065 | + </arr> | ||
1066 | + </requestHandler> | ||
1067 | + | ||
1068 | + <!-- Highlighting Component | ||
1069 | + | ||
1070 | + http://wiki.apache.org/solr/HighlightingParameters | ||
1071 | + --> | ||
1072 | + <searchComponent class="solr.HighlightComponent" name="highlight"> | ||
1073 | + <highlighting> | ||
1074 | + <!-- Configure the standard fragmenter --> | ||
1075 | + <!-- This could most likely be commented out in the "default" case --> | ||
1076 | + <fragmenter name="gap" | ||
1077 | + default="true" | ||
1078 | + class="solr.highlight.GapFragmenter"> | ||
1079 | + <lst name="defaults"> | ||
1080 | + <int name="hl.fragsize">100</int> | ||
1081 | + </lst> | ||
1082 | + </fragmenter> | ||
1083 | + | ||
1084 | + <!-- A regular-expression-based fragmenter | ||
1085 | + (for sentence extraction) | ||
1086 | + --> | ||
1087 | + <fragmenter name="regex" | ||
1088 | + class="solr.highlight.RegexFragmenter"> | ||
1089 | + <lst name="defaults"> | ||
1090 | + <!-- slightly smaller fragsizes work better because of slop --> | ||
1091 | + <int name="hl.fragsize">70</int> | ||
1092 | + <!-- allow 50% slop on fragment sizes --> | ||
1093 | + <float name="hl.regex.slop">0.5</float> | ||
1094 | + <!-- a basic sentence pattern --> | ||
1095 | + <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str> | ||
1096 | + </lst> | ||
1097 | + </fragmenter> | ||
1098 | + | ||
1099 | + <!-- Configure the standard formatter --> | ||
1100 | + <formatter name="html" | ||
1101 | + default="true" | ||
1102 | + class="solr.highlight.HtmlFormatter"> | ||
1103 | + <lst name="defaults"> | ||
1104 | + <str name="hl.simple.pre"><![CDATA[<em>]]></str> | ||
1105 | + <str name="hl.simple.post"><![CDATA[</em>]]></str> | ||
1106 | + </lst> | ||
1107 | + </formatter> | ||
1108 | + | ||
1109 | + <!-- Configure the standard encoder --> | ||
1110 | + <encoder name="html" | ||
1111 | + class="solr.highlight.HtmlEncoder" /> | ||
1112 | + | ||
1113 | + <!-- Configure the standard fragListBuilder --> | ||
1114 | + <fragListBuilder name="simple" | ||
1115 | + class="solr.highlight.SimpleFragListBuilder"/> | ||
1116 | + | ||
1117 | + <!-- Configure the single fragListBuilder --> | ||
1118 | + <fragListBuilder name="single" | ||
1119 | + class="solr.highlight.SingleFragListBuilder"/> | ||
1120 | + | ||
1121 | + <!-- Configure the weighted fragListBuilder --> | ||
1122 | + <fragListBuilder name="weighted" | ||
1123 | + default="true" | ||
1124 | + class="solr.highlight.WeightedFragListBuilder"/> | ||
1125 | + | ||
1126 | + <!-- default tag FragmentsBuilder --> | ||
1127 | + <fragmentsBuilder name="default" | ||
1128 | + default="true" | ||
1129 | + class="solr.highlight.ScoreOrderFragmentsBuilder"> | ||
1130 | + <!-- | ||
1131 | + <lst name="defaults"> | ||
1132 | + <str name="hl.multiValuedSeparatorChar">/</str> | ||
1133 | + </lst> | ||
1134 | + --> | ||
1135 | + </fragmentsBuilder> | ||
1136 | + | ||
1137 | + <!-- multi-colored tag FragmentsBuilder --> | ||
1138 | + <fragmentsBuilder name="colored" | ||
1139 | + class="solr.highlight.ScoreOrderFragmentsBuilder"> | ||
1140 | + <lst name="defaults"> | ||
1141 | + <str name="hl.tag.pre"><![CDATA[ | ||
1142 | + <b style="background:yellow">,<b style="background:lawgreen">, | ||
1143 | + <b style="background:aquamarine">,<b style="background:magenta">, | ||
1144 | + <b style="background:palegreen">,<b style="background:coral">, | ||
1145 | + <b style="background:wheat">,<b style="background:khaki">, | ||
1146 | + <b style="background:lime">,<b style="background:deepskyblue">]]></str> | ||
1147 | + <str name="hl.tag.post"><![CDATA[</b>]]></str> | ||
1148 | + </lst> | ||
1149 | + </fragmentsBuilder> | ||
1150 | + | ||
1151 | + <boundaryScanner name="default" | ||
1152 | + default="true" | ||
1153 | + class="solr.highlight.SimpleBoundaryScanner"> | ||
1154 | + <lst name="defaults"> | ||
1155 | + <str name="hl.bs.maxScan">10</str> | ||
1156 | + <str name="hl.bs.chars">.,!? 	 </str> | ||
1157 | + </lst> | ||
1158 | + </boundaryScanner> | ||
1159 | + | ||
1160 | + <boundaryScanner name="breakIterator" | ||
1161 | + class="solr.highlight.BreakIteratorBoundaryScanner"> | ||
1162 | + <lst name="defaults"> | ||
1163 | + <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE --> | ||
1164 | + <str name="hl.bs.type">WORD</str> | ||
1165 | + <!-- language and country are used when constructing Locale object. --> | ||
1166 | + <!-- And the Locale object will be used when getting instance of BreakIterator --> | ||
1167 | + <str name="hl.bs.language">en</str> | ||
1168 | + <str name="hl.bs.country">US</str> | ||
1169 | + </lst> | ||
1170 | + </boundaryScanner> | ||
1171 | + </highlighting> | ||
1172 | + </searchComponent> | ||
1173 | + | ||
1174 | + <!-- Update Processors | ||
1175 | + | ||
1176 | + Chains of Update Processor Factories for dealing with Update | ||
1177 | + Requests can be declared, and then used by name in Update | ||
1178 | + Request Processors | ||
1179 | + | ||
1180 | + http://wiki.apache.org/solr/UpdateRequestProcessor | ||
1181 | + | ||
1182 | + --> | ||
1183 | + | ||
1184 | + <!-- Add unknown fields to the schema | ||
1185 | + | ||
1186 | + An example field type guessing update processor that will | ||
1187 | + attempt to parse string-typed field values as Booleans, Longs, | ||
1188 | + Doubles, or Dates, and then add schema fields with the guessed | ||
1189 | + field types. | ||
1190 | + | ||
1191 | + This requires that the schema is both managed and mutable, by | ||
1192 | + declaring schemaFactory as ManagedIndexSchemaFactory, with | ||
1193 | + mutable specified as true. | ||
1194 | + | ||
1195 | + See http://wiki.apache.org/solr/GuessingFieldTypes | ||
1196 | + --> | ||
1197 | + <updateRequestProcessorChain name="add-unknown-fields-to-the-schema"> | ||
1198 | + <!-- UUIDUpdateProcessorFactory will generate an id if none is present in the incoming document --> | ||
1199 | + <processor class="solr.UUIDUpdateProcessorFactory" /> | ||
1200 | + | ||
1201 | + <processor class="solr.LogUpdateProcessorFactory"/> | ||
1202 | + <processor class="solr.DistributedUpdateProcessorFactory"/> | ||
1203 | + <processor class="solr.RemoveBlankFieldUpdateProcessorFactory"/> | ||
1204 | + <processor class="solr.FieldNameMutatingUpdateProcessorFactory"> | ||
1205 | + <str name="pattern">[^\w-\.]</str> | ||
1206 | + <str name="replacement">_</str> | ||
1207 | + </processor> | ||
1208 | + <processor class="solr.ParseBooleanFieldUpdateProcessorFactory"/> | ||
1209 | + <processor class="solr.ParseLongFieldUpdateProcessorFactory"/> | ||
1210 | + <processor class="solr.ParseDoubleFieldUpdateProcessorFactory"/> | ||
1211 | + <processor class="solr.ParseDateFieldUpdateProcessorFactory"> | ||
1212 | + <arr name="format"> | ||
1213 | + <str>yyyy-MM-dd'T'HH:mm:ss.SSSZ</str> | ||
1214 | + <str>yyyy-MM-dd'T'HH:mm:ss,SSSZ</str> | ||
1215 | + <str>yyyy-MM-dd'T'HH:mm:ss.SSS</str> | ||
1216 | + <str>yyyy-MM-dd'T'HH:mm:ss,SSS</str> | ||
1217 | + <str>yyyy-MM-dd'T'HH:mm:ssZ</str> | ||
1218 | + <str>yyyy-MM-dd'T'HH:mm:ss</str> | ||
1219 | + <str>yyyy-MM-dd'T'HH:mmZ</str> | ||
1220 | + <str>yyyy-MM-dd'T'HH:mm</str> | ||
1221 | + <str>yyyy-MM-dd HH:mm:ss.SSSZ</str> | ||
1222 | + <str>yyyy-MM-dd HH:mm:ss,SSSZ</str> | ||
1223 | + <str>yyyy-MM-dd HH:mm:ss.SSS</str> | ||
1224 | + <str>yyyy-MM-dd HH:mm:ss,SSS</str> | ||
1225 | + <str>yyyy-MM-dd HH:mm:ssZ</str> | ||
1226 | + <str>yyyy-MM-dd HH:mm:ss</str> | ||
1227 | + <str>yyyy-MM-dd HH:mmZ</str> | ||
1228 | + <str>yyyy-MM-dd HH:mm</str> | ||
1229 | + <str>yyyy-MM-dd</str> | ||
1230 | + </arr> | ||
1231 | + </processor> | ||
1232 | +<!-- | ||
1233 | + <processor class="solr.AddSchemaFieldsUpdateProcessorFactory"> | ||
1234 | + <str name="defaultFieldType">strings</str> | ||
1235 | + <lst name="typeMapping"> | ||
1236 | + <str name="valueClass">java.lang.Boolean</str> | ||
1237 | + <str name="fieldType">booleans</str> | ||
1238 | + </lst> | ||
1239 | + <lst name="typeMapping"> | ||
1240 | + <str name="valueClass">java.util.Date</str> | ||
1241 | + <str name="fieldType">tdates</str> | ||
1242 | + </lst> | ||
1243 | + <lst name="typeMapping"> | ||
1244 | + <str name="valueClass">java.lang.Long</str> | ||
1245 | + <str name="valueClass">java.lang.Integer</str> | ||
1246 | + <str name="fieldType">tlongs</str> | ||
1247 | + </lst> | ||
1248 | + <lst name="typeMapping"> | ||
1249 | + <str name="valueClass">java.lang.Number</str> | ||
1250 | + <str name="fieldType">tdoubles</str> | ||
1251 | + </lst> | ||
1252 | + </processor> | ||
1253 | +--> | ||
1254 | + <processor class="solr.RunUpdateProcessorFactory"/> | ||
1255 | + </updateRequestProcessorChain> | ||
1256 | + | ||
1257 | + <!-- Deduplication | ||
1258 | + | ||
1259 | + An example dedup update processor that creates the "id" field | ||
1260 | + on the fly based on the hash code of some other fields. This | ||
1261 | + example has overwriteDupes set to false since we are using the | ||
1262 | + id field as the signatureField and Solr will maintain | ||
1263 | + uniqueness based on that anyway. | ||
1264 | + | ||
1265 | + --> | ||
1266 | + <!-- | ||
1267 | + <updateRequestProcessorChain name="dedupe"> | ||
1268 | + <processor class="solr.processor.SignatureUpdateProcessorFactory"> | ||
1269 | + <bool name="enabled">true</bool> | ||
1270 | + <str name="signatureField">id</str> | ||
1271 | + <bool name="overwriteDupes">false</bool> | ||
1272 | + <str name="fields">name,features,cat</str> | ||
1273 | + <str name="signatureClass">solr.processor.Lookup3Signature</str> | ||
1274 | + </processor> | ||
1275 | + <processor class="solr.LogUpdateProcessorFactory" /> | ||
1276 | + <processor class="solr.RunUpdateProcessorFactory" /> | ||
1277 | + </updateRequestProcessorChain> | ||
1278 | + --> | ||
1279 | + | ||
1280 | + <!-- Language identification | ||
1281 | + | ||
1282 | + This example update chain identifies the language of the incoming | ||
1283 | + documents using the langid contrib. The detected language is | ||
1284 | + written to field language_s. No field name mapping is done. | ||
1285 | + The fields used for detection are text, title, subject and description, | ||
1286 | + making this example suitable for detecting languages form full-text | ||
1287 | + rich documents injected via ExtractingRequestHandler. | ||
1288 | + See more about langId at http://wiki.apache.org/solr/LanguageDetection | ||
1289 | + --> | ||
1290 | + <!-- | ||
1291 | + <updateRequestProcessorChain name="langid"> | ||
1292 | + <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory"> | ||
1293 | + <str name="langid.fl">text,title,subject,description</str> | ||
1294 | + <str name="langid.langField">language_s</str> | ||
1295 | + <str name="langid.fallback">en</str> | ||
1296 | + </processor> | ||
1297 | + <processor class="solr.LogUpdateProcessorFactory" /> | ||
1298 | + <processor class="solr.RunUpdateProcessorFactory" /> | ||
1299 | + </updateRequestProcessorChain> | ||
1300 | + --> | ||
1301 | + | ||
1302 | + <!-- Script update processor | ||
1303 | + | ||
1304 | + This example hooks in an update processor implemented using JavaScript. | ||
1305 | + | ||
1306 | + See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor | ||
1307 | + --> | ||
1308 | + <!-- | ||
1309 | + <updateRequestProcessorChain name="script"> | ||
1310 | + <processor class="solr.StatelessScriptUpdateProcessorFactory"> | ||
1311 | + <str name="script">update-script.js</str> | ||
1312 | + <lst name="params"> | ||
1313 | + <str name="config_param">example config parameter</str> | ||
1314 | + </lst> | ||
1315 | + </processor> | ||
1316 | + <processor class="solr.RunUpdateProcessorFactory" /> | ||
1317 | + </updateRequestProcessorChain> | ||
1318 | + --> | ||
1319 | + | ||
1320 | + <!-- Response Writers | ||
1321 | + | ||
1322 | + http://wiki.apache.org/solr/QueryResponseWriter | ||
1323 | + | ||
1324 | + Request responses will be written using the writer specified by | ||
1325 | + the 'wt' request parameter matching the name of a registered | ||
1326 | + writer. | ||
1327 | + | ||
1328 | + The "default" writer is the default and will be used if 'wt' is | ||
1329 | + not specified in the request. | ||
1330 | + --> | ||
1331 | + <!-- The following response writers are implicitly configured unless | ||
1332 | + overridden... | ||
1333 | + --> | ||
1334 | + <!-- | ||
1335 | + <queryResponseWriter name="xml" | ||
1336 | + default="true" | ||
1337 | + class="solr.XMLResponseWriter" /> | ||
1338 | + <queryResponseWriter name="json" class="solr.JSONResponseWriter"/> | ||
1339 | + <queryResponseWriter name="python" class="solr.PythonResponseWriter"/> | ||
1340 | + <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/> | ||
1341 | + <queryResponseWriter name="php" class="solr.PHPResponseWriter"/> | ||
1342 | + <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/> | ||
1343 | + <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/> | ||
1344 | + <queryResponseWriter name="publishersSchema.xml" class="solr.SchemaXmlResponseWriter"/> | ||
1345 | + --> | ||
1346 | + | ||
1347 | + <queryResponseWriter name="json" class="solr.JSONResponseWriter"> | ||
1348 | + <!-- For the purposes of the tutorial, JSON responses are written as | ||
1349 | + plain text so that they are easy to read in *any* browser. | ||
1350 | + If you expect a MIME type of "application/json" just remove this override. | ||
1351 | + --> | ||
1352 | + <str name="content-type">text/plain; charset=UTF-8</str> | ||
1353 | + </queryResponseWriter> | ||
1354 | + | ||
1355 | + <!-- | ||
1356 | + Custom response writers can be declared as needed... | ||
1357 | + --> | ||
1358 | + <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"> | ||
1359 | + <str name="template.base.dir">${velocity.template.base.dir:}</str> | ||
1360 | + <str name="solr.resource.loader.enabled">${velocity.solr.resource.loader.enabled:true}</str> | ||
1361 | + <str name="params.resource.loader.enabled">${velocity.params.resource.loader.enabled:false}</str> | ||
1362 | + </queryResponseWriter> | ||
1363 | + | ||
1364 | + <!-- XSLT response writer transforms the XML output by any xslt file found | ||
1365 | + in Solr's conf/xslt directory. Changes to xslt files are checked for | ||
1366 | + every xsltCacheLifetimeSeconds. | ||
1367 | + --> | ||
1368 | + <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter"> | ||
1369 | + <int name="xsltCacheLifetimeSeconds">5</int> | ||
1370 | + </queryResponseWriter> | ||
1371 | + | ||
1372 | + <!-- Query Parsers | ||
1373 | + | ||
1374 | + https://cwiki.apache.org/confluence/display/solr/Query+Syntax+and+Parsing | ||
1375 | + | ||
1376 | + Multiple QParserPlugins can be registered by name, and then | ||
1377 | + used in either the "defType" param for the QueryComponent (used | ||
1378 | + by SearchHandler) or in LocalParams | ||
1379 | + --> | ||
1380 | + <!-- example of registering a query parser --> | ||
1381 | + <!-- | ||
1382 | + <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/> | ||
1383 | + --> | ||
1384 | + | ||
1385 | + <!-- Function Parsers | ||
1386 | + | ||
1387 | + http://wiki.apache.org/solr/FunctionQuery | ||
1388 | + | ||
1389 | + Multiple ValueSourceParsers can be registered by name, and then | ||
1390 | + used as function names when using the "func" QParser. | ||
1391 | + --> | ||
1392 | + <!-- example of registering a custom function parser --> | ||
1393 | + <!-- | ||
1394 | + <valueSourceParser name="myfunc" | ||
1395 | + class="com.mycompany.MyValueSourceParser" /> | ||
1396 | + --> | ||
1397 | + | ||
1398 | + | ||
1399 | + <!-- Document Transformers | ||
1400 | + http://wiki.apache.org/solr/DocTransformers | ||
1401 | + --> | ||
1402 | + <!-- | ||
1403 | + Could be something like: | ||
1404 | + <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" > | ||
1405 | + <int name="connection">jdbc://....</int> | ||
1406 | + </transformer> | ||
1407 | + | ||
1408 | + To add a constant value to all docs, use: | ||
1409 | + <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" > | ||
1410 | + <int name="value">5</int> | ||
1411 | + </transformer> | ||
1412 | + | ||
1413 | + If you want the user to still be able to change it with _value:something_ use this: | ||
1414 | + <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" > | ||
1415 | + <double name="defaultValue">5</double> | ||
1416 | + </transformer> | ||
1417 | + | ||
1418 | + If you are using the QueryElevationComponent, you may wish to mark documents that get boosted. The | ||
1419 | + EditorialMarkerFactory will do exactly that: | ||
1420 | + <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" /> | ||
1421 | + --> | ||
1422 | +</config> |
config/solr/createCore.sh
0 → 100644
config/solr/deleteCore.sh
0 → 100644
config/solr/publishers/elevate.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!-- | ||
3 | + Licensed to the Apache Software Foundation (ASF) under one or more | ||
4 | + contributor license agreements. See the NOTICE file distributed with | ||
5 | + this work for additional information regarding copyright ownership. | ||
6 | + The ASF licenses this file to You under the Apache License, Version 2.0 | ||
7 | + (the "License"); you may not use this file except in compliance with | ||
8 | + the License. You may obtain a copy of the License at | ||
9 | + | ||
10 | + http://www.apache.org/licenses/LICENSE-2.0 | ||
11 | + | ||
12 | + Unless required by applicable law or agreed to in writing, software | ||
13 | + distributed under the License is distributed on an "AS IS" BASIS, | ||
14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
15 | + See the License for the specific language governing permissions and | ||
16 | + limitations under the License. | ||
17 | +--> | ||
18 | + | ||
19 | +<!-- If this file is found in the config directory, it will only be | ||
20 | + loaded once at startup. If it is found in Solr's data | ||
21 | + directory, it will be re-loaded every commit. | ||
22 | + | ||
23 | + See http://wiki.apache.org/solr/QueryElevationComponent for more info | ||
24 | + | ||
25 | +--> | ||
26 | +<elevate> | ||
27 | + <!-- Query elevation examples | ||
28 | + <query text="foo bar"> | ||
29 | + <doc id="1" /> | ||
30 | + <doc id="2" /> | ||
31 | + <doc id="3" /> | ||
32 | + </query> | ||
33 | + | ||
34 | +for use with techproducts example | ||
35 | + | ||
36 | + <query text="ipod"> | ||
37 | + <doc id="MA147LL/A" /> put the actual ipod at the top | ||
38 | + <doc id="IW-02" exclude="true" /> exclude this cable | ||
39 | + </query> | ||
40 | +--> | ||
41 | + | ||
42 | +</elevate> |
config/solr/publishers/schema.xml
0 → 100644
1 | +<schema name="publisher" version="1.5"><!-- Confirmer choix version--> | ||
2 | + <fieldType name="int" class="solr.TrieIntField"/> | ||
3 | + <fieldType name="long" class="solr.TrieLongField"/> | ||
4 | + <fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true" /> | ||
5 | + <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true"/> | ||
6 | + <fieldType name="tdates" class="solr.TrieDateField" docValues="true" precisionStep="6" positionIncrementGap="0"/> | ||
7 | + <fieldType name="tlongs" class="solr.TrieLongField" docValues="true" precisionStep="8" positionIncrementGap="0"/> | ||
8 | + <fieldType name="tdoubles" class="solr.TrieDoubleField" docValues="true" precisionStep="8" positionIncrementGap="0"/> | ||
9 | + <fieldType name="ICUtext" class="solr.TextField"> | ||
10 | + <analyzer type="index"> | ||
11 | + <charFilter class="solr.HTMLStripCharFilterFactory"/> | ||
12 | + <tokenizer class="solr.ICUTokenizerFactory"/> | ||
13 | + <filter class="solr.ICUFoldingFilterFactory"/> | ||
14 | + </analyzer> | ||
15 | + <analyzer type="query"> | ||
16 | + <tokenizer class="solr.ICUTokenizerFactory"/> | ||
17 | + <filter class="solr.ICUFoldingFilterFactory"/> | ||
18 | + </analyzer> | ||
19 | + </fieldType> | ||
20 | + <fieldType name="namestr" class="solr.StrField"/> | ||
21 | +<!-- Collation Unicode difficile à faire fonctionner | ||
22 | + <fieldType name="textICUC" class="solr.ICUCollationField" locale="fr"/> | ||
23 | +--> | ||
24 | +<!-- CollationField ne supporte pas un analyzer | ||
25 | +--> | ||
26 | + <fieldType name="textColl" class="solr.CollationField" language="fr"/> | ||
27 | +<!-- | ||
28 | +--> | ||
29 | + | ||
30 | + <field name="publisherName" type="ICUtext" indexed="true" stored="true" multiValued="false" required="true"/> | ||
31 | + <field name="publisherCountry" type="namestr" indexed="true" stored="true" multiValued="false" required="false"/> | ||
32 | + <field name="publisherHistory" type="ICUtext" indexed="true" stored="true" multiValued="false" required="false"/> | ||
33 | + <field name="publisherId" type="int" indexed="true" multiValued="false" required="true"/> | ||
34 | + <field name="_version_" type="long" indexed="true" multiValued="false" required="true"/> | ||
35 | + <field name="_text_" type="ICUtext" indexed="true" multiValued="true" required="true"/> | ||
36 | + | ||
37 | + <uniqueKey>publisherId</uniqueKey> | ||
38 | + | ||
39 | + <copyField source="publisherName" dest="_text_" /> | ||
40 | + <copyField source="publisherHistory" dest="_text_" /> | ||
41 | +</schema> | ||
42 | + |
config/solr/publishers/solrconfig.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!-- | ||
3 | + Licensed to the Apache Software Foundation (ASF) under one or more | ||
4 | + contributor license agreements. See the NOTICE file distributed with | ||
5 | + this work for additional information regarding copyright ownership. | ||
6 | + The ASF licenses this file to You under the Apache License, Version 2.0 | ||
7 | + (the "License"); you may not use this file except in compliance with | ||
8 | + the License. You may obtain a copy of the License at | ||
9 | + | ||
10 | + http://www.apache.org/licenses/LICENSE-2.0 | ||
11 | + | ||
12 | + Unless required by applicable law or agreed to in writing, software | ||
13 | + distributed under the License is distributed on an "AS IS" BASIS, | ||
14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
15 | + See the License for the specific language governing permissions and | ||
16 | + limitations under the License. | ||
17 | +--> | ||
18 | + | ||
19 | +<!-- | ||
20 | + For more details about configurations options that may appear in | ||
21 | + this file, see http://wiki.apache.org/solr/SolrConfigXml. | ||
22 | +--> | ||
23 | +<config> | ||
24 | +<schemaFactory class="ClassicIndexSchemaFactory"/> | ||
25 | + <!-- In all configuration below, a prefix of "solr." for class names | ||
26 | + is an alias that causes solr to search appropriate packages, | ||
27 | + including org.apache.solr.(search|update|request|core|analysis) | ||
28 | + | ||
29 | + You may also specify a fully qualified Java classname if you | ||
30 | + have your own custom plugins. | ||
31 | + --> | ||
32 | + | ||
33 | + <!-- Controls what version of Lucene various components of Solr | ||
34 | + adhere to. Generally, you want to use the latest version to | ||
35 | + get all bug fixes and improvements. It is highly recommended | ||
36 | + that you fully re-index after changing this setting as it can | ||
37 | + affect both how text is indexed and queried. | ||
38 | + --> | ||
39 | + <luceneMatchVersion>6.3.0</luceneMatchVersion> | ||
40 | + | ||
41 | + <!-- <lib/> directives can be used to instruct Solr to load any Jars | ||
42 | + identified and use them to resolve any "plugins" specified in | ||
43 | + your solrconfig.xml or publishersSchema.xml (ie: Analyzers, Request | ||
44 | + Handlers, etc...). | ||
45 | + | ||
46 | + All directories and paths are resolved relative to the | ||
47 | + instanceDir. | ||
48 | + | ||
49 | + Please note that <lib/> directives are processed in the order | ||
50 | + that they appear in your solrconfig.xml file, and are "stacked" | ||
51 | + on top of each other when building a ClassLoader - so if you have | ||
52 | + plugin jars with dependencies on other jars, the "lower level" | ||
53 | + dependency jars should be loaded first. | ||
54 | + | ||
55 | + If a "./lib" directory exists in your instanceDir, all files | ||
56 | + found in it are included as if you had used the following | ||
57 | + syntax... | ||
58 | + | ||
59 | + <lib dir="./lib" /> | ||
60 | + --> | ||
61 | + | ||
62 | + <!-- A 'dir' option by itself adds any files found in the directory | ||
63 | + to the classpath, this is useful for including all jars in a | ||
64 | + directory. | ||
65 | + | ||
66 | + When a 'regex' is specified in addition to a 'dir', only the | ||
67 | + files in that directory which completely match the regex | ||
68 | + (anchored on both ends) will be included. | ||
69 | + | ||
70 | + If a 'dir' option (with or without a regex) is used and nothing | ||
71 | + is found that matches, a warning will be logged. | ||
72 | + | ||
73 | + The examples below can be used to load some solr-contribs along | ||
74 | + with their external dependencies. | ||
75 | + --> | ||
76 | + <lib dir="${solr.install.dir:..}/contrib/analysis-extras/lucene-libs" regex="lucene-analyzers-icu-.*\.jar" /> | ||
77 | + <lib dir="${solr.install.dir:..}/contrib/analysis-extras/lib" regex="icu4j-.*\.jar" /> | ||
78 | + <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" /> | ||
79 | + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" /> | ||
80 | + | ||
81 | + <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" /> | ||
82 | + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" /> | ||
83 | + | ||
84 | + <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /> | ||
85 | + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" /> | ||
86 | + | ||
87 | + <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" /> | ||
88 | + <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" /> | ||
89 | + <!-- an exact 'path' can be used instead of a 'dir' to specify a | ||
90 | + specific jar file. This will cause a serious error to be logged | ||
91 | + if it can't be loaded. | ||
92 | + --> | ||
93 | + <!-- | ||
94 | + <lib path="../a-jar-that-does-not-exist.jar" /> | ||
95 | + --> | ||
96 | + | ||
97 | + <!-- Data Directory | ||
98 | + | ||
99 | + Used to specify an alternate directory to hold all index data | ||
100 | + other than the default ./data under the Solr home. If | ||
101 | + replication is in use, this should match the replication | ||
102 | + configuration. | ||
103 | + --> | ||
104 | + <dataDir>${solr.data.dir:}</dataDir> | ||
105 | + | ||
106 | + | ||
107 | + <!-- The DirectoryFactory to use for indexes. | ||
108 | + | ||
109 | + solr.StandardDirectoryFactory is filesystem | ||
110 | + based and tries to pick the best implementation for the current | ||
111 | + JVM and platform. solr.NRTCachingDirectoryFactory, the default, | ||
112 | + wraps solr.StandardDirectoryFactory and caches small files in memory | ||
113 | + for better NRT performance. | ||
114 | + | ||
115 | + One can force a particular implementation via solr.MMapDirectoryFactory, | ||
116 | + solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory. | ||
117 | + | ||
118 | + solr.RAMDirectoryFactory is memory based, not | ||
119 | + persistent, and doesn't work with replication. | ||
120 | + --> | ||
121 | + <directoryFactory name="DirectoryFactory" | ||
122 | + class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/> | ||
123 | + | ||
124 | + <!-- The CodecFactory for defining the format of the inverted index. | ||
125 | + The default implementation is SchemaCodecFactory, which is the official Lucene | ||
126 | + index format, but hooks into the schema to provide per-field customization of | ||
127 | + the postings lists and per-document values in the fieldType element | ||
128 | + (postingsFormat/docValuesFormat). Note that most of the alternative implementations | ||
129 | + are experimental, so if you choose to customize the index format, it's a good | ||
130 | + idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader) | ||
131 | + before upgrading to a newer version to avoid unnecessary reindexing. | ||
132 | + A "compressionMode" string element can be added to <codecFactory> to choose | ||
133 | + between the existing compression modes in the default codec: "BEST_SPEED" (default) | ||
134 | + or "BEST_COMPRESSION". | ||
135 | + --> | ||
136 | + <codecFactory class="solr.SchemaCodecFactory"/> | ||
137 | + | ||
138 | + <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
139 | + Index Config - These settings control low-level behavior of indexing | ||
140 | + Most example settings here show the default value, but are commented | ||
141 | + out, to more easily see where customizations have been made. | ||
142 | + | ||
143 | + Note: This replaces <indexDefaults> and <mainIndex> from older versions | ||
144 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> | ||
145 | + <indexConfig> | ||
146 | + <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a | ||
147 | + LimitTokenCountFilterFactory in your fieldType definition. E.g. | ||
148 | + <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/> | ||
149 | + --> | ||
150 | + <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 --> | ||
151 | + <!-- <writeLockTimeout>1000</writeLockTimeout> --> | ||
152 | + | ||
153 | + <!-- Expert: Enabling compound file will use less files for the index, | ||
154 | + using fewer file descriptors on the expense of performance decrease. | ||
155 | + Default in Lucene is "true". Default in Solr is "false" (since 3.6) --> | ||
156 | + <!-- <useCompoundFile>false</useCompoundFile> --> | ||
157 | + | ||
158 | + <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene | ||
159 | + indexing for buffering added documents and deletions before they are | ||
160 | + flushed to the Directory. | ||
161 | + maxBufferedDocs sets a limit on the number of documents buffered | ||
162 | + before flushing. | ||
163 | + If both ramBufferSizeMB and maxBufferedDocs is set, then | ||
164 | + Lucene will flush based on whichever limit is hit first. --> | ||
165 | + <!-- <ramBufferSizeMB>100</ramBufferSizeMB> --> | ||
166 | + <!-- <maxBufferedDocs>1000</maxBufferedDocs> --> | ||
167 | + | ||
168 | + <!-- Expert: Merge Policy | ||
169 | + The Merge Policy in Lucene controls how merging of segments is done. | ||
170 | + The default since Solr/Lucene 3.3 is TieredMergePolicy. | ||
171 | + The default since Lucene 2.3 was the LogByteSizeMergePolicy, | ||
172 | + Even older versions of Lucene used LogDocMergePolicy. | ||
173 | + --> | ||
174 | + <!-- | ||
175 | + <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory"> | ||
176 | + <int name="maxMergeAtOnce">10</int> | ||
177 | + <int name="segmentsPerTier">10</int> | ||
178 | + <double name="noCFSRatio">0.1</double> | ||
179 | + </mergePolicyFactory> | ||
180 | + --> | ||
181 | + | ||
182 | + <!-- Expert: Merge Scheduler | ||
183 | + The Merge Scheduler in Lucene controls how merges are | ||
184 | + performed. The ConcurrentMergeScheduler (Lucene 2.3 default) | ||
185 | + can perform merges in the background using separate threads. | ||
186 | + The SerialMergeScheduler (Lucene 2.2 default) does not. | ||
187 | + --> | ||
188 | + <!-- | ||
189 | + <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/> | ||
190 | + --> | ||
191 | + | ||
192 | + <!-- LockFactory | ||
193 | + | ||
194 | + This option specifies which Lucene LockFactory implementation | ||
195 | + to use. | ||
196 | + | ||
197 | + single = SingleInstanceLockFactory - suggested for a | ||
198 | + read-only index or when there is no possibility of | ||
199 | + another process trying to modify the index. | ||
200 | + native = NativeFSLockFactory - uses OS native file locking. | ||
201 | + Do not use when multiple solr webapps in the same | ||
202 | + JVM are attempting to share a single index. | ||
203 | + simple = SimpleFSLockFactory - uses a plain file for locking | ||
204 | + | ||
205 | + Defaults: 'native' is default for Solr3.6 and later, otherwise | ||
206 | + 'simple' is the default | ||
207 | + | ||
208 | + More details on the nuances of each LockFactory... | ||
209 | + http://wiki.apache.org/lucene-java/AvailableLockFactories | ||
210 | + --> | ||
211 | + <lockType>${solr.lock.type:native}</lockType> | ||
212 | + | ||
213 | + <!-- Commit Deletion Policy | ||
214 | + Custom deletion policies can be specified here. The class must | ||
215 | + implement org.apache.lucene.index.IndexDeletionPolicy. | ||
216 | + | ||
217 | + The default Solr IndexDeletionPolicy implementation supports | ||
218 | + deleting index commit points on number of commits, age of | ||
219 | + commit point and optimized status. | ||
220 | + | ||
221 | + The latest commit point should always be preserved regardless | ||
222 | + of the criteria. | ||
223 | + --> | ||
224 | + <!-- | ||
225 | + <deletionPolicy class="solr.SolrDeletionPolicy"> | ||
226 | + --> | ||
227 | + <!-- The number of commit points to be kept --> | ||
228 | + <!-- <str name="maxCommitsToKeep">1</str> --> | ||
229 | + <!-- The number of optimized commit points to be kept --> | ||
230 | + <!-- <str name="maxOptimizedCommitsToKeep">0</str> --> | ||
231 | + <!-- | ||
232 | + Delete all commit points once they have reached the given age. | ||
233 | + Supports DateMathParser syntax e.g. | ||
234 | + --> | ||
235 | + <!-- | ||
236 | + <str name="maxCommitAge">30MINUTES</str> | ||
237 | + <str name="maxCommitAge">1DAY</str> | ||
238 | + --> | ||
239 | + <!-- | ||
240 | + </deletionPolicy> | ||
241 | + --> | ||
242 | + | ||
243 | + <!-- Lucene Infostream | ||
244 | + | ||
245 | + To aid in advanced debugging, Lucene provides an "InfoStream" | ||
246 | + of detailed information when indexing. | ||
247 | + | ||
248 | + Setting The value to true will instruct the underlying Lucene | ||
249 | + IndexWriter to write its debugging info the specified file | ||
250 | + --> | ||
251 | + <!-- <infoStream file="INFOSTREAM.txt">false</infoStream> --> | ||
252 | + </indexConfig> | ||
253 | + | ||
254 | + | ||
255 | + <!-- JMX | ||
256 | + | ||
257 | + This example enables JMX if and only if an existing MBeanServer | ||
258 | + is found, use this if you want to configure JMX through JVM | ||
259 | + parameters. Remove this to disable exposing Solr configuration | ||
260 | + and statistics to JMX. | ||
261 | + | ||
262 | + For more details see http://wiki.apache.org/solr/SolrJmx | ||
263 | + --> | ||
264 | + <jmx /> | ||
265 | + <!-- If you want to connect to a particular server, specify the | ||
266 | + agentId | ||
267 | + --> | ||
268 | + <!-- <jmx agentId="myAgent" /> --> | ||
269 | + <!-- If you want to start a new MBeanServer, specify the serviceUrl --> | ||
270 | + <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/> | ||
271 | + --> | ||
272 | + | ||
273 | + <!-- The default high-performance update handler --> | ||
274 | + <updateHandler class="solr.DirectUpdateHandler2"> | ||
275 | + | ||
276 | + <!-- Enables a transaction log, used for real-time get, durability, and | ||
277 | + and solr cloud replica recovery. The log can grow as big as | ||
278 | + uncommitted changes to the index, so use of a hard autoCommit | ||
279 | + is recommended (see below). | ||
280 | + "dir" - the target directory for transaction logs, defaults to the | ||
281 | + solr data directory. | ||
282 | + "numVersionBuckets" - sets the number of buckets used to keep | ||
283 | + track of max version values when checking for re-ordered | ||
284 | + updates; increase this value to reduce the cost of | ||
285 | + synchronizing access to version buckets during high-volume | ||
286 | + indexing, this requires 8 bytes (long) * numVersionBuckets | ||
287 | + of heap space per Solr core. | ||
288 | + --> | ||
289 | + <updateLog> | ||
290 | + <str name="dir">${solr.ulog.dir:}</str> | ||
291 | + <int name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}</int> | ||
292 | + </updateLog> | ||
293 | + | ||
294 | + <!-- AutoCommit | ||
295 | + | ||
296 | + Perform a hard commit automatically under certain conditions. | ||
297 | + Instead of enabling autoCommit, consider using "commitWithin" | ||
298 | + when adding documents. | ||
299 | + | ||
300 | + http://wiki.apache.org/solr/UpdateXmlMessages | ||
301 | + | ||
302 | + maxDocs - Maximum number of documents to add since the last | ||
303 | + commit before automatically triggering a new commit. | ||
304 | + | ||
305 | + maxTime - Maximum amount of time in ms that is allowed to pass | ||
306 | + since a document was added before automatically | ||
307 | + triggering a new commit. | ||
308 | + openSearcher - if false, the commit causes recent index changes | ||
309 | + to be flushed to stable storage, but does not cause a new | ||
310 | + searcher to be opened to make those changes visible. | ||
311 | + | ||
312 | + If the updateLog is enabled, then it's highly recommended to | ||
313 | + have some sort of hard autoCommit to limit the log size. | ||
314 | + --> | ||
315 | + <autoCommit> | ||
316 | + <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> | ||
317 | + <openSearcher>false</openSearcher> | ||
318 | + </autoCommit> | ||
319 | + | ||
320 | + <!-- softAutoCommit is like autoCommit except it causes a | ||
321 | + 'soft' commit which only ensures that changes are visible | ||
322 | + but does not ensure that data is synced to disk. This is | ||
323 | + faster and more near-realtime friendly than a hard commit. | ||
324 | + --> | ||
325 | + | ||
326 | + <autoSoftCommit> | ||
327 | + <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime> | ||
328 | + </autoSoftCommit> | ||
329 | + | ||
330 | + <!-- Update Related Event Listeners | ||
331 | + | ||
332 | + Various IndexWriter related events can trigger Listeners to | ||
333 | + take actions. | ||
334 | + | ||
335 | + postCommit - fired after every commit or optimize command | ||
336 | + postOptimize - fired after every optimize command | ||
337 | + --> | ||
338 | + <!-- The RunExecutableListener executes an external command from a | ||
339 | + hook such as postCommit or postOptimize. | ||
340 | + | ||
341 | + exe - the name of the executable to run | ||
342 | + dir - dir to use as the current working directory. (default=".") | ||
343 | + wait - the calling thread waits until the executable returns. | ||
344 | + (default="true") | ||
345 | + args - the arguments to pass to the program. (default is none) | ||
346 | + env - environment variables to set. (default is none) | ||
347 | + --> | ||
348 | + <!-- This example shows how RunExecutableListener could be used | ||
349 | + with the script based replication... | ||
350 | + http://wiki.apache.org/solr/CollectionDistribution | ||
351 | + --> | ||
352 | + <!-- | ||
353 | + <listener event="postCommit" class="solr.RunExecutableListener"> | ||
354 | + <str name="exe">solr/bin/snapshooter</str> | ||
355 | + <str name="dir">.</str> | ||
356 | + <bool name="wait">true</bool> | ||
357 | + <arr name="args"> <str>arg1</str> <str>arg2</str> </arr> | ||
358 | + <arr name="env"> <str>MYVAR=val1</str> </arr> | ||
359 | + </listener> | ||
360 | + --> | ||
361 | + | ||
362 | + </updateHandler> | ||
363 | + | ||
364 | + <!-- IndexReaderFactory | ||
365 | + | ||
366 | + Use the following format to specify a custom IndexReaderFactory, | ||
367 | + which allows for alternate IndexReader implementations. | ||
368 | + | ||
369 | + ** Experimental Feature ** | ||
370 | + | ||
371 | + Please note - Using a custom IndexReaderFactory may prevent | ||
372 | + certain other features from working. The API to | ||
373 | + IndexReaderFactory may change without warning or may even be | ||
374 | + removed from future releases if the problems cannot be | ||
375 | + resolved. | ||
376 | + | ||
377 | + | ||
378 | + ** Features that may not work with custom IndexReaderFactory ** | ||
379 | + | ||
380 | + The ReplicationHandler assumes a disk-resident index. Using a | ||
381 | + custom IndexReader implementation may cause incompatibility | ||
382 | + with ReplicationHandler and may cause replication to not work | ||
383 | + correctly. See SOLR-1366 for details. | ||
384 | + | ||
385 | + --> | ||
386 | + <!-- | ||
387 | + <indexReaderFactory name="IndexReaderFactory" class="package.class"> | ||
388 | + <str name="someArg">Some Value</str> | ||
389 | + </indexReaderFactory > | ||
390 | + --> | ||
391 | + | ||
392 | + <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
393 | + Query section - these settings control query time things like caches | ||
394 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> | ||
395 | + <query> | ||
396 | + <!-- Max Boolean Clauses | ||
397 | + | ||
398 | + Maximum number of clauses in each BooleanQuery, an exception | ||
399 | + is thrown if exceeded. | ||
400 | + | ||
401 | + ** WARNING ** | ||
402 | + | ||
403 | + This option actually modifies a global Lucene property that | ||
404 | + will affect all SolrCores. If multiple solrconfig.xml files | ||
405 | + disagree on this property, the value at any given moment will | ||
406 | + be based on the last SolrCore to be initialized. | ||
407 | + | ||
408 | + --> | ||
409 | + <maxBooleanClauses>1024</maxBooleanClauses> | ||
410 | + | ||
411 | + | ||
412 | + <!-- Solr Internal Query Caches | ||
413 | + | ||
414 | + There are two implementations of cache available for Solr, | ||
415 | + LRUCache, based on a synchronized LinkedHashMap, and | ||
416 | + FastLRUCache, based on a ConcurrentHashMap. | ||
417 | + | ||
418 | + FastLRUCache has faster gets and slower puts in single | ||
419 | + threaded operation and thus is generally faster than LRUCache | ||
420 | + when the hit ratio of the cache is high (> 75%), and may be | ||
421 | + faster under other scenarios on multi-cpu systems. | ||
422 | + --> | ||
423 | + | ||
424 | + <!-- Filter Cache | ||
425 | + | ||
426 | + Cache used by SolrIndexSearcher for filters (DocSets), | ||
427 | + unordered sets of *all* documents that match a query. When a | ||
428 | + new searcher is opened, its caches may be prepopulated or | ||
429 | + "autowarmed" using data from caches in the old searcher. | ||
430 | + autowarmCount is the number of items to prepopulate. For | ||
431 | + LRUCache, the autowarmed items will be the most recently | ||
432 | + accessed items. | ||
433 | + | ||
434 | + Parameters: | ||
435 | + class - the SolrCache implementation LRUCache or | ||
436 | + (LRUCache or FastLRUCache) | ||
437 | + size - the maximum number of entries in the cache | ||
438 | + initialSize - the initial capacity (number of entries) of | ||
439 | + the cache. (see java.util.HashMap) | ||
440 | + autowarmCount - the number of entries to prepopulate from | ||
441 | + and old cache. | ||
442 | + --> | ||
443 | + <filterCache class="solr.FastLRUCache" | ||
444 | + size="512" | ||
445 | + initialSize="512" | ||
446 | + autowarmCount="0"/> | ||
447 | + | ||
448 | + <!-- Query Result Cache | ||
449 | + | ||
450 | + Caches results of searches - ordered lists of document ids | ||
451 | + (DocList) based on a query, a sort, and the range of documents requested. | ||
452 | + Additional supported parameter by LRUCache: | ||
453 | + maxRamMB - the maximum amount of RAM (in MB) that this cache is allowed | ||
454 | + to occupy | ||
455 | + --> | ||
456 | + <queryResultCache class="solr.LRUCache" | ||
457 | + size="512" | ||
458 | + initialSize="512" | ||
459 | + autowarmCount="0"/> | ||
460 | + | ||
461 | + <!-- Document Cache | ||
462 | + | ||
463 | + Caches Lucene Document objects (the stored fields for each | ||
464 | + document). Since Lucene internal document ids are transient, | ||
465 | + this cache will not be autowarmed. | ||
466 | + --> | ||
467 | + <documentCache class="solr.LRUCache" | ||
468 | + size="512" | ||
469 | + initialSize="512" | ||
470 | + autowarmCount="0"/> | ||
471 | + | ||
472 | + <!-- custom cache currently used by block join --> | ||
473 | + <cache name="perSegFilter" | ||
474 | + class="solr.search.LRUCache" | ||
475 | + size="10" | ||
476 | + initialSize="0" | ||
477 | + autowarmCount="10" | ||
478 | + regenerator="solr.NoOpRegenerator" /> | ||
479 | + | ||
480 | + <!-- Field Value Cache | ||
481 | + | ||
482 | + Cache used to hold field values that are quickly accessible | ||
483 | + by document id. The fieldValueCache is created by default | ||
484 | + even if not configured here. | ||
485 | + --> | ||
486 | + <!-- | ||
487 | + <fieldValueCache class="solr.FastLRUCache" | ||
488 | + size="512" | ||
489 | + autowarmCount="128" | ||
490 | + showItems="32" /> | ||
491 | + --> | ||
492 | + | ||
493 | + <!-- Custom Cache | ||
494 | + | ||
495 | + Example of a generic cache. These caches may be accessed by | ||
496 | + name through SolrIndexSearcher.getCache(),cacheLookup(), and | ||
497 | + cacheInsert(). The purpose is to enable easy caching of | ||
498 | + user/application level data. The regenerator argument should | ||
499 | + be specified as an implementation of solr.CacheRegenerator | ||
500 | + if autowarming is desired. | ||
501 | + --> | ||
502 | + <!-- | ||
503 | + <cache name="myUserCache" | ||
504 | + class="solr.LRUCache" | ||
505 | + size="4096" | ||
506 | + initialSize="1024" | ||
507 | + autowarmCount="1024" | ||
508 | + regenerator="com.mycompany.MyRegenerator" | ||
509 | + /> | ||
510 | + --> | ||
511 | + | ||
512 | + | ||
513 | + <!-- Lazy Field Loading | ||
514 | + | ||
515 | + If true, stored fields that are not requested will be loaded | ||
516 | + lazily. This can result in a significant speed improvement | ||
517 | + if the usual case is to not load all stored fields, | ||
518 | + especially if the skipped fields are large compressed text | ||
519 | + fields. | ||
520 | + --> | ||
521 | + <enableLazyFieldLoading>true</enableLazyFieldLoading> | ||
522 | + | ||
523 | + <!-- Use Filter For Sorted Query | ||
524 | + | ||
525 | + A possible optimization that attempts to use a filter to | ||
526 | + satisfy a search. If the requested sort does not include | ||
527 | + score, then the filterCache will be checked for a filter | ||
528 | + matching the query. If found, the filter will be used as the | ||
529 | + source of document ids, and then the sort will be applied to | ||
530 | + that. | ||
531 | + | ||
532 | + For most situations, this will not be useful unless you | ||
533 | + frequently get the same search repeatedly with different sort | ||
534 | + options, and none of them ever use "score" | ||
535 | + --> | ||
536 | + <!-- | ||
537 | + <useFilterForSortedQuery>true</useFilterForSortedQuery> | ||
538 | + --> | ||
539 | + | ||
540 | + <!-- Result Window Size | ||
541 | + | ||
542 | + An optimization for use with the queryResultCache. When a search | ||
543 | + is requested, a superset of the requested number of document ids | ||
544 | + are collected. For example, if a search for a particular query | ||
545 | + requests matching documents 10 through 19, and queryWindowSize is 50, | ||
546 | + then documents 0 through 49 will be collected and cached. Any further | ||
547 | + requests in that range can be satisfied via the cache. | ||
548 | + --> | ||
549 | + <queryResultWindowSize>20</queryResultWindowSize> | ||
550 | + | ||
551 | + <!-- Maximum number of documents to cache for any entry in the | ||
552 | + queryResultCache. | ||
553 | + --> | ||
554 | + <queryResultMaxDocsCached>200</queryResultMaxDocsCached> | ||
555 | + | ||
556 | + <!-- Query Related Event Listeners | ||
557 | + | ||
558 | + Various IndexSearcher related events can trigger Listeners to | ||
559 | + take actions. | ||
560 | + | ||
561 | + newSearcher - fired whenever a new searcher is being prepared | ||
562 | + and there is a current searcher handling requests (aka | ||
563 | + registered). It can be used to prime certain caches to | ||
564 | + prevent long request times for certain requests. | ||
565 | + | ||
566 | + firstSearcher - fired whenever a new searcher is being | ||
567 | + prepared but there is no current registered searcher to handle | ||
568 | + requests or to gain autowarming data from. | ||
569 | + | ||
570 | + | ||
571 | + --> | ||
572 | + <!-- QuerySenderListener takes an array of NamedList and executes a | ||
573 | + local query request for each NamedList in sequence. | ||
574 | + --> | ||
575 | + <listener event="newSearcher" class="solr.QuerySenderListener"> | ||
576 | + <arr name="queries"> | ||
577 | + <!-- | ||
578 | + <lst><str name="q">solr</str><str name="sort">price asc</str></lst> | ||
579 | + <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst> | ||
580 | + --> | ||
581 | + </arr> | ||
582 | + </listener> | ||
583 | + <listener event="firstSearcher" class="solr.QuerySenderListener"> | ||
584 | + <arr name="queries"> | ||
585 | + <!-- | ||
586 | + <lst> | ||
587 | + <str name="q">static firstSearcher warming in solrconfig.xml</str> | ||
588 | + </lst> | ||
589 | + --> | ||
590 | + </arr> | ||
591 | + </listener> | ||
592 | + | ||
593 | + <!-- Use Cold Searcher | ||
594 | + | ||
595 | + If a search request comes in and there is no current | ||
596 | + registered searcher, then immediately register the still | ||
597 | + warming searcher and use it. If "false" then all requests | ||
598 | + will block until the first searcher is done warming. | ||
599 | + --> | ||
600 | + <useColdSearcher>false</useColdSearcher> | ||
601 | + | ||
602 | + <!-- Max Warming Searchers | ||
603 | + | ||
604 | + Maximum number of searchers that may be warming in the | ||
605 | + background concurrently. An error is returned if this limit | ||
606 | + is exceeded. | ||
607 | + | ||
608 | + Recommend values of 1-2 for read-only slaves, higher for | ||
609 | + masters w/o cache warming. | ||
610 | + --> | ||
611 | + <maxWarmingSearchers>2</maxWarmingSearchers> | ||
612 | + | ||
613 | + </query> | ||
614 | + | ||
615 | + | ||
616 | + <!-- Request Dispatcher | ||
617 | + | ||
618 | + This section contains instructions for how the SolrDispatchFilter | ||
619 | + should behave when processing requests for this SolrCore. | ||
620 | + | ||
621 | + handleSelect is a legacy option that affects the behavior of requests | ||
622 | + such as /select?qt=XXX | ||
623 | + | ||
624 | + handleSelect="true" will cause the SolrDispatchFilter to process | ||
625 | + the request and dispatch the query to a handler specified by the | ||
626 | + "qt" param, assuming "/select" isn't already registered. | ||
627 | + | ||
628 | + handleSelect="false" will cause the SolrDispatchFilter to | ||
629 | + ignore "/select" requests, resulting in a 404 unless a handler | ||
630 | + is explicitly registered with the name "/select" | ||
631 | + | ||
632 | + handleSelect="true" is not recommended for new users, but is the default | ||
633 | + for backwards compatibility | ||
634 | + --> | ||
635 | + <requestDispatcher handleSelect="false" > | ||
636 | + <!-- Request Parsing | ||
637 | + | ||
638 | + These settings indicate how Solr Requests may be parsed, and | ||
639 | + what restrictions may be placed on the ContentStreams from | ||
640 | + those requests | ||
641 | + | ||
642 | + enableRemoteStreaming - enables use of the stream.file | ||
643 | + and stream.url parameters for specifying remote streams. | ||
644 | + | ||
645 | + multipartUploadLimitInKB - specifies the max size (in KiB) of | ||
646 | + Multipart File Uploads that Solr will allow in a Request. | ||
647 | + | ||
648 | + formdataUploadLimitInKB - specifies the max size (in KiB) of | ||
649 | + form data (application/x-www-form-urlencoded) sent via | ||
650 | + POST. You can use POST to pass request parameters not | ||
651 | + fitting into the URL. | ||
652 | + | ||
653 | + addHttpRequestToContext - if set to true, it will instruct | ||
654 | + the requestParsers to include the original HttpServletRequest | ||
655 | + object in the context map of the SolrQueryRequest under the | ||
656 | + key "httpRequest". It will not be used by any of the existing | ||
657 | + Solr components, but may be useful when developing custom | ||
658 | + plugins. | ||
659 | + | ||
660 | + *** WARNING *** | ||
661 | + The settings below authorize Solr to fetch remote files, You | ||
662 | + should make sure your system has some authentication before | ||
663 | + using enableRemoteStreaming="true" | ||
664 | + | ||
665 | + --> | ||
666 | + <requestParsers enableRemoteStreaming="true" | ||
667 | + multipartUploadLimitInKB="2048000" | ||
668 | + formdataUploadLimitInKB="2048" | ||
669 | + addHttpRequestToContext="false"/> | ||
670 | + | ||
671 | + <!-- HTTP Caching | ||
672 | + | ||
673 | + Set HTTP caching related parameters (for proxy caches and clients). | ||
674 | + | ||
675 | + The options below instruct Solr not to output any HTTP Caching | ||
676 | + related headers | ||
677 | + --> | ||
678 | + <httpCaching never304="true" /> | ||
679 | + <!-- If you include a <cacheControl> directive, it will be used to | ||
680 | + generate a Cache-Control header (as well as an Expires header | ||
681 | + if the value contains "max-age=") | ||
682 | + | ||
683 | + By default, no Cache-Control header is generated. | ||
684 | + | ||
685 | + You can use the <cacheControl> option even if you have set | ||
686 | + never304="true" | ||
687 | + --> | ||
688 | + <!-- | ||
689 | + <httpCaching never304="true" > | ||
690 | + <cacheControl>max-age=30, public</cacheControl> | ||
691 | + </httpCaching> | ||
692 | + --> | ||
693 | + <!-- To enable Solr to respond with automatically generated HTTP | ||
694 | + Caching headers, and to response to Cache Validation requests | ||
695 | + correctly, set the value of never304="false" | ||
696 | + | ||
697 | + This will cause Solr to generate Last-Modified and ETag | ||
698 | + headers based on the properties of the Index. | ||
699 | + | ||
700 | + The following options can also be specified to affect the | ||
701 | + values of these headers... | ||
702 | + | ||
703 | + lastModFrom - the default value is "openTime" which means the | ||
704 | + Last-Modified value (and validation against If-Modified-Since | ||
705 | + requests) will all be relative to when the current Searcher | ||
706 | + was opened. You can change it to lastModFrom="dirLastMod" if | ||
707 | + you want the value to exactly correspond to when the physical | ||
708 | + index was last modified. | ||
709 | + | ||
710 | + etagSeed="..." is an option you can change to force the ETag | ||
711 | + header (and validation against If-None-Match requests) to be | ||
712 | + different even if the index has not changed (ie: when making | ||
713 | + significant changes to your config file) | ||
714 | + | ||
715 | + (lastModifiedFrom and etagSeed are both ignored if you use | ||
716 | + the never304="true" option) | ||
717 | + --> | ||
718 | + <!-- | ||
719 | + <httpCaching lastModifiedFrom="openTime" | ||
720 | + etagSeed="Solr"> | ||
721 | + <cacheControl>max-age=30, public</cacheControl> | ||
722 | + </httpCaching> | ||
723 | + --> | ||
724 | + </requestDispatcher> | ||
725 | + | ||
726 | + <!-- Request Handlers | ||
727 | + | ||
728 | + http://wiki.apache.org/solr/SolrRequestHandler | ||
729 | + | ||
730 | + Incoming queries will be dispatched to a specific handler by name | ||
731 | + based on the path specified in the request. | ||
732 | + | ||
733 | + Legacy behavior: If the request path uses "/select" but no Request | ||
734 | + Handler has that name, and if handleSelect="true" has been specified in | ||
735 | + the requestDispatcher, then the Request Handler is dispatched based on | ||
736 | + the qt parameter. Handlers without a leading '/' are accessed this way | ||
737 | + like so: http://host/app/[core/]select?qt=name If no qt is | ||
738 | + given, then the requestHandler that declares default="true" will be | ||
739 | + used or the one named "standard". | ||
740 | + | ||
741 | + If a Request Handler is declared with startup="lazy", then it will | ||
742 | + not be initialized until the first request that uses it. | ||
743 | + | ||
744 | + --> | ||
745 | + <!-- SearchHandler | ||
746 | + | ||
747 | + http://wiki.apache.org/solr/SearchHandler | ||
748 | + | ||
749 | + For processing Search Queries, the primary Request Handler | ||
750 | + provided with Solr is "SearchHandler" It delegates to a sequent | ||
751 | + of SearchComponents (see below) and supports distributed | ||
752 | + queries across multiple shards | ||
753 | + --> | ||
754 | + <requestHandler name="/select" class="solr.SearchHandler"> | ||
755 | + <!-- default values for query parameters can be specified, these | ||
756 | + will be overridden by parameters in the request | ||
757 | + --> | ||
758 | + <lst name="defaults"> | ||
759 | + <str name="echoParams">explicit</str> | ||
760 | + <int name="rows">10</int> | ||
761 | + <!-- <str name="df">text</str> --> | ||
762 | + </lst> | ||
763 | + <!-- In addition to defaults, "appends" params can be specified | ||
764 | + to identify values which should be appended to the list of | ||
765 | + multi-val params from the query (or the existing "defaults"). | ||
766 | + --> | ||
767 | + <!-- In this example, the param "fq=instock:true" would be appended to | ||
768 | + any query time fq params the user may specify, as a mechanism for | ||
769 | + partitioning the index, independent of any user selected filtering | ||
770 | + that may also be desired (perhaps as a result of faceted searching). | ||
771 | + | ||
772 | + NOTE: there is *absolutely* nothing a client can do to prevent these | ||
773 | + "appends" values from being used, so don't use this mechanism | ||
774 | + unless you are sure you always want it. | ||
775 | + --> | ||
776 | + <!-- | ||
777 | + <lst name="appends"> | ||
778 | + <str name="fq">inStock:true</str> | ||
779 | + </lst> | ||
780 | + --> | ||
781 | + <!-- "invariants" are a way of letting the Solr maintainer lock down | ||
782 | + the options available to Solr clients. Any params values | ||
783 | + specified here are used regardless of what values may be specified | ||
784 | + in either the query, the "defaults", or the "appends" params. | ||
785 | + | ||
786 | + In this example, the facet.field and facet.query params would | ||
787 | + be fixed, limiting the facets clients can use. Faceting is | ||
788 | + not turned on by default - but if the client does specify | ||
789 | + facet=true in the request, these are the only facets they | ||
790 | + will be able to see counts for; regardless of what other | ||
791 | + facet.field or facet.query params they may specify. | ||
792 | + | ||
793 | + NOTE: there is *absolutely* nothing a client can do to prevent these | ||
794 | + "invariants" values from being used, so don't use this mechanism | ||
795 | + unless you are sure you always want it. | ||
796 | + --> | ||
797 | + <!-- | ||
798 | + <lst name="invariants"> | ||
799 | + <str name="facet.field">cat</str> | ||
800 | + <str name="facet.field">manu_exact</str> | ||
801 | + <str name="facet.query">price:[* TO 500]</str> | ||
802 | + <str name="facet.query">price:[500 TO *]</str> | ||
803 | + </lst> | ||
804 | + --> | ||
805 | + <!-- If the default list of SearchComponents is not desired, that | ||
806 | + list can either be overridden completely, or components can be | ||
807 | + prepended or appended to the default list. (see below) | ||
808 | + --> | ||
809 | + <!-- | ||
810 | + <arr name="components"> | ||
811 | + <str>nameOfCustomComponent1</str> | ||
812 | + <str>nameOfCustomComponent2</str> | ||
813 | + </arr> | ||
814 | + --> | ||
815 | + </requestHandler> | ||
816 | + | ||
817 | + <!-- A request handler that returns indented JSON by default --> | ||
818 | + <requestHandler name="/query" class="solr.SearchHandler"> | ||
819 | + <lst name="defaults"> | ||
820 | + <str name="echoParams">explicit</str> | ||
821 | + <str name="wt">json</str> | ||
822 | + <str name="indent">true</str> | ||
823 | + </lst> | ||
824 | + </requestHandler> | ||
825 | + | ||
826 | + | ||
827 | + <!-- A Robust Example | ||
828 | + | ||
829 | + This example SearchHandler declaration shows off usage of the | ||
830 | + SearchHandler with many defaults declared | ||
831 | + | ||
832 | + Note that multiple instances of the same Request Handler | ||
833 | + (SearchHandler) can be registered multiple times with different | ||
834 | + names (and different init parameters) | ||
835 | + --> | ||
836 | + <requestHandler name="/browse" class="solr.SearchHandler" useParams="query,facets,velocity,browse"> | ||
837 | + <lst name="defaults"> | ||
838 | + <str name="echoParams">explicit</str> | ||
839 | + </lst> | ||
840 | + </requestHandler> | ||
841 | + | ||
842 | + <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse"> | ||
843 | + <lst name="defaults"> | ||
844 | + <str name="df">_text_</str> | ||
845 | + </lst> | ||
846 | + </initParams> | ||
847 | + | ||
848 | + <initParams path="/update/**"> | ||
849 | + <lst name="defaults"> | ||
850 | + <str name="update.chain">add-unknown-fields-to-the-schema</str> | ||
851 | + </lst> | ||
852 | + </initParams> | ||
853 | + | ||
854 | + <!-- Solr Cell Update Request Handler | ||
855 | + | ||
856 | + http://wiki.apache.org/solr/ExtractingRequestHandler | ||
857 | + | ||
858 | + --> | ||
859 | + <requestHandler name="/update/extract" | ||
860 | + startup="lazy" | ||
861 | + class="solr.extraction.ExtractingRequestHandler" > | ||
862 | + <lst name="defaults"> | ||
863 | + <str name="lowernames">true</str> | ||
864 | + <str name="fmap.meta">ignored_</str> | ||
865 | + <str name="fmap.content">_text_</str> | ||
866 | + </lst> | ||
867 | + </requestHandler> | ||
868 | + | ||
869 | + <!-- Search Components | ||
870 | + | ||
871 | + Search components are registered to SolrCore and used by | ||
872 | + instances of SearchHandler (which can access them by name) | ||
873 | + | ||
874 | + By default, the following components are available: | ||
875 | + | ||
876 | + <searchComponent name="query" class="solr.QueryComponent" /> | ||
877 | + <searchComponent name="facet" class="solr.FacetComponent" /> | ||
878 | + <searchComponent name="mlt" class="solr.MoreLikeThisComponent" /> | ||
879 | + <searchComponent name="highlight" class="solr.HighlightComponent" /> | ||
880 | + <searchComponent name="stats" class="solr.StatsComponent" /> | ||
881 | + <searchComponent name="debug" class="solr.DebugComponent" /> | ||
882 | + | ||
883 | + Default configuration in a requestHandler would look like: | ||
884 | + | ||
885 | + <arr name="components"> | ||
886 | + <str>query</str> | ||
887 | + <str>facet</str> | ||
888 | + <str>mlt</str> | ||
889 | + <str>highlight</str> | ||
890 | + <str>stats</str> | ||
891 | + <str>debug</str> | ||
892 | + </arr> | ||
893 | + | ||
894 | + If you register a searchComponent to one of the standard names, | ||
895 | + that will be used instead of the default. | ||
896 | + | ||
897 | + To insert components before or after the 'standard' components, use: | ||
898 | + | ||
899 | + <arr name="first-components"> | ||
900 | + <str>myFirstComponentName</str> | ||
901 | + </arr> | ||
902 | + | ||
903 | + <arr name="last-components"> | ||
904 | + <str>myLastComponentName</str> | ||
905 | + </arr> | ||
906 | + | ||
907 | + NOTE: The component registered with the name "debug" will | ||
908 | + always be executed after the "last-components" | ||
909 | + | ||
910 | + --> | ||
911 | + | ||
912 | + <!-- Spell Check | ||
913 | + | ||
914 | + The spell check component can return a list of alternative spelling | ||
915 | + suggestions. | ||
916 | + | ||
917 | + http://wiki.apache.org/solr/SpellCheckComponent | ||
918 | + --> | ||
919 | + <searchComponent name="spellcheck" class="solr.SpellCheckComponent"> | ||
920 | + | ||
921 | + <str name="queryAnalyzerFieldType">text_general</str> | ||
922 | + | ||
923 | + <!-- Multiple "Spell Checkers" can be declared and used by this | ||
924 | + component | ||
925 | + --> | ||
926 | + | ||
927 | + <!-- a spellchecker built from a field of the main index --> | ||
928 | + <lst name="spellchecker"> | ||
929 | + <str name="name">default</str> | ||
930 | + <str name="field">_text_</str> | ||
931 | + <str name="classname">solr.DirectSolrSpellChecker</str> | ||
932 | + <!-- the spellcheck distance measure used, the default is the internal levenshtein --> | ||
933 | + <str name="distanceMeasure">internal</str> | ||
934 | + <!-- minimum accuracy needed to be considered a valid spellcheck suggestion --> | ||
935 | + <float name="accuracy">0.5</float> | ||
936 | + <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 --> | ||
937 | + <int name="maxEdits">2</int> | ||
938 | + <!-- the minimum shared prefix when enumerating terms --> | ||
939 | + <int name="minPrefix">1</int> | ||
940 | + <!-- maximum number of inspections per result. --> | ||
941 | + <int name="maxInspections">5</int> | ||
942 | + <!-- minimum length of a query term to be considered for correction --> | ||
943 | + <int name="minQueryLength">4</int> | ||
944 | + <!-- maximum threshold of documents a query term can appear to be considered for correction --> | ||
945 | + <float name="maxQueryFrequency">0.01</float> | ||
946 | + <!-- uncomment this to require suggestions to occur in 1% of the documents | ||
947 | + <float name="thresholdTokenFrequency">.01</float> | ||
948 | + --> | ||
949 | + </lst> | ||
950 | + | ||
951 | + <!-- a spellchecker that can break or combine words. See "/spell" handler below for usage --> | ||
952 | + <!-- | ||
953 | + <lst name="spellchecker"> | ||
954 | + <str name="name">wordbreak</str> | ||
955 | + <str name="classname">solr.WordBreakSolrSpellChecker</str> | ||
956 | + <str name="field">name</str> | ||
957 | + <str name="combineWords">true</str> | ||
958 | + <str name="breakWords">true</str> | ||
959 | + <int name="maxChanges">10</int> | ||
960 | + </lst> | ||
961 | + --> | ||
962 | + </searchComponent> | ||
963 | + | ||
964 | + <!-- A request handler for demonstrating the spellcheck component. | ||
965 | + | ||
966 | + NOTE: This is purely as an example. The whole purpose of the | ||
967 | + SpellCheckComponent is to hook it into the request handler that | ||
968 | + handles your normal user queries so that a separate request is | ||
969 | + not needed to get suggestions. | ||
970 | + | ||
971 | + IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS | ||
972 | + NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM! | ||
973 | + | ||
974 | + See http://wiki.apache.org/solr/SpellCheckComponent for details | ||
975 | + on the request parameters. | ||
976 | + --> | ||
977 | + <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy"> | ||
978 | + <lst name="defaults"> | ||
979 | + <!-- Solr will use suggestions from both the 'default' spellchecker | ||
980 | + and from the 'wordbreak' spellchecker and combine them. | ||
981 | + collations (re-written queries) can include a combination of | ||
982 | + corrections from both spellcheckers --> | ||
983 | + <str name="spellcheck.dictionary">default</str> | ||
984 | + <str name="spellcheck">on</str> | ||
985 | + <str name="spellcheck.extendedResults">true</str> | ||
986 | + <str name="spellcheck.count">10</str> | ||
987 | + <str name="spellcheck.alternativeTermCount">5</str> | ||
988 | + <str name="spellcheck.maxResultsForSuggest">5</str> | ||
989 | + <str name="spellcheck.collate">true</str> | ||
990 | + <str name="spellcheck.collateExtendedResults">true</str> | ||
991 | + <str name="spellcheck.maxCollationTries">10</str> | ||
992 | + <str name="spellcheck.maxCollations">5</str> | ||
993 | + </lst> | ||
994 | + <arr name="last-components"> | ||
995 | + <str>spellcheck</str> | ||
996 | + </arr> | ||
997 | + </requestHandler> | ||
998 | + | ||
999 | + <!-- Term Vector Component | ||
1000 | + | ||
1001 | + http://wiki.apache.org/solr/TermVectorComponent | ||
1002 | + --> | ||
1003 | + <searchComponent name="tvComponent" class="solr.TermVectorComponent"/> | ||
1004 | + | ||
1005 | + <!-- A request handler for demonstrating the term vector component | ||
1006 | + | ||
1007 | + This is purely as an example. | ||
1008 | + | ||
1009 | + In reality you will likely want to add the component to your | ||
1010 | + already specified request handlers. | ||
1011 | + --> | ||
1012 | + <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy"> | ||
1013 | + <lst name="defaults"> | ||
1014 | + <bool name="tv">true</bool> | ||
1015 | + </lst> | ||
1016 | + <arr name="last-components"> | ||
1017 | + <str>tvComponent</str> | ||
1018 | + </arr> | ||
1019 | + </requestHandler> | ||
1020 | + | ||
1021 | + <!-- Clustering Component. (Omitted here. See the default Solr example for a typical configuration.) --> | ||
1022 | + | ||
1023 | + <!-- Terms Component | ||
1024 | + | ||
1025 | + http://wiki.apache.org/solr/TermsComponent | ||
1026 | + | ||
1027 | + A component to return terms and document frequency of those | ||
1028 | + terms | ||
1029 | + --> | ||
1030 | + <searchComponent name="terms" class="solr.TermsComponent"/> | ||
1031 | + | ||
1032 | + <!-- A request handler for demonstrating the terms component --> | ||
1033 | + <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy"> | ||
1034 | + <lst name="defaults"> | ||
1035 | + <bool name="terms">true</bool> | ||
1036 | + <bool name="distrib">false</bool> | ||
1037 | + </lst> | ||
1038 | + <arr name="components"> | ||
1039 | + <str>terms</str> | ||
1040 | + </arr> | ||
1041 | + </requestHandler> | ||
1042 | + | ||
1043 | + | ||
1044 | + <!-- Query Elevation Component | ||
1045 | + | ||
1046 | + http://wiki.apache.org/solr/QueryElevationComponent | ||
1047 | + | ||
1048 | + a search component that enables you to configure the top | ||
1049 | + results for a given query regardless of the normal lucene | ||
1050 | + scoring. | ||
1051 | + --> | ||
1052 | + <searchComponent name="elevator" class="solr.QueryElevationComponent" > | ||
1053 | + <!-- pick a fieldType to analyze queries --> | ||
1054 | + <str name="queryFieldType">string</str> | ||
1055 | + <str name="config-file">elevate.xml</str> | ||
1056 | + </searchComponent> | ||
1057 | + | ||
1058 | + <!-- A request handler for demonstrating the elevator component --> | ||
1059 | + <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy"> | ||
1060 | + <lst name="defaults"> | ||
1061 | + <str name="echoParams">explicit</str> | ||
1062 | + </lst> | ||
1063 | + <arr name="last-components"> | ||
1064 | + <str>elevator</str> | ||
1065 | + </arr> | ||
1066 | + </requestHandler> | ||
1067 | + | ||
1068 | + <!-- Highlighting Component | ||
1069 | + | ||
1070 | + http://wiki.apache.org/solr/HighlightingParameters | ||
1071 | + --> | ||
1072 | + <searchComponent class="solr.HighlightComponent" name="highlight"> | ||
1073 | + <highlighting> | ||
1074 | + <!-- Configure the standard fragmenter --> | ||
1075 | + <!-- This could most likely be commented out in the "default" case --> | ||
1076 | + <fragmenter name="gap" | ||
1077 | + default="true" | ||
1078 | + class="solr.highlight.GapFragmenter"> | ||
1079 | + <lst name="defaults"> | ||
1080 | + <int name="hl.fragsize">100</int> | ||
1081 | + </lst> | ||
1082 | + </fragmenter> | ||
1083 | + | ||
1084 | + <!-- A regular-expression-based fragmenter | ||
1085 | + (for sentence extraction) | ||
1086 | + --> | ||
1087 | + <fragmenter name="regex" | ||
1088 | + class="solr.highlight.RegexFragmenter"> | ||
1089 | + <lst name="defaults"> | ||
1090 | + <!-- slightly smaller fragsizes work better because of slop --> | ||
1091 | + <int name="hl.fragsize">70</int> | ||
1092 | + <!-- allow 50% slop on fragment sizes --> | ||
1093 | + <float name="hl.regex.slop">0.5</float> | ||
1094 | + <!-- a basic sentence pattern --> | ||
1095 | + <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str> | ||
1096 | + </lst> | ||
1097 | + </fragmenter> | ||
1098 | + | ||
1099 | + <!-- Configure the standard formatter --> | ||
1100 | + <formatter name="html" | ||
1101 | + default="true" | ||
1102 | + class="solr.highlight.HtmlFormatter"> | ||
1103 | + <lst name="defaults"> | ||
1104 | + <str name="hl.simple.pre"><![CDATA[<em>]]></str> | ||
1105 | + <str name="hl.simple.post"><![CDATA[</em>]]></str> | ||
1106 | + </lst> | ||
1107 | + </formatter> | ||
1108 | + | ||
1109 | + <!-- Configure the standard encoder --> | ||
1110 | + <encoder name="html" | ||
1111 | + class="solr.highlight.HtmlEncoder" /> | ||
1112 | + | ||
1113 | + <!-- Configure the standard fragListBuilder --> | ||
1114 | + <fragListBuilder name="simple" | ||
1115 | + class="solr.highlight.SimpleFragListBuilder"/> | ||
1116 | + | ||
1117 | + <!-- Configure the single fragListBuilder --> | ||
1118 | + <fragListBuilder name="single" | ||
1119 | + class="solr.highlight.SingleFragListBuilder"/> | ||
1120 | + | ||
1121 | + <!-- Configure the weighted fragListBuilder --> | ||
1122 | + <fragListBuilder name="weighted" | ||
1123 | + default="true" | ||
1124 | + class="solr.highlight.WeightedFragListBuilder"/> | ||
1125 | + | ||
1126 | + <!-- default tag FragmentsBuilder --> | ||
1127 | + <fragmentsBuilder name="default" | ||
1128 | + default="true" | ||
1129 | + class="solr.highlight.ScoreOrderFragmentsBuilder"> | ||
1130 | + <!-- | ||
1131 | + <lst name="defaults"> | ||
1132 | + <str name="hl.multiValuedSeparatorChar">/</str> | ||
1133 | + </lst> | ||
1134 | + --> | ||
1135 | + </fragmentsBuilder> | ||
1136 | + | ||
1137 | + <!-- multi-colored tag FragmentsBuilder --> | ||
1138 | + <fragmentsBuilder name="colored" | ||
1139 | + class="solr.highlight.ScoreOrderFragmentsBuilder"> | ||
1140 | + <lst name="defaults"> | ||
1141 | + <str name="hl.tag.pre"><![CDATA[ | ||
1142 | + <b style="background:yellow">,<b style="background:lawgreen">, | ||
1143 | + <b style="background:aquamarine">,<b style="background:magenta">, | ||
1144 | + <b style="background:palegreen">,<b style="background:coral">, | ||
1145 | + <b style="background:wheat">,<b style="background:khaki">, | ||
1146 | + <b style="background:lime">,<b style="background:deepskyblue">]]></str> | ||
1147 | + <str name="hl.tag.post"><![CDATA[</b>]]></str> | ||
1148 | + </lst> | ||
1149 | + </fragmentsBuilder> | ||
1150 | + | ||
1151 | + <boundaryScanner name="default" | ||
1152 | + default="true" | ||
1153 | + class="solr.highlight.SimpleBoundaryScanner"> | ||
1154 | + <lst name="defaults"> | ||
1155 | + <str name="hl.bs.maxScan">10</str> | ||
1156 | + <str name="hl.bs.chars">.,!? 	 </str> | ||
1157 | + </lst> | ||
1158 | + </boundaryScanner> | ||
1159 | + | ||
1160 | + <boundaryScanner name="breakIterator" | ||
1161 | + class="solr.highlight.BreakIteratorBoundaryScanner"> | ||
1162 | + <lst name="defaults"> | ||
1163 | + <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE --> | ||
1164 | + <str name="hl.bs.type">WORD</str> | ||
1165 | + <!-- language and country are used when constructing Locale object. --> | ||
1166 | + <!-- And the Locale object will be used when getting instance of BreakIterator --> | ||
1167 | + <str name="hl.bs.language">en</str> | ||
1168 | + <str name="hl.bs.country">US</str> | ||
1169 | + </lst> | ||
1170 | + </boundaryScanner> | ||
1171 | + </highlighting> | ||
1172 | + </searchComponent> | ||
1173 | + | ||
1174 | + <!-- Update Processors | ||
1175 | + | ||
1176 | + Chains of Update Processor Factories for dealing with Update | ||
1177 | + Requests can be declared, and then used by name in Update | ||
1178 | + Request Processors | ||
1179 | + | ||
1180 | + http://wiki.apache.org/solr/UpdateRequestProcessor | ||
1181 | + | ||
1182 | + --> | ||
1183 | + | ||
1184 | + <!-- Add unknown fields to the schema | ||
1185 | + | ||
1186 | + An example field type guessing update processor that will | ||
1187 | + attempt to parse string-typed field values as Booleans, Longs, | ||
1188 | + Doubles, or Dates, and then add schema fields with the guessed | ||
1189 | + field types. | ||
1190 | + | ||
1191 | + This requires that the schema is both managed and mutable, by | ||
1192 | + declaring schemaFactory as ManagedIndexSchemaFactory, with | ||
1193 | + mutable specified as true. | ||
1194 | + | ||
1195 | + See http://wiki.apache.org/solr/GuessingFieldTypes | ||
1196 | + --> | ||
1197 | + <updateRequestProcessorChain name="add-unknown-fields-to-the-schema"> | ||
1198 | + <!-- UUIDUpdateProcessorFactory will generate an id if none is present in the incoming document --> | ||
1199 | + <processor class="solr.UUIDUpdateProcessorFactory" /> | ||
1200 | + | ||
1201 | + <processor class="solr.LogUpdateProcessorFactory"/> | ||
1202 | + <processor class="solr.DistributedUpdateProcessorFactory"/> | ||
1203 | + <processor class="solr.RemoveBlankFieldUpdateProcessorFactory"/> | ||
1204 | + <processor class="solr.FieldNameMutatingUpdateProcessorFactory"> | ||
1205 | + <str name="pattern">[^\w-\.]</str> | ||
1206 | + <str name="replacement">_</str> | ||
1207 | + </processor> | ||
1208 | + <processor class="solr.ParseBooleanFieldUpdateProcessorFactory"/> | ||
1209 | + <processor class="solr.ParseLongFieldUpdateProcessorFactory"/> | ||
1210 | + <processor class="solr.ParseDoubleFieldUpdateProcessorFactory"/> | ||
1211 | + <processor class="solr.ParseDateFieldUpdateProcessorFactory"> | ||
1212 | + <arr name="format"> | ||
1213 | + <str>yyyy-MM-dd'T'HH:mm:ss.SSSZ</str> | ||
1214 | + <str>yyyy-MM-dd'T'HH:mm:ss,SSSZ</str> | ||
1215 | + <str>yyyy-MM-dd'T'HH:mm:ss.SSS</str> | ||
1216 | + <str>yyyy-MM-dd'T'HH:mm:ss,SSS</str> | ||
1217 | + <str>yyyy-MM-dd'T'HH:mm:ssZ</str> | ||
1218 | + <str>yyyy-MM-dd'T'HH:mm:ss</str> | ||
1219 | + <str>yyyy-MM-dd'T'HH:mmZ</str> | ||
1220 | + <str>yyyy-MM-dd'T'HH:mm</str> | ||
1221 | + <str>yyyy-MM-dd HH:mm:ss.SSSZ</str> | ||
1222 | + <str>yyyy-MM-dd HH:mm:ss,SSSZ</str> | ||
1223 | + <str>yyyy-MM-dd HH:mm:ss.SSS</str> | ||
1224 | + <str>yyyy-MM-dd HH:mm:ss,SSS</str> | ||
1225 | + <str>yyyy-MM-dd HH:mm:ssZ</str> | ||
1226 | + <str>yyyy-MM-dd HH:mm:ss</str> | ||
1227 | + <str>yyyy-MM-dd HH:mmZ</str> | ||
1228 | + <str>yyyy-MM-dd HH:mm</str> | ||
1229 | + <str>yyyy-MM-dd</str> | ||
1230 | + </arr> | ||
1231 | + </processor> | ||
1232 | +<!-- | ||
1233 | + <processor class="solr.AddSchemaFieldsUpdateProcessorFactory"> | ||
1234 | + <str name="defaultFieldType">strings</str> | ||
1235 | + <lst name="typeMapping"> | ||
1236 | + <str name="valueClass">java.lang.Boolean</str> | ||
1237 | + <str name="fieldType">booleans</str> | ||
1238 | + </lst> | ||
1239 | + <lst name="typeMapping"> | ||
1240 | + <str name="valueClass">java.util.Date</str> | ||
1241 | + <str name="fieldType">tdates</str> | ||
1242 | + </lst> | ||
1243 | + <lst name="typeMapping"> | ||
1244 | + <str name="valueClass">java.lang.Long</str> | ||
1245 | + <str name="valueClass">java.lang.Integer</str> | ||
1246 | + <str name="fieldType">tlongs</str> | ||
1247 | + </lst> | ||
1248 | + <lst name="typeMapping"> | ||
1249 | + <str name="valueClass">java.lang.Number</str> | ||
1250 | + <str name="fieldType">tdoubles</str> | ||
1251 | + </lst> | ||
1252 | + </processor> | ||
1253 | +--> | ||
1254 | + <processor class="solr.RunUpdateProcessorFactory"/> | ||
1255 | + </updateRequestProcessorChain> | ||
1256 | + | ||
1257 | + <!-- Deduplication | ||
1258 | + | ||
1259 | + An example dedup update processor that creates the "id" field | ||
1260 | + on the fly based on the hash code of some other fields. This | ||
1261 | + example has overwriteDupes set to false since we are using the | ||
1262 | + id field as the signatureField and Solr will maintain | ||
1263 | + uniqueness based on that anyway. | ||
1264 | + | ||
1265 | + --> | ||
1266 | + <!-- | ||
1267 | + <updateRequestProcessorChain name="dedupe"> | ||
1268 | + <processor class="solr.processor.SignatureUpdateProcessorFactory"> | ||
1269 | + <bool name="enabled">true</bool> | ||
1270 | + <str name="signatureField">id</str> | ||
1271 | + <bool name="overwriteDupes">false</bool> | ||
1272 | + <str name="fields">name,features,cat</str> | ||
1273 | + <str name="signatureClass">solr.processor.Lookup3Signature</str> | ||
1274 | + </processor> | ||
1275 | + <processor class="solr.LogUpdateProcessorFactory" /> | ||
1276 | + <processor class="solr.RunUpdateProcessorFactory" /> | ||
1277 | + </updateRequestProcessorChain> | ||
1278 | + --> | ||
1279 | + | ||
1280 | + <!-- Language identification | ||
1281 | + | ||
1282 | + This example update chain identifies the language of the incoming | ||
1283 | + documents using the langid contrib. The detected language is | ||
1284 | + written to field language_s. No field name mapping is done. | ||
1285 | + The fields used for detection are text, title, subject and description, | ||
1286 | + making this example suitable for detecting languages form full-text | ||
1287 | + rich documents injected via ExtractingRequestHandler. | ||
1288 | + See more about langId at http://wiki.apache.org/solr/LanguageDetection | ||
1289 | + --> | ||
1290 | + <!-- | ||
1291 | + <updateRequestProcessorChain name="langid"> | ||
1292 | + <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory"> | ||
1293 | + <str name="langid.fl">text,title,subject,description</str> | ||
1294 | + <str name="langid.langField">language_s</str> | ||
1295 | + <str name="langid.fallback">en</str> | ||
1296 | + </processor> | ||
1297 | + <processor class="solr.LogUpdateProcessorFactory" /> | ||
1298 | + <processor class="solr.RunUpdateProcessorFactory" /> | ||
1299 | + </updateRequestProcessorChain> | ||
1300 | + --> | ||
1301 | + | ||
1302 | + <!-- Script update processor | ||
1303 | + | ||
1304 | + This example hooks in an update processor implemented using JavaScript. | ||
1305 | + | ||
1306 | + See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor | ||
1307 | + --> | ||
1308 | + <!-- | ||
1309 | + <updateRequestProcessorChain name="script"> | ||
1310 | + <processor class="solr.StatelessScriptUpdateProcessorFactory"> | ||
1311 | + <str name="script">update-script.js</str> | ||
1312 | + <lst name="params"> | ||
1313 | + <str name="config_param">example config parameter</str> | ||
1314 | + </lst> | ||
1315 | + </processor> | ||
1316 | + <processor class="solr.RunUpdateProcessorFactory" /> | ||
1317 | + </updateRequestProcessorChain> | ||
1318 | + --> | ||
1319 | + | ||
1320 | + <!-- Response Writers | ||
1321 | + | ||
1322 | + http://wiki.apache.org/solr/QueryResponseWriter | ||
1323 | + | ||
1324 | + Request responses will be written using the writer specified by | ||
1325 | + the 'wt' request parameter matching the name of a registered | ||
1326 | + writer. | ||
1327 | + | ||
1328 | + The "default" writer is the default and will be used if 'wt' is | ||
1329 | + not specified in the request. | ||
1330 | + --> | ||
1331 | + <!-- The following response writers are implicitly configured unless | ||
1332 | + overridden... | ||
1333 | + --> | ||
1334 | + <!-- | ||
1335 | + <queryResponseWriter name="xml" | ||
1336 | + default="true" | ||
1337 | + class="solr.XMLResponseWriter" /> | ||
1338 | + <queryResponseWriter name="json" class="solr.JSONResponseWriter"/> | ||
1339 | + <queryResponseWriter name="python" class="solr.PythonResponseWriter"/> | ||
1340 | + <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/> | ||
1341 | + <queryResponseWriter name="php" class="solr.PHPResponseWriter"/> | ||
1342 | + <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/> | ||
1343 | + <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/> | ||
1344 | + <queryResponseWriter name="publishersSchema.xml" class="solr.SchemaXmlResponseWriter"/> | ||
1345 | + --> | ||
1346 | + | ||
1347 | + <queryResponseWriter name="json" class="solr.JSONResponseWriter"> | ||
1348 | + <!-- For the purposes of the tutorial, JSON responses are written as | ||
1349 | + plain text so that they are easy to read in *any* browser. | ||
1350 | + If you expect a MIME type of "application/json" just remove this override. | ||
1351 | + --> | ||
1352 | + <str name="content-type">text/plain; charset=UTF-8</str> | ||
1353 | + </queryResponseWriter> | ||
1354 | + | ||
1355 | + <!-- | ||
1356 | + Custom response writers can be declared as needed... | ||
1357 | + --> | ||
1358 | + <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"> | ||
1359 | + <str name="template.base.dir">${velocity.template.base.dir:}</str> | ||
1360 | + <str name="solr.resource.loader.enabled">${velocity.solr.resource.loader.enabled:true}</str> | ||
1361 | + <str name="params.resource.loader.enabled">${velocity.params.resource.loader.enabled:false}</str> | ||
1362 | + </queryResponseWriter> | ||
1363 | + | ||
1364 | + <!-- XSLT response writer transforms the XML output by any xslt file found | ||
1365 | + in Solr's conf/xslt directory. Changes to xslt files are checked for | ||
1366 | + every xsltCacheLifetimeSeconds. | ||
1367 | + --> | ||
1368 | + <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter"> | ||
1369 | + <int name="xsltCacheLifetimeSeconds">5</int> | ||
1370 | + </queryResponseWriter> | ||
1371 | + | ||
1372 | + <!-- Query Parsers | ||
1373 | + | ||
1374 | + https://cwiki.apache.org/confluence/display/solr/Query+Syntax+and+Parsing | ||
1375 | + | ||
1376 | + Multiple QParserPlugins can be registered by name, and then | ||
1377 | + used in either the "defType" param for the QueryComponent (used | ||
1378 | + by SearchHandler) or in LocalParams | ||
1379 | + --> | ||
1380 | + <!-- example of registering a query parser --> | ||
1381 | + <!-- | ||
1382 | + <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/> | ||
1383 | + --> | ||
1384 | + | ||
1385 | + <!-- Function Parsers | ||
1386 | + | ||
1387 | + http://wiki.apache.org/solr/FunctionQuery | ||
1388 | + | ||
1389 | + Multiple ValueSourceParsers can be registered by name, and then | ||
1390 | + used as function names when using the "func" QParser. | ||
1391 | + --> | ||
1392 | + <!-- example of registering a custom function parser --> | ||
1393 | + <!-- | ||
1394 | + <valueSourceParser name="myfunc" | ||
1395 | + class="com.mycompany.MyValueSourceParser" /> | ||
1396 | + --> | ||
1397 | + | ||
1398 | + | ||
1399 | + <!-- Document Transformers | ||
1400 | + http://wiki.apache.org/solr/DocTransformers | ||
1401 | + --> | ||
1402 | + <!-- | ||
1403 | + Could be something like: | ||
1404 | + <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" > | ||
1405 | + <int name="connection">jdbc://....</int> | ||
1406 | + </transformer> | ||
1407 | + | ||
1408 | + To add a constant value to all docs, use: | ||
1409 | + <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" > | ||
1410 | + <int name="value">5</int> | ||
1411 | + </transformer> | ||
1412 | + | ||
1413 | + If you want the user to still be able to change it with _value:something_ use this: | ||
1414 | + <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" > | ||
1415 | + <double name="defaultValue">5</double> | ||
1416 | + </transformer> | ||
1417 | + | ||
1418 | + If you are using the QueryElevationComponent, you may wish to mark documents that get boosted. The | ||
1419 | + EditorialMarkerFactory will do exactly that: | ||
1420 | + <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" /> | ||
1421 | + --> | ||
1422 | +</config> |
-
Please register or login to post a comment