simple_solr_client 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES.md +3 -0
- data/README.md +0 -3
- data/lib/simple_solr_client.rb +12 -7
- data/lib/simple_solr_client/client.rb +1 -1
- data/lib/simple_solr_client/core.rb +2 -8
- data/lib/simple_solr_client/core/admin.rb +0 -1
- data/lib/simple_solr_client/core/core_data.rb +0 -4
- data/lib/simple_solr_client/version.rb +1 -1
- data/simple_solr_client.gemspec +6 -8
- data/solr_sample_core/conf/schema.xml +3 -1
- data/solr_sample_core/conf/solrconfig.xml +1163 -1493
- data/spec/client_basics_spec.rb +5 -5
- data/spec/core_basics_spec.rb +21 -0
- data/spec/minitest_helper.rb +6 -3
- metadata +11 -36
- data/lib/simple_solr_client/schema.rb +0 -217
- data/lib/simple_solr_client/schema/analysis.rb +0 -79
- data/lib/simple_solr_client/schema/copyfield.rb +0 -42
- data/lib/simple_solr_client/schema/dynamic_field.rb +0 -23
- data/lib/simple_solr_client/schema/field.rb +0 -46
- data/lib/simple_solr_client/schema/field_or_type.rb +0 -112
- data/lib/simple_solr_client/schema/field_type.rb +0 -47
- data/lib/simple_solr_client/schema/matcher.rb +0 -16
- data/spec/core_basics.rb +0 -21
- data/spec/schema_spec.rb +0 -113
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 30fd957f6e5d14cd85c48de799f9830718e066c7ec9722dda20f4b82171c8cf0
|
4
|
+
data.tar.gz: 2fcf4b1673c6d3d02758c0a8c4ae09fe70e72e94faf3d7b35ef47613fb859736
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81bc4a9f5a78401c80a93a43ae80e2bb4aa95edfd321bcfba33ee363250eb1b78416fa0139ddfabf93608f89c5838b8759eee1f830747a98ade73e60cec29b28
|
7
|
+
data.tar.gz: 47fc69f3795ba9452a1c22dcbe6ef93eab2fbb57008b4852d40234828d9ca3ed3fe6e61d187d4ca49e93dd2e77c84589c89a42356396c3bd77fb6d9f010dc718
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -134,9 +134,6 @@ ft.stored #=> true
|
|
134
134
|
ft.indexed #=> true
|
135
135
|
# etc.
|
136
136
|
|
137
|
-
newft = SimpleSolrClient::Schema::FieldType.new_from_xml(xmlstring)
|
138
|
-
schema.add_field_type(newft)
|
139
|
-
|
140
137
|
ft.name #=> text
|
141
138
|
ft.query_tokens "Don't forget me when I'm getting H20"
|
142
139
|
#=> ["don't", "forget", "me", "when", "i'm", ["getting", "get"], "h20"]
|
data/lib/simple_solr_client.rb
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# Ugh. Need to turn off warnings for httpclient
|
2
|
+
oldverbose = $VERBOSE
|
3
|
+
$VERBOSE = nil
|
4
|
+
require 'httpclient'
|
5
|
+
$VERBOSE = oldverbose
|
6
|
+
|
7
|
+
require 'forwardable'
|
8
|
+
require 'json'
|
9
|
+
|
10
|
+
require "simple_solr_client/version"
|
11
|
+
|
12
|
+
|
1
13
|
module SimpleSolrClient
|
2
14
|
|
3
15
|
ESCAPE_CHARS = '+-&|!(){}[]^"~*?:\\'
|
@@ -12,18 +24,11 @@ module SimpleSolrClient
|
|
12
24
|
esc = str.to_s.gsub(ESCAPE_PAT, ESCAPE_MAP)
|
13
25
|
end
|
14
26
|
|
15
|
-
|
16
27
|
# Where is the sample core configuration?
|
17
28
|
SAMPLE_CORE_DIR = File.absolute_path File.join(File.dirname(__FILE__), '..', 'solr_sample_core')
|
18
29
|
|
19
30
|
end
|
20
31
|
|
21
|
-
require 'httpclient'
|
22
|
-
require 'forwardable'
|
23
|
-
require 'json'
|
24
|
-
|
25
|
-
require "simple_solr_client/version"
|
26
|
-
|
27
32
|
# Need to load core before client because of inter-dependencies resulting
|
28
33
|
# in 'require' recursion
|
29
34
|
|
@@ -2,7 +2,6 @@ require 'httpclient'
|
|
2
2
|
require 'simple_solr_client/response/generic_response'
|
3
3
|
require 'securerandom'
|
4
4
|
|
5
|
-
require 'simple_solr_client/core'
|
6
5
|
require 'simple_solr_client/client/system'
|
7
6
|
|
8
7
|
module SimpleSolrClient
|
@@ -181,3 +180,4 @@ module SimpleSolrClient
|
|
181
180
|
end
|
182
181
|
|
183
182
|
end
|
183
|
+
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# Pre-define the inheritance so Ruby doesn't complain
|
2
2
|
# on import.
|
3
|
-
require 'simple_solr_client/client'
|
4
|
-
require 'simple_solr_client/schema'
|
5
3
|
module SimpleSolrClient
|
6
|
-
class
|
7
|
-
end
|
4
|
+
class Client; end
|
5
|
+
class Core < Client; end
|
8
6
|
end
|
9
7
|
|
10
8
|
|
@@ -46,10 +44,6 @@ class SimpleSolrClient::Core
|
|
46
44
|
post_json('update/json', object_to_post, response_type)
|
47
45
|
end
|
48
46
|
|
49
|
-
def schema
|
50
|
-
@schema ||= SimpleSolrClient::Schema.new(self)
|
51
|
-
end
|
52
|
-
|
53
47
|
end
|
54
48
|
|
55
49
|
|
data/simple_solr_client.gemspec
CHANGED
@@ -20,14 +20,12 @@ Gem::Specification.new do |spec|
|
|
20
20
|
# Thread-safe, cross-platform http client
|
21
21
|
spec.add_dependency "httpclient"
|
22
22
|
|
23
|
-
#
|
24
|
-
spec.add_dependency '
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
spec.add_development_dependency "bundler", "~> 1.7"
|
29
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
# For the solr_shell script
|
24
|
+
spec.add_dependency 'pry'
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", ">= 1.7"
|
27
|
+
spec.add_development_dependency "rake"
|
30
28
|
spec.add_development_dependency "minitest"
|
31
29
|
spec.add_development_dependency 'minitest-reporters'
|
32
|
-
|
30
|
+
|
33
31
|
end
|
@@ -9,6 +9,8 @@
|
|
9
9
|
multiValued="false"/>
|
10
10
|
<uniqueKey>id</uniqueKey>
|
11
11
|
|
12
|
+
<field name="_version_" type="string" indexed="true" docValues="true"/>
|
13
|
+
|
12
14
|
<!-- =========================================
|
13
15
|
=========================================
|
14
16
|
== FIELD TYPE DEFINITIONS ==
|
@@ -48,7 +50,7 @@
|
|
48
50
|
<analyzer>
|
49
51
|
<tokenizer class="solr.StandardTokenizerFactory"/>
|
50
52
|
<filter class="solr.StopFilterFactory" ignoreCase="true"
|
51
|
-
words="stopwords.txt"
|
53
|
+
words="stopwords.txt"/>
|
52
54
|
<filter class="solr.LowerCaseFilterFactory"/>
|
53
55
|
</analyzer>
|
54
56
|
</fieldType>
|
@@ -21,1546 +21,1223 @@
|
|
21
21
|
this file, see http://wiki.apache.org/solr/SolrConfigXml.
|
22
22
|
-->
|
23
23
|
<config>
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
<!-- In all configuration below, a prefix of "solr." for class names
|
25
|
+
is an alias that causes solr to search appropriate packages,
|
26
|
+
including org.apache.solr.(search|update|request|core|analysis)
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
-->
|
31
|
-
|
32
|
-
<!-- Controls what version of Lucene various components of Solr
|
33
|
-
adhere to. Generally, you want to use the latest version to
|
34
|
-
get all bug fixes and improvements. It is highly recommended
|
35
|
-
that you fully re-index after changing this setting as it can
|
36
|
-
affect both how text is indexed and queried.
|
28
|
+
You may also specify a fully qualified Java classname if you
|
29
|
+
have your own custom plugins.
|
37
30
|
-->
|
38
|
-
<luceneMatchVersion>4.9</luceneMatchVersion>
|
39
31
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
32
|
+
<!-- Controls what version of Lucene various components of Solr
|
33
|
+
adhere to. Generally, you want to use the latest version to
|
34
|
+
get all bug fixes and improvements. It is highly recommended
|
35
|
+
that you fully re-index after changing this setting as it can
|
36
|
+
affect both how text is indexed and queried.
|
37
|
+
-->
|
38
|
+
<luceneMatchVersion>6.6.2</luceneMatchVersion>
|
39
|
+
|
40
|
+
<!-- <lib/> directives can be used to instruct Solr to load any Jars
|
41
|
+
identified and use them to resolve any "plugins" specified in
|
42
|
+
your solrconfig.xml or schema.xml (ie: Analyzers, Request
|
43
|
+
Handlers, etc...).
|
44
|
+
|
45
|
+
All directories and paths are resolved relative to the
|
46
|
+
instanceDir.
|
47
|
+
|
48
|
+
Please note that <lib/> directives are processed in the order
|
49
|
+
that they appear in your solrconfig.xml file, and are "stacked"
|
50
|
+
on top of each other when building a ClassLoader - so if you have
|
51
|
+
plugin jars with dependencies on other jars, the "lower level"
|
52
|
+
dependency jars should be loaded first.
|
53
|
+
|
54
|
+
If a "./lib" directory exists in your instanceDir, all files
|
55
|
+
found in it are included as if you had used the following
|
56
|
+
syntax...
|
57
|
+
|
58
|
+
<lib dir="./lib" />
|
59
|
+
-->
|
44
60
|
|
45
|
-
|
46
|
-
|
61
|
+
<!-- A 'dir' option by itself adds any files found in the directory
|
62
|
+
to the classpath, this is useful for including all jars in a
|
63
|
+
directory.
|
47
64
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
plugin jars with dependencies on other jars, the "lower level"
|
52
|
-
dependency jars should be loaded first.
|
65
|
+
When a 'regex' is specified in addition to a 'dir', only the
|
66
|
+
files in that directory which completely match the regex
|
67
|
+
(anchored on both ends) will be included.
|
53
68
|
|
54
|
-
|
55
|
-
|
56
|
-
syntax...
|
69
|
+
If a 'dir' option (with or without a regex) is used and nothing
|
70
|
+
is found that matches, a warning will be logged.
|
57
71
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
to the classpath, this is useful for including all jars in a
|
63
|
-
directory.
|
72
|
+
The examples below can be used to load some solr-contribs along
|
73
|
+
with their external dependencies.
|
74
|
+
-->
|
75
|
+
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
|
64
76
|
|
65
|
-
|
66
|
-
|
67
|
-
(anchored on both ends) will be included.
|
77
|
+
<lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
|
78
|
+
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
|
68
79
|
|
69
|
-
|
70
|
-
|
80
|
+
<lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
|
81
|
+
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />
|
71
82
|
|
72
|
-
|
73
|
-
|
74
|
-
-->
|
75
|
-
<lib dir="../../../contrib/extraction/lib" regex=".*\.jar"/>
|
76
|
-
<lib dir="../../../dist/" regex="solr-cell-\d.*\.jar"/>
|
83
|
+
<lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
|
84
|
+
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
|
77
85
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
86
|
+
<!-- an exact 'path' can be used instead of a 'dir' to specify a
|
87
|
+
specific jar file. This will cause a serious error to be logged
|
88
|
+
if it can't be loaded.
|
89
|
+
-->
|
90
|
+
<!--
|
91
|
+
<lib path="../a-jar-that-does-not-exist.jar" />
|
92
|
+
-->
|
93
|
+
|
94
|
+
<!-- Data Directory
|
95
|
+
|
96
|
+
Used to specify an alternate directory to hold all index data
|
97
|
+
other than the default ./data under the Solr home. If
|
98
|
+
replication is in use, this should match the replication
|
99
|
+
configuration.
|
100
|
+
-->
|
101
|
+
<dataDir>${solr.data.dir:}</dataDir>
|
83
102
|
|
84
|
-
<lib dir="../../../contrib/velocity/lib" regex=".*\.jar"/>
|
85
|
-
<lib dir="../../../dist/" regex="solr-velocity-\d.*\.jar"/>
|
86
103
|
|
104
|
+
<!-- The DirectoryFactory to use for indexes.
|
105
|
+
|
106
|
+
solr.StandardDirectoryFactory is filesystem
|
107
|
+
based and tries to pick the best implementation for the current
|
108
|
+
JVM and platform. solr.NRTCachingDirectoryFactory, the default,
|
109
|
+
wraps solr.StandardDirectoryFactory and caches small files in memory
|
110
|
+
for better NRT performance.
|
87
111
|
|
88
|
-
|
112
|
+
One can force a particular implementation via solr.MMapDirectoryFactory,
|
113
|
+
solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
|
89
114
|
|
90
|
-
|
91
|
-
|
92
|
-
if it can't be loaded.
|
93
|
-
-->
|
94
|
-
<!--
|
95
|
-
<lib path="../a-jar-that-does-not-exist.jar" />
|
115
|
+
solr.RAMDirectoryFactory is memory based, not
|
116
|
+
persistent, and doesn't work with replication.
|
96
117
|
-->
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
118
|
+
<directoryFactory name="DirectoryFactory"
|
119
|
+
class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
|
120
|
+
|
121
|
+
<!-- The CodecFactory for defining the format of the inverted index.
|
122
|
+
The default implementation is SchemaCodecFactory, which is the official Lucene
|
123
|
+
index format, but hooks into the schema to provide per-field customization of
|
124
|
+
the postings lists and per-document values in the fieldType element
|
125
|
+
(postingsFormat/docValuesFormat). Note that most of the alternative implementations
|
126
|
+
are experimental, so if you choose to customize the index format, it's a good
|
127
|
+
idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
|
128
|
+
before upgrading to a newer version to avoid unnecessary reindexing.
|
129
|
+
-->
|
130
|
+
<codecFactory class="solr.SchemaCodecFactory"/>
|
131
|
+
|
132
|
+
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
133
|
+
Index Config - These settings control low-level behavior of indexing
|
134
|
+
Most example settings here show the default value, but are commented
|
135
|
+
out, to more easily see where customizations have been made.
|
136
|
+
|
137
|
+
Note: This replaces <indexDefaults> and <mainIndex> from older versions
|
138
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
139
|
+
<indexConfig>
|
140
|
+
<!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
|
141
|
+
LimitTokenCountFilterFactory in your fieldType definition. E.g.
|
142
|
+
<filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
|
143
|
+
-->
|
144
|
+
<!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
|
145
|
+
<!-- <writeLockTimeout>1000</writeLockTimeout> -->
|
146
|
+
|
147
|
+
<!-- Expert: Enabling compound file will use less files for the index,
|
148
|
+
using fewer file descriptors on the expense of performance decrease.
|
149
|
+
Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
|
150
|
+
<!-- <useCompoundFile>false</useCompoundFile> -->
|
151
|
+
|
152
|
+
<!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
|
153
|
+
indexing for buffering added documents and deletions before they are
|
154
|
+
flushed to the Directory.
|
155
|
+
maxBufferedDocs sets a limit on the number of documents buffered
|
156
|
+
before flushing.
|
157
|
+
If both ramBufferSizeMB and maxBufferedDocs is set, then
|
158
|
+
Lucene will flush based on whichever limit is hit first.
|
159
|
+
The default is 100 MB. -->
|
160
|
+
<!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
|
161
|
+
<!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
|
162
|
+
|
163
|
+
<!-- Expert: Merge Policy
|
164
|
+
The Merge Policy in Lucene controls how merging of segments is done.
|
165
|
+
The default since Solr/Lucene 3.3 is TieredMergePolicy.
|
166
|
+
The default since Lucene 2.3 was the LogByteSizeMergePolicy,
|
167
|
+
Even older versions of Lucene used LogDocMergePolicy.
|
104
168
|
-->
|
105
|
-
|
169
|
+
<!--
|
170
|
+
<mergePolicyFactory class="solr.TieredMergePolicyFactory">
|
171
|
+
<int name="maxMergeAtOnce">10</int>
|
172
|
+
<int name="segmentsPerTier">10</int>
|
173
|
+
</mergePolicyFactory>
|
174
|
+
-->
|
106
175
|
|
176
|
+
<!-- Expert: Merge Scheduler
|
177
|
+
The Merge Scheduler in Lucene controls how merges are
|
178
|
+
performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
|
179
|
+
can perform merges in the background using separate threads.
|
180
|
+
The SerialMergeScheduler (Lucene 2.2 default) does not.
|
181
|
+
-->
|
182
|
+
<!--
|
183
|
+
<mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
|
184
|
+
-->
|
107
185
|
|
108
|
-
<!--
|
186
|
+
<!-- LockFactory
|
109
187
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
188
|
+
This option specifies which Lucene LockFactory implementation
|
189
|
+
to use.
|
190
|
+
|
191
|
+
single = SingleInstanceLockFactory - suggested for a
|
192
|
+
read-only index or when there is no possibility of
|
193
|
+
another process trying to modify the index.
|
194
|
+
native = NativeFSLockFactory - uses OS native file locking.
|
195
|
+
Do not use when multiple solr webapps in the same
|
196
|
+
JVM are attempting to share a single index.
|
197
|
+
simple = SimpleFSLockFactory - uses a plain file for locking
|
115
198
|
|
116
|
-
|
117
|
-
|
199
|
+
Defaults: 'native' is default for Solr3.6 and later, otherwise
|
200
|
+
'simple' is the default
|
118
201
|
|
119
|
-
|
120
|
-
|
121
|
-
-->
|
122
|
-
<directoryFactory name="DirectoryFactory"
|
123
|
-
class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
|
124
|
-
|
125
|
-
|
126
|
-
<!-- These will be used if you are using the solr.HdfsDirectoryFactory,
|
127
|
-
otherwise they will be ignored. If you don't plan on using hdfs,
|
128
|
-
you can safely remove this section. -->
|
129
|
-
<!-- The root directory that collection data should be written to. -->
|
130
|
-
<str name="solr.hdfs.home">${solr.hdfs.home:}</str>
|
131
|
-
<!-- The hadoop configuration files to use for the hdfs client. -->
|
132
|
-
<str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
|
133
|
-
<!-- Enable/Disable the hdfs cache. -->
|
134
|
-
<str name="solr.hdfs.blockcache.enabled">
|
135
|
-
${solr.hdfs.blockcache.enabled:true}
|
136
|
-
</str>
|
137
|
-
<!-- Enable/Disable using one global cache for all SolrCores.
|
138
|
-
The settings used will be from the first HdfsDirectoryFactory created. -->
|
139
|
-
<str name="solr.hdfs.blockcache.global">
|
140
|
-
${solr.hdfs.blockcache.global:true}
|
141
|
-
</str>
|
142
|
-
|
143
|
-
</directoryFactory>
|
144
|
-
|
145
|
-
<!-- The CodecFactory for defining the format of the inverted index.
|
146
|
-
The default implementation is SchemaCodecFactory, which is the official Lucene
|
147
|
-
index format, but hooks into the schema to provide per-field customization of
|
148
|
-
the postings lists and per-document values in the fieldType element
|
149
|
-
(postingsFormat/docValuesFormat). Note that most of the alternative implementations
|
150
|
-
are experimental, so if you choose to customize the index format, its a good
|
151
|
-
idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
|
152
|
-
before upgrading to a newer version to avoid unnecessary reindexing.
|
202
|
+
More details on the nuances of each LockFactory...
|
203
|
+
http://wiki.apache.org/lucene-java/AvailableLockFactories
|
153
204
|
-->
|
154
|
-
<
|
155
|
-
|
156
|
-
<!--
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
schema does not exist, Solr will create it after reading schema.xml, then rename
|
167
|
-
'schema.xml' to 'schema.xml.bak'.
|
168
|
-
|
169
|
-
Do NOT hand edit the managed schema - external modifications will be ignored and
|
170
|
-
overwritten as a result of schema modification REST API calls.
|
171
|
-
|
172
|
-
When ManagedIndexSchemaFactory is specified with mutable = true, schema
|
173
|
-
modification REST API calls will be allowed; otherwise, error responses will be
|
174
|
-
sent back for these requests.
|
205
|
+
<lockType>${solr.lock.type:native}</lockType>
|
206
|
+
|
207
|
+
<!-- Commit Deletion Policy
|
208
|
+
Custom deletion policies can be specified here. The class must
|
209
|
+
implement org.apache.lucene.index.IndexDeletionPolicy.
|
210
|
+
|
211
|
+
The default Solr IndexDeletionPolicy implementation supports
|
212
|
+
deleting index commit points on number of commits, age of
|
213
|
+
commit point and optimized status.
|
214
|
+
|
215
|
+
The latest commit point should always be preserved regardless
|
216
|
+
of the criteria.
|
175
217
|
-->
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
<!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
|
187
|
-
LimitTokenCountFilterFactory in your fieldType definition. E.g.
|
188
|
-
<filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
|
189
|
-
-->
|
190
|
-
<!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
|
191
|
-
<!-- <writeLockTimeout>1000</writeLockTimeout> -->
|
192
|
-
|
193
|
-
<!-- The maximum number of simultaneous threads that may be
|
194
|
-
indexing documents at once in IndexWriter; if more than this
|
195
|
-
many threads arrive they will wait for others to finish.
|
196
|
-
Default in Solr/Lucene is 8. -->
|
197
|
-
<!-- <maxIndexingThreads>8</maxIndexingThreads> -->
|
198
|
-
|
199
|
-
<!-- Expert: Enabling compound file will use less files for the index,
|
200
|
-
using fewer file descriptors on the expense of performance decrease.
|
201
|
-
Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
|
202
|
-
<!-- <useCompoundFile>false</useCompoundFile> -->
|
203
|
-
|
204
|
-
<!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
|
205
|
-
indexing for buffering added documents and deletions before they are
|
206
|
-
flushed to the Directory.
|
207
|
-
maxBufferedDocs sets a limit on the number of documents buffered
|
208
|
-
before flushing.
|
209
|
-
If both ramBufferSizeMB and maxBufferedDocs is set, then
|
210
|
-
Lucene will flush based on whichever limit is hit first.
|
211
|
-
The default is 100 MB. -->
|
212
|
-
<!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
|
213
|
-
<!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
|
214
|
-
|
215
|
-
<!-- Expert: Merge Policy
|
216
|
-
The Merge Policy in Lucene controls how merging of segments is done.
|
217
|
-
The default since Solr/Lucene 3.3 is TieredMergePolicy.
|
218
|
-
The default since Lucene 2.3 was the LogByteSizeMergePolicy,
|
219
|
-
Even older versions of Lucene used LogDocMergePolicy.
|
220
|
-
-->
|
221
|
-
<!--
|
222
|
-
<mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
|
223
|
-
<int name="maxMergeAtOnce">10</int>
|
224
|
-
<int name="segmentsPerTier">10</int>
|
225
|
-
</mergePolicy>
|
226
|
-
-->
|
227
|
-
|
228
|
-
<!-- Merge Factor
|
229
|
-
The merge factor controls how many segments will get merged at a time.
|
230
|
-
For TieredMergePolicy, mergeFactor is a convenience parameter which
|
231
|
-
will set both MaxMergeAtOnce and SegmentsPerTier at once.
|
232
|
-
For LogByteSizeMergePolicy, mergeFactor decides how many new segments
|
233
|
-
will be allowed before they are merged into one.
|
234
|
-
Default is 10 for both merge policies.
|
235
|
-
-->
|
236
|
-
<!--
|
237
|
-
<mergeFactor>10</mergeFactor>
|
238
|
-
-->
|
239
|
-
|
240
|
-
<!-- Expert: Merge Scheduler
|
241
|
-
The Merge Scheduler in Lucene controls how merges are
|
242
|
-
performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
|
243
|
-
can perform merges in the background using separate threads.
|
244
|
-
The SerialMergeScheduler (Lucene 2.2 default) does not.
|
245
|
-
-->
|
246
|
-
<!--
|
247
|
-
<mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
|
248
|
-
-->
|
249
|
-
|
250
|
-
<!-- LockFactory
|
251
|
-
|
252
|
-
This option specifies which Lucene LockFactory implementation
|
253
|
-
to use.
|
254
|
-
|
255
|
-
single = SingleInstanceLockFactory - suggested for a
|
256
|
-
read-only index or when there is no possibility of
|
257
|
-
another process trying to modify the index.
|
258
|
-
native = NativeFSLockFactory - uses OS native file locking.
|
259
|
-
Do not use when multiple solr webapps in the same
|
260
|
-
JVM are attempting to share a single index.
|
261
|
-
simple = SimpleFSLockFactory - uses a plain file for locking
|
262
|
-
|
263
|
-
Defaults: 'native' is default for Solr3.6 and later, otherwise
|
264
|
-
'simple' is the default
|
265
|
-
|
266
|
-
More details on the nuances of each LockFactory...
|
267
|
-
http://wiki.apache.org/lucene-java/AvailableLockFactories
|
218
|
+
<!--
|
219
|
+
<deletionPolicy class="solr.SolrDeletionPolicy">
|
220
|
+
-->
|
221
|
+
<!-- The number of commit points to be kept -->
|
222
|
+
<!-- <str name="maxCommitsToKeep">1</str> -->
|
223
|
+
<!-- The number of optimized commit points to be kept -->
|
224
|
+
<!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
|
225
|
+
<!--
|
226
|
+
Delete all commit points once they have reached the given age.
|
227
|
+
Supports DateMathParser syntax e.g.
|
268
228
|
-->
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
with care. Default is "false".
|
277
|
-
|
278
|
-
This is not needed if lock type is 'single'
|
279
|
-
-->
|
280
|
-
<!--
|
281
|
-
<unlockOnStartup>false</unlockOnStartup>
|
282
|
-
-->
|
283
|
-
|
284
|
-
<!-- Expert: Controls how often Lucene loads terms into memory
|
285
|
-
Default is 128 and is likely good for most everyone.
|
286
|
-
-->
|
287
|
-
<!-- <termIndexInterval>128</termIndexInterval> -->
|
288
|
-
|
289
|
-
<!-- If true, IndexReaders will be opened/reopened from the IndexWriter
|
290
|
-
instead of from the Directory. Hosts in a master/slave setup
|
291
|
-
should have this set to false while those in a SolrCloud
|
292
|
-
cluster need to be set to true. Default: true
|
293
|
-
-->
|
294
|
-
<!--
|
295
|
-
<nrtMode>true</nrtMode>
|
296
|
-
-->
|
297
|
-
|
298
|
-
<!-- Commit Deletion Policy
|
299
|
-
Custom deletion policies can be specified here. The class must
|
300
|
-
implement org.apache.lucene.index.IndexDeletionPolicy.
|
229
|
+
<!--
|
230
|
+
<str name="maxCommitAge">30MINUTES</str>
|
231
|
+
<str name="maxCommitAge">1DAY</str>
|
232
|
+
-->
|
233
|
+
<!--
|
234
|
+
</deletionPolicy>
|
235
|
+
-->
|
301
236
|
|
302
|
-
|
303
|
-
|
304
|
-
|
237
|
+
<!-- Lucene Infostream
|
238
|
+
|
239
|
+
To aid in advanced debugging, Lucene provides an "InfoStream"
|
240
|
+
of detailed information when indexing.
|
305
241
|
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
<!-- The number of commit points to be kept -->
|
313
|
-
<!-- <str name="maxCommitsToKeep">1</str> -->
|
314
|
-
<!-- The number of optimized commit points to be kept -->
|
315
|
-
<!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
|
316
|
-
<!--
|
317
|
-
Delete all commit points once they have reached the given age.
|
318
|
-
Supports DateMathParser syntax e.g.
|
319
|
-
-->
|
320
|
-
<!--
|
321
|
-
<str name="maxCommitAge">30MINUTES</str>
|
322
|
-
<str name="maxCommitAge">1DAY</str>
|
323
|
-
-->
|
324
|
-
<!--
|
325
|
-
</deletionPolicy>
|
326
|
-
-->
|
242
|
+
Setting the value to true will instruct the underlying Lucene
|
243
|
+
IndexWriter to write its info stream to solr's log. By default,
|
244
|
+
this is enabled here, and controlled through log4j.properties.
|
245
|
+
-->
|
246
|
+
<infoStream>true</infoStream>
|
247
|
+
</indexConfig>
|
327
248
|
|
328
|
-
<!-- Lucene Infostream
|
329
249
|
|
330
|
-
|
331
|
-
|
250
|
+
<!-- JMX
|
251
|
+
|
252
|
+
This example enables JMX if and only if an existing MBeanServer
|
253
|
+
is found, use this if you want to configure JMX through JVM
|
254
|
+
parameters. Remove this to disable exposing Solr configuration
|
255
|
+
and statistics to JMX.
|
332
256
|
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
257
|
+
For more details see http://wiki.apache.org/solr/SolrJmx
|
258
|
+
-->
|
259
|
+
<jmx />
|
260
|
+
<!-- If you want to connect to a particular server, specify the
|
261
|
+
agentId
|
262
|
+
-->
|
263
|
+
<!-- <jmx agentId="myAgent" /> -->
|
264
|
+
<!-- If you want to start a new MBeanServer, specify the serviceUrl -->
|
265
|
+
<!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
|
266
|
+
-->
|
338
267
|
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
268
|
+
<!-- The default high-performance update handler -->
|
269
|
+
<updateHandler class="solr.DirectUpdateHandler2">
|
270
|
+
|
271
|
+
<!-- Enables a transaction log, used for real-time get, durability, and
|
272
|
+
and solr cloud replica recovery. The log can grow as big as
|
273
|
+
uncommitted changes to the index, so use of a hard autoCommit
|
274
|
+
is recommended (see below).
|
275
|
+
"dir" - the target directory for transaction logs, defaults to the
|
276
|
+
solr data directory. -->
|
277
|
+
<updateLog>
|
278
|
+
<str name="dir">${solr.ulog.dir:}</str>
|
279
|
+
</updateLog>
|
280
|
+
|
281
|
+
<!-- AutoCommit
|
282
|
+
|
283
|
+
Perform a hard commit automatically under certain conditions.
|
284
|
+
Instead of enabling autoCommit, consider using "commitWithin"
|
285
|
+
when adding documents.
|
346
286
|
|
287
|
+
http://wiki.apache.org/solr/UpdateXmlMessages
|
347
288
|
|
348
|
-
|
289
|
+
maxDocs - Maximum number of documents to add since the last
|
290
|
+
commit before automatically triggering a new commit.
|
349
291
|
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
292
|
+
maxTime - Maximum amount of time in ms that is allowed to pass
|
293
|
+
since a document was added before automatically
|
294
|
+
triggering a new commit.
|
295
|
+
openSearcher - if false, the commit causes recent index changes
|
296
|
+
to be flushed to stable storage, but does not cause a new
|
297
|
+
searcher to be opened to make those changes visible.
|
354
298
|
|
355
|
-
|
356
|
-
|
357
|
-
<jmx/>
|
358
|
-
<!-- If you want to connect to a particular server, specify the
|
359
|
-
agentId
|
299
|
+
If the updateLog is enabled, then it's highly recommended to
|
300
|
+
have some sort of hard autoCommit to limit the log size.
|
360
301
|
-->
|
361
|
-
|
362
|
-
|
363
|
-
|
302
|
+
<autoCommit>
|
303
|
+
<maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
|
304
|
+
<openSearcher>false</openSearcher>
|
305
|
+
</autoCommit>
|
306
|
+
|
307
|
+
<!-- softAutoCommit is like autoCommit except it causes a
|
308
|
+
'soft' commit which only ensures that changes are visible
|
309
|
+
but does not ensure that data is synced to disk. This is
|
310
|
+
faster and more near-realtime friendly than a hard commit.
|
364
311
|
-->
|
365
312
|
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
<!-- Enables a transaction log, used for real-time get, durability, and
|
370
|
-
and solr cloud replica recovery. The log can grow as big as
|
371
|
-
uncommitted changes to the index, so use of a hard autoCommit
|
372
|
-
is recommended (see below).
|
373
|
-
"dir" - the target directory for transaction logs, defaults to the
|
374
|
-
solr data directory. -->
|
375
|
-
<!--<updateLog>-->
|
376
|
-
<!--<str name="dir">${solr.ulog.dir:}</str>-->
|
377
|
-
<!--</updateLog>-->
|
313
|
+
<autoSoftCommit>
|
314
|
+
<maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
|
315
|
+
</autoSoftCommit>
|
378
316
|
|
379
|
-
|
317
|
+
<!-- Update Related Event Listeners
|
318
|
+
|
319
|
+
Various IndexWriter related events can trigger Listeners to
|
320
|
+
take actions.
|
380
321
|
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
commit before automatically triggering a new commit.
|
389
|
-
|
390
|
-
maxTime - Maximum amount of time in ms that is allowed to pass
|
391
|
-
since a document was added before automatically
|
392
|
-
triggering a new commit.
|
393
|
-
openSearcher - if false, the commit causes recent index changes
|
394
|
-
to be flushed to stable storage, but does not cause a new
|
395
|
-
searcher to be opened to make those changes visible.
|
322
|
+
postCommit - fired after every commit or optimize command
|
323
|
+
postOptimize - fired after every optimize command
|
324
|
+
-->
|
325
|
+
|
326
|
+
</updateHandler>
|
327
|
+
|
328
|
+
<!-- IndexReaderFactory
|
396
329
|
|
397
|
-
|
398
|
-
|
399
|
-
-->
|
400
|
-
<autoCommit>
|
401
|
-
<maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
|
402
|
-
<openSearcher>false</openSearcher>
|
403
|
-
</autoCommit>
|
404
|
-
|
405
|
-
<!-- softAutoCommit is like autoCommit except it causes a
|
406
|
-
'soft' commit which only ensures that changes are visible
|
407
|
-
but does not ensure that data is synced to disk. This is
|
408
|
-
faster and more near-realtime friendly than a hard commit.
|
409
|
-
-->
|
330
|
+
Use the following format to specify a custom IndexReaderFactory,
|
331
|
+
which allows for alternate IndexReader implementations.
|
410
332
|
|
411
|
-
|
412
|
-
<maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
|
413
|
-
</autoSoftCommit>
|
333
|
+
** Experimental Feature **
|
414
334
|
|
415
|
-
|
335
|
+
Please note - Using a custom IndexReaderFactory may prevent
|
336
|
+
certain other features from working. The API to
|
337
|
+
IndexReaderFactory may change without warning or may even be
|
338
|
+
removed from future releases if the problems cannot be
|
339
|
+
resolved.
|
416
340
|
|
417
|
-
Various IndexWriter related events can trigger Listeners to
|
418
|
-
take actions.
|
419
341
|
|
420
|
-
|
421
|
-
postOptimize - fired after every optimize command
|
422
|
-
-->
|
423
|
-
<!-- The RunExecutableListener executes an external command from a
|
424
|
-
hook such as postCommit or postOptimize.
|
425
|
-
|
426
|
-
exe - the name of the executable to run
|
427
|
-
dir - dir to use as the current working directory. (default=".")
|
428
|
-
wait - the calling thread waits until the executable returns.
|
429
|
-
(default="true")
|
430
|
-
args - the arguments to pass to the program. (default is none)
|
431
|
-
env - environment variables to set. (default is none)
|
432
|
-
-->
|
433
|
-
<!-- This example shows how RunExecutableListener could be used
|
434
|
-
with the script based replication...
|
435
|
-
http://wiki.apache.org/solr/CollectionDistribution
|
436
|
-
-->
|
437
|
-
<!--
|
438
|
-
<listener event="postCommit" class="solr.RunExecutableListener">
|
439
|
-
<str name="exe">solr/bin/snapshooter</str>
|
440
|
-
<str name="dir">.</str>
|
441
|
-
<bool name="wait">true</bool>
|
442
|
-
<arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
|
443
|
-
<arr name="env"> <str>MYVAR=val1</str> </arr>
|
444
|
-
</listener>
|
445
|
-
-->
|
342
|
+
** Features that may not work with custom IndexReaderFactory **
|
446
343
|
|
447
|
-
|
344
|
+
The ReplicationHandler assumes a disk-resident index. Using a
|
345
|
+
custom IndexReader implementation may cause incompatibility
|
346
|
+
with ReplicationHandler and may cause replication to not work
|
347
|
+
correctly. See SOLR-1366 for details.
|
448
348
|
|
449
|
-
|
349
|
+
-->
|
350
|
+
<!--
|
351
|
+
<indexReaderFactory name="IndexReaderFactory" class="package.class">
|
352
|
+
<str name="someArg">Some Value</str>
|
353
|
+
</indexReaderFactory >
|
354
|
+
-->
|
450
355
|
|
451
|
-
|
452
|
-
|
356
|
+
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
357
|
+
Query section - these settings control query time things like caches
|
358
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
359
|
+
<query>
|
360
|
+
<!-- Max Boolean Clauses
|
453
361
|
|
454
|
-
|
362
|
+
Maximum number of clauses in each BooleanQuery, an exception
|
363
|
+
is thrown if exceeded.
|
455
364
|
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
365
|
+
** WARNING **
|
366
|
+
|
367
|
+
This option actually modifies a global Lucene property that
|
368
|
+
will affect all SolrCores. If multiple solrconfig.xml files
|
369
|
+
disagree on this property, the value at any given moment will
|
370
|
+
be based on the last SolrCore to be initialized.
|
371
|
+
|
372
|
+
-->
|
373
|
+
<maxBooleanClauses>1024</maxBooleanClauses>
|
461
374
|
|
462
375
|
|
463
|
-
|
376
|
+
<!-- Solr Internal Query Caches
|
464
377
|
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
correctly. See SOLR-1366 for details.
|
378
|
+
There are two implementations of cache available for Solr,
|
379
|
+
LRUCache, based on a synchronized LinkedHashMap, and
|
380
|
+
FastLRUCache, based on a ConcurrentHashMap.
|
469
381
|
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
</indexReaderFactory >
|
382
|
+
FastLRUCache has faster gets and slower puts in single
|
383
|
+
threaded operation and thus is generally faster than LRUCache
|
384
|
+
when the hit ratio of the cache is high (> 75%), and may be
|
385
|
+
faster under other scenarios on multi-cpu systems.
|
475
386
|
-->
|
476
|
-
|
477
|
-
|
387
|
+
|
388
|
+
<!-- Filter Cache
|
389
|
+
|
390
|
+
Cache used by SolrIndexSearcher for filters (DocSets),
|
391
|
+
unordered sets of *all* documents that match a query. When a
|
392
|
+
new searcher is opened, its caches may be prepopulated or
|
393
|
+
"autowarmed" using data from caches in the old searcher.
|
394
|
+
autowarmCount is the number of items to prepopulate. For
|
395
|
+
LRUCache, the autowarmed items will be the most recently
|
396
|
+
accessed items.
|
397
|
+
|
398
|
+
Parameters:
|
399
|
+
class - the SolrCache implementation LRUCache or
|
400
|
+
(LRUCache or FastLRUCache)
|
401
|
+
size - the maximum number of entries in the cache
|
402
|
+
initialSize - the initial capacity (number of entries) of
|
403
|
+
the cache. (see java.util.HashMap)
|
404
|
+
autowarmCount - the number of entries to prepopulate from
|
405
|
+
and old cache.
|
478
406
|
-->
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
407
|
+
<filterCache class="solr.FastLRUCache"
|
408
|
+
size="512"
|
409
|
+
initialSize="512"
|
410
|
+
autowarmCount="0"/>
|
411
|
+
|
412
|
+
<!-- Query Result Cache
|
413
|
+
|
414
|
+
Caches results of searches - ordered lists of document ids
|
415
|
+
(DocList) based on a query, a sort, and the range of documents requested.
|
484
416
|
-->
|
485
|
-
|
486
|
-
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
487
|
-
Query section - these settings control query time things like caches
|
488
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
489
|
-
<query>
|
490
|
-
<!-- Max Boolean Clauses
|
491
|
-
|
492
|
-
Maximum number of clauses in each BooleanQuery, an exception
|
493
|
-
is thrown if exceeded.
|
494
|
-
|
495
|
-
** WARNING **
|
496
|
-
|
497
|
-
This option actually modifies a global Lucene property that
|
498
|
-
will affect all SolrCores. If multiple solrconfig.xml files
|
499
|
-
disagree on this property, the value at any given moment will
|
500
|
-
be based on the last SolrCore to be initialized.
|
501
|
-
|
502
|
-
-->
|
503
|
-
<maxBooleanClauses>1024</maxBooleanClauses>
|
504
|
-
|
505
|
-
|
506
|
-
<!-- Solr Internal Query Caches
|
507
|
-
|
508
|
-
There are two implementations of cache available for Solr,
|
509
|
-
LRUCache, based on a synchronized LinkedHashMap, and
|
510
|
-
FastLRUCache, based on a ConcurrentHashMap.
|
511
|
-
|
512
|
-
FastLRUCache has faster gets and slower puts in single
|
513
|
-
threaded operation and thus is generally faster than LRUCache
|
514
|
-
when the hit ratio of the cache is high (> 75%), and may be
|
515
|
-
faster under other scenarios on multi-cpu systems.
|
516
|
-
-->
|
517
|
-
|
518
|
-
<!-- Filter Cache
|
519
|
-
|
520
|
-
Cache used by SolrIndexSearcher for filters (DocSets),
|
521
|
-
unordered sets of *all* documents that match a query. When a
|
522
|
-
new searcher is opened, its caches may be prepopulated or
|
523
|
-
"autowarmed" using data from caches in the old searcher.
|
524
|
-
autowarmCount is the number of items to prepopulate. For
|
525
|
-
LRUCache, the autowarmed items will be the most recently
|
526
|
-
accessed items.
|
527
|
-
|
528
|
-
Parameters:
|
529
|
-
class - the SolrCache implementation LRUCache or
|
530
|
-
(LRUCache or FastLRUCache)
|
531
|
-
size - the maximum number of entries in the cache
|
532
|
-
initialSize - the initial capacity (number of entries) of
|
533
|
-
the cache. (see java.util.HashMap)
|
534
|
-
autowarmCount - the number of entries to prepopulate from
|
535
|
-
and old cache.
|
536
|
-
-->
|
537
|
-
<filterCache class="solr.FastLRUCache"
|
417
|
+
<queryResultCache class="solr.LRUCache"
|
538
418
|
size="512"
|
539
419
|
initialSize="512"
|
540
420
|
autowarmCount="0"/>
|
421
|
+
|
422
|
+
<!-- Document Cache
|
541
423
|
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
<!-- Field Value Cache
|
572
|
-
|
573
|
-
Cache used to hold field values that are quickly accessible
|
574
|
-
by document id. The fieldValueCache is created by default
|
575
|
-
even if not configured here.
|
576
|
-
-->
|
577
|
-
<!--
|
578
|
-
<fieldValueCache class="solr.FastLRUCache"
|
579
|
-
size="512"
|
580
|
-
autowarmCount="128"
|
581
|
-
showItems="32" />
|
582
|
-
-->
|
583
|
-
|
584
|
-
<!-- Custom Cache
|
585
|
-
|
586
|
-
Example of a generic cache. These caches may be accessed by
|
587
|
-
name through SolrIndexSearcher.getCache(),cacheLookup(), and
|
588
|
-
cacheInsert(). The purpose is to enable easy caching of
|
589
|
-
user/application level data. The regenerator argument should
|
590
|
-
be specified as an implementation of solr.CacheRegenerator
|
591
|
-
if autowarming is desired.
|
592
|
-
-->
|
593
|
-
<!--
|
594
|
-
<cache name="myUserCache"
|
595
|
-
class="solr.LRUCache"
|
596
|
-
size="4096"
|
597
|
-
initialSize="1024"
|
598
|
-
autowarmCount="1024"
|
599
|
-
regenerator="com.mycompany.MyRegenerator"
|
600
|
-
/>
|
601
|
-
-->
|
602
|
-
|
603
|
-
|
604
|
-
<!-- Lazy Field Loading
|
605
|
-
|
606
|
-
If true, stored fields that are not requested will be loaded
|
607
|
-
lazily. This can result in a significant speed improvement
|
608
|
-
if the usual case is to not load all stored fields,
|
609
|
-
especially if the skipped fields are large compressed text
|
610
|
-
fields.
|
611
|
-
-->
|
612
|
-
<enableLazyFieldLoading>true</enableLazyFieldLoading>
|
613
|
-
|
614
|
-
<!-- Use Filter For Sorted Query
|
615
|
-
|
616
|
-
A possible optimization that attempts to use a filter to
|
617
|
-
satisfy a search. If the requested sort does not include
|
618
|
-
score, then the filterCache will be checked for a filter
|
619
|
-
matching the query. If found, the filter will be used as the
|
620
|
-
source of document ids, and then the sort will be applied to
|
621
|
-
that.
|
622
|
-
|
623
|
-
For most situations, this will not be useful unless you
|
624
|
-
frequently get the same search repeatedly with different sort
|
625
|
-
options, and none of them ever use "score"
|
626
|
-
-->
|
627
|
-
<!--
|
628
|
-
<useFilterForSortedQuery>true</useFilterForSortedQuery>
|
629
|
-
-->
|
630
|
-
|
631
|
-
<!-- Result Window Size
|
632
|
-
|
633
|
-
An optimization for use with the queryResultCache. When a search
|
634
|
-
is requested, a superset of the requested number of document ids
|
635
|
-
are collected. For example, if a search for a particular query
|
636
|
-
requests matching documents 10 through 19, and queryWindowSize is 50,
|
637
|
-
then documents 0 through 49 will be collected and cached. Any further
|
638
|
-
requests in that range can be satisfied via the cache.
|
639
|
-
-->
|
640
|
-
<queryResultWindowSize>20</queryResultWindowSize>
|
641
|
-
|
642
|
-
<!-- Maximum number of documents to cache for any entry in the
|
643
|
-
queryResultCache.
|
644
|
-
-->
|
645
|
-
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
|
646
|
-
|
647
|
-
<!-- Query Related Event Listeners
|
648
|
-
|
649
|
-
Various IndexSearcher related events can trigger Listeners to
|
650
|
-
take actions.
|
651
|
-
|
652
|
-
newSearcher - fired whenever a new searcher is being prepared
|
653
|
-
and there is a current searcher handling requests (aka
|
654
|
-
registered). It can be used to prime certain caches to
|
655
|
-
prevent long request times for certain requests.
|
656
|
-
|
657
|
-
firstSearcher - fired whenever a new searcher is being
|
658
|
-
prepared but there is no current registered searcher to handle
|
659
|
-
requests or to gain autowarming data from.
|
660
|
-
|
661
|
-
|
662
|
-
-->
|
663
|
-
<!-- QuerySenderListener takes an array of NamedList and executes a
|
664
|
-
local query request for each NamedList in sequence.
|
665
|
-
-->
|
666
|
-
<listener event="newSearcher" class="solr.QuerySenderListener">
|
667
|
-
<arr name="queries">
|
668
|
-
<!--
|
669
|
-
<lst><str name="q">solr</str><str name="sort">price asc</str></lst>
|
670
|
-
<lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
|
671
|
-
-->
|
672
|
-
</arr>
|
673
|
-
</listener>
|
674
|
-
<listener event="firstSearcher" class="solr.QuerySenderListener">
|
675
|
-
<arr name="queries">
|
676
|
-
<lst>
|
677
|
-
<str name="q">static firstSearcher warming in
|
678
|
-
solrconfig.xml
|
679
|
-
</str>
|
680
|
-
</lst>
|
681
|
-
</arr>
|
682
|
-
</listener>
|
683
|
-
|
684
|
-
<!-- Use Cold Searcher
|
685
|
-
|
686
|
-
If a search request comes in and there is no current
|
687
|
-
registered searcher, then immediately register the still
|
688
|
-
warming searcher and use it. If "false" then all requests
|
689
|
-
will block until the first searcher is done warming.
|
690
|
-
-->
|
691
|
-
<useColdSearcher>false</useColdSearcher>
|
692
|
-
|
693
|
-
<!-- Max Warming Searchers
|
694
|
-
|
695
|
-
Maximum number of searchers that may be warming in the
|
696
|
-
background concurrently. An error is returned if this limit
|
697
|
-
is exceeded.
|
698
|
-
|
699
|
-
Recommend values of 1-2 for read-only slaves, higher for
|
700
|
-
masters w/o cache warming.
|
701
|
-
-->
|
702
|
-
<maxWarmingSearchers>2</maxWarmingSearchers>
|
703
|
-
|
704
|
-
</query>
|
705
|
-
|
706
|
-
|
707
|
-
<!-- Request Dispatcher
|
708
|
-
|
709
|
-
This section contains instructions for how the SolrDispatchFilter
|
710
|
-
should behave when processing requests for this SolrCore.
|
711
|
-
|
712
|
-
handleSelect is a legacy option that affects the behavior of requests
|
713
|
-
such as /select?qt=XXX
|
714
|
-
|
715
|
-
handleSelect="true" will cause the SolrDispatchFilter to process
|
716
|
-
the request and dispatch the query to a handler specified by the
|
717
|
-
"qt" param, assuming "/select" isn't already registered.
|
718
|
-
|
719
|
-
handleSelect="false" will cause the SolrDispatchFilter to
|
720
|
-
ignore "/select" requests, resulting in a 404 unless a handler
|
721
|
-
is explicitly registered with the name "/select"
|
722
|
-
|
723
|
-
handleSelect="true" is not recommended for new users, but is the default
|
724
|
-
for backwards compatibility
|
424
|
+
Caches Lucene Document objects (the stored fields for each
|
425
|
+
document). Since Lucene internal document ids are transient,
|
426
|
+
this cache will not be autowarmed.
|
427
|
+
-->
|
428
|
+
<documentCache class="solr.LRUCache"
|
429
|
+
size="512"
|
430
|
+
initialSize="512"
|
431
|
+
autowarmCount="0"/>
|
432
|
+
|
433
|
+
<!-- custom cache currently used by block join -->
|
434
|
+
<cache name="perSegFilter"
|
435
|
+
class="solr.search.LRUCache"
|
436
|
+
size="10"
|
437
|
+
initialSize="0"
|
438
|
+
autowarmCount="10"
|
439
|
+
regenerator="solr.NoOpRegenerator" />
|
440
|
+
|
441
|
+
<!-- Field Value Cache
|
442
|
+
|
443
|
+
Cache used to hold field values that are quickly accessible
|
444
|
+
by document id. The fieldValueCache is created by default
|
445
|
+
even if not configured here.
|
446
|
+
-->
|
447
|
+
<!--
|
448
|
+
<fieldValueCache class="solr.FastLRUCache"
|
449
|
+
size="512"
|
450
|
+
autowarmCount="128"
|
451
|
+
showItems="32" />
|
725
452
|
-->
|
726
|
-
<requestDispatcher handleSelect="true">
|
727
|
-
<!-- Request Parsing
|
728
|
-
|
729
|
-
These settings indicate how Solr Requests may be parsed, and
|
730
|
-
what restrictions may be placed on the ContentStreams from
|
731
|
-
those requests
|
732
|
-
|
733
|
-
enableRemoteStreaming - enables use of the stream.file
|
734
|
-
and stream.url parameters for specifying remote streams.
|
735
|
-
|
736
|
-
multipartUploadLimitInKB - specifies the max size (in KiB) of
|
737
|
-
Multipart File Uploads that Solr will allow in a Request.
|
738
|
-
|
739
|
-
formdataUploadLimitInKB - specifies the max size (in KiB) of
|
740
|
-
form data (application/x-www-form-urlencoded) sent via
|
741
|
-
POST. You can use POST to pass request parameters not
|
742
|
-
fitting into the URL.
|
743
453
|
|
744
|
-
|
745
|
-
the requestParsers to include the original HttpServletRequest
|
746
|
-
object in the context map of the SolrQueryRequest under the
|
747
|
-
key "httpRequest". It will not be used by any of the existing
|
748
|
-
Solr components, but may be useful when developing custom
|
749
|
-
plugins.
|
454
|
+
<!-- Custom Cache
|
750
455
|
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
456
|
+
Example of a generic cache. These caches may be accessed by
|
457
|
+
name through SolrIndexSearcher.getCache(),cacheLookup(), and
|
458
|
+
cacheInsert(). The purpose is to enable easy caching of
|
459
|
+
user/application level data. The regenerator argument should
|
460
|
+
be specified as an implementation of solr.CacheRegenerator
|
461
|
+
if autowarming is desired.
|
462
|
+
-->
|
463
|
+
<!--
|
464
|
+
<cache name="myUserCache"
|
465
|
+
class="solr.LRUCache"
|
466
|
+
size="4096"
|
467
|
+
initialSize="1024"
|
468
|
+
autowarmCount="1024"
|
469
|
+
regenerator="com.mycompany.MyRegenerator"
|
470
|
+
/>
|
471
|
+
-->
|
755
472
|
|
756
|
-
-->
|
757
|
-
<requestParsers enableRemoteStreaming="true"
|
758
|
-
multipartUploadLimitInKB="2048000"
|
759
|
-
formdataUploadLimitInKB="2048"
|
760
|
-
addHttpRequestToContext="false"/>
|
761
473
|
|
762
|
-
|
474
|
+
<!-- Lazy Field Loading
|
763
475
|
|
764
|
-
|
476
|
+
If true, stored fields that are not requested will be loaded
|
477
|
+
lazily. This can result in a significant speed improvement
|
478
|
+
if the usual case is to not load all stored fields,
|
479
|
+
especially if the skipped fields are large compressed text
|
480
|
+
fields.
|
481
|
+
-->
|
482
|
+
<enableLazyFieldLoading>true</enableLazyFieldLoading>
|
765
483
|
|
766
|
-
|
767
|
-
related headers
|
768
|
-
-->
|
769
|
-
<httpCaching never304="true"/>
|
770
|
-
<!-- If you include a <cacheControl> directive, it will be used to
|
771
|
-
generate a Cache-Control header (as well as an Expires header
|
772
|
-
if the value contains "max-age=")
|
484
|
+
<!-- Use Filter For Sorted Query
|
773
485
|
|
774
|
-
|
486
|
+
A possible optimization that attempts to use a filter to
|
487
|
+
satisfy a search. If the requested sort does not include
|
488
|
+
score, then the filterCache will be checked for a filter
|
489
|
+
matching the query. If found, the filter will be used as the
|
490
|
+
source of document ids, and then the sort will be applied to
|
491
|
+
that.
|
775
492
|
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
-->
|
784
|
-
<!-- To enable Solr to respond with automatically generated HTTP
|
785
|
-
Caching headers, and to response to Cache Validation requests
|
786
|
-
correctly, set the value of never304="false"
|
787
|
-
|
788
|
-
This will cause Solr to generate Last-Modified and ETag
|
789
|
-
headers based on the properties of the Index.
|
790
|
-
|
791
|
-
The following options can also be specified to affect the
|
792
|
-
values of these headers...
|
793
|
-
|
794
|
-
lastModFrom - the default value is "openTime" which means the
|
795
|
-
Last-Modified value (and validation against If-Modified-Since
|
796
|
-
requests) will all be relative to when the current Searcher
|
797
|
-
was opened. You can change it to lastModFrom="dirLastMod" if
|
798
|
-
you want the value to exactly correspond to when the physical
|
799
|
-
index was last modified.
|
800
|
-
|
801
|
-
etagSeed="..." is an option you can change to force the ETag
|
802
|
-
header (and validation against If-None-Match requests) to be
|
803
|
-
different even if the index has not changed (ie: when making
|
804
|
-
significant changes to your config file)
|
805
|
-
|
806
|
-
(lastModifiedFrom and etagSeed are both ignored if you use
|
807
|
-
the never304="true" option)
|
808
|
-
-->
|
809
|
-
<!--
|
810
|
-
<httpCaching lastModifiedFrom="openTime"
|
811
|
-
etagSeed="Solr">
|
812
|
-
<cacheControl>max-age=30, public</cacheControl>
|
813
|
-
</httpCaching>
|
814
|
-
-->
|
815
|
-
</requestDispatcher>
|
493
|
+
For most situations, this will not be useful unless you
|
494
|
+
frequently get the same search repeatedly with different sort
|
495
|
+
options, and none of them ever use "score"
|
496
|
+
-->
|
497
|
+
<!--
|
498
|
+
<useFilterForSortedQuery>true</useFilterForSortedQuery>
|
499
|
+
-->
|
816
500
|
|
817
|
-
|
501
|
+
<!-- Result Window Size
|
818
502
|
|
819
|
-
|
503
|
+
An optimization for use with the queryResultCache. When a search
|
504
|
+
is requested, a superset of the requested number of document ids
|
505
|
+
are collected. For example, if a search for a particular query
|
506
|
+
requests matching documents 10 through 19, and queryWindowSize is 50,
|
507
|
+
then documents 0 through 49 will be collected and cached. Any further
|
508
|
+
requests in that range can be satisfied via the cache.
|
509
|
+
-->
|
510
|
+
<queryResultWindowSize>20</queryResultWindowSize>
|
820
511
|
|
821
|
-
|
822
|
-
|
512
|
+
<!-- Maximum number of documents to cache for any entry in the
|
513
|
+
queryResultCache.
|
514
|
+
-->
|
515
|
+
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
|
823
516
|
|
824
|
-
|
825
|
-
Handler has that name, and if handleSelect="true" has been specified in
|
826
|
-
the requestDispatcher, then the Request Handler is dispatched based on
|
827
|
-
the qt parameter. Handlers without a leading '/' are accessed this way
|
828
|
-
like so: http://host/app/[core/]select?qt=name If no qt is
|
829
|
-
given, then the requestHandler that declares default="true" will be
|
830
|
-
used or the one named "standard".
|
517
|
+
<!-- Query Related Event Listeners
|
831
518
|
|
832
|
-
|
833
|
-
|
519
|
+
Various IndexSearcher related events can trigger Listeners to
|
520
|
+
take actions.
|
834
521
|
|
835
|
-
|
836
|
-
|
522
|
+
newSearcher - fired whenever a new searcher is being prepared
|
523
|
+
and there is a current searcher handling requests (aka
|
524
|
+
registered). It can be used to prime certain caches to
|
525
|
+
prevent long request times for certain requests.
|
837
526
|
|
838
|
-
|
527
|
+
firstSearcher - fired whenever a new searcher is being
|
528
|
+
prepared but there is no current registered searcher to handle
|
529
|
+
requests or to gain autowarming data from.
|
839
530
|
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
531
|
+
|
532
|
+
-->
|
533
|
+
<!-- QuerySenderListener takes an array of NamedList and executes a
|
534
|
+
local query request for each NamedList in sequence.
|
844
535
|
-->
|
845
|
-
<
|
846
|
-
|
847
|
-
will be overridden by parameters in the request
|
848
|
-
-->
|
849
|
-
<lst name="defaults">
|
850
|
-
<str name="echoParams">explicit</str>
|
851
|
-
<int name="rows">10</int>
|
852
|
-
<str name="df">allfields</str>
|
853
|
-
</lst>
|
854
|
-
|
855
|
-
|
856
|
-
<!-- Dismax OR handler with AND boost -->
|
857
|
-
|
858
|
-
|
859
|
-
<!-- In addition to defaults, "appends" params can be specified
|
860
|
-
to identify values which should be appended to the list of
|
861
|
-
multi-val params from the query (or the existing "defaults").
|
862
|
-
-->
|
863
|
-
<!-- In this example, the param "fq=instock:true" would be appended to
|
864
|
-
any query time fq params the user may specify, as a mechanism for
|
865
|
-
partitioning the index, independent of any user selected filtering
|
866
|
-
that may also be desired (perhaps as a result of faceted searching).
|
867
|
-
|
868
|
-
NOTE: there is *absolutely* nothing a client can do to prevent these
|
869
|
-
"appends" values from being used, so don't use this mechanism
|
870
|
-
unless you are sure you always want it.
|
871
|
-
-->
|
872
|
-
<!--
|
873
|
-
<lst name="appends">
|
874
|
-
<str name="fq">inStock:true</str>
|
875
|
-
</lst>
|
876
|
-
-->
|
877
|
-
<!-- "invariants" are a way of letting the Solr maintainer lock down
|
878
|
-
the options available to Solr clients. Any params values
|
879
|
-
specified here are used regardless of what values may be specified
|
880
|
-
in either the query, the "defaults", or the "appends" params.
|
881
|
-
|
882
|
-
In this example, the facet.field and facet.query params would
|
883
|
-
be fixed, limiting the facets clients can use. Faceting is
|
884
|
-
not turned on by default - but if the client does specify
|
885
|
-
facet=true in the request, these are the only facets they
|
886
|
-
will be able to see counts for; regardless of what other
|
887
|
-
facet.field or facet.query params they may specify.
|
888
|
-
|
889
|
-
NOTE: there is *absolutely* nothing a client can do to prevent these
|
890
|
-
"invariants" values from being used, so don't use this mechanism
|
891
|
-
unless you are sure you always want it.
|
892
|
-
-->
|
893
|
-
<!--
|
894
|
-
<lst name="invariants">
|
895
|
-
<str name="facet.field">cat</str>
|
896
|
-
<str name="facet.field">manu_exact</str>
|
897
|
-
<str name="facet.query">price:[* TO 500]</str>
|
898
|
-
<str name="facet.query">price:[500 TO *]</str>
|
899
|
-
</lst>
|
900
|
-
-->
|
901
|
-
<!-- If the default list of SearchComponents is not desired, that
|
902
|
-
list can either be overridden completely, or components can be
|
903
|
-
prepended or appended to the default list. (see below)
|
904
|
-
-->
|
536
|
+
<listener event="newSearcher" class="solr.QuerySenderListener">
|
537
|
+
<arr name="queries">
|
905
538
|
<!--
|
906
|
-
<
|
907
|
-
|
908
|
-
<str>nameOfCustomComponent2</str>
|
909
|
-
</arr>
|
910
|
-
-->
|
911
|
-
</requestHandler>
|
912
|
-
|
913
|
-
<!-- Blacklight-style single document handler -->
|
914
|
-
|
915
|
-
<!-- for requests to get a single document; use id=666 instead of q=id:666 -->
|
916
|
-
<requestHandler name="document" class="solr.SearchHandler">
|
917
|
-
<lst name="defaults">
|
918
|
-
<str name="echoParams">all</str>
|
919
|
-
<str name="fl">*</str>
|
920
|
-
<str name="rows">1</str>
|
921
|
-
<str name="wt">json</str>
|
922
|
-
<str name="q">{!raw f=id v=$id}</str>
|
923
|
-
<!-- use id=666 instead of q=id:666 -->
|
924
|
-
</lst>
|
925
|
-
</requestHandler>
|
926
|
-
|
927
|
-
<!-- Blacklight-style Query handler for the HT catalog dynamicField implementation -->
|
928
|
-
|
929
|
-
<requestHandler name="search" class="solr.SearchHandler" default="true">
|
930
|
-
<!-- default values for query parameters can be specified, these
|
931
|
-
will be overridden by parameters in the request
|
539
|
+
<lst><str name="q">solr</str><str name="sort">price asc</str></lst>
|
540
|
+
<lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
|
932
541
|
-->
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
<str name="indent">true</str>
|
940
|
-
<str name="fl">*,score</str>
|
941
|
-
<int name="rows">20</int>
|
942
|
-
|
943
|
-
<str name="df">id</str>
|
944
|
-
|
945
|
-
|
542
|
+
</arr>
|
543
|
+
</listener>
|
544
|
+
<listener event="firstSearcher" class="solr.QuerySenderListener">
|
545
|
+
<arr name="queries">
|
546
|
+
<lst>
|
547
|
+
<str name="q">static firstSearcher warming in solrconfig.xml</str>
|
946
548
|
</lst>
|
947
|
-
|
549
|
+
</arr>
|
550
|
+
</listener>
|
948
551
|
|
552
|
+
<!-- Use Cold Searcher
|
949
553
|
|
950
|
-
|
951
|
-
|
952
|
-
|
554
|
+
If a search request comes in and there is no current
|
555
|
+
registered searcher, then immediately register the still
|
556
|
+
warming searcher and use it. If "false" then all requests
|
557
|
+
will block until the first searcher is done warming.
|
558
|
+
-->
|
559
|
+
<useColdSearcher>false</useColdSearcher>
|
953
560
|
|
954
|
-
|
955
|
-
Do NOT disable the realtime get handler at /get if you are using
|
956
|
-
SolrCloud otherwise any leader election will cause a full sync in ALL
|
957
|
-
replicas for the shard in question. Similarly, a replica recovery will
|
958
|
-
also always fetch the complete index from the leader because a partial
|
959
|
-
sync will not be possible in the absence of this handler.
|
960
|
-
-->
|
961
|
-
<requestHandler name="/get" class="solr.RealTimeGetHandler">
|
962
|
-
<lst name="defaults">
|
963
|
-
<str name="omitHeader">true</str>
|
964
|
-
<str name="wt">json</str>
|
965
|
-
<str name="indent">true</str>
|
966
|
-
</lst>
|
967
|
-
</requestHandler>
|
561
|
+
</query>
|
968
562
|
|
969
563
|
|
970
|
-
|
564
|
+
<!-- Request Dispatcher
|
971
565
|
|
972
|
-
|
566
|
+
This section contains instructions for how the SolrDispatchFilter
|
567
|
+
should behave when processing requests for this SolrCore.
|
973
568
|
|
974
|
-
|
975
|
-
|
569
|
+
handleSelect is a legacy option that affects the behavior of requests
|
570
|
+
such as /select?qt=XXX
|
976
571
|
|
977
|
-
|
978
|
-
|
979
|
-
|
572
|
+
handleSelect="true" will cause the SolrDispatchFilter to process
|
573
|
+
the request and dispatch the query to a handler specified by the
|
574
|
+
"qt" param, assuming "/select" isn't already registered.
|
980
575
|
|
981
|
-
|
982
|
-
|
983
|
-
|
576
|
+
handleSelect="false" will cause the SolrDispatchFilter to
|
577
|
+
ignore "/select" requests, resulting in a 404 unless a handler
|
578
|
+
is explicitly registered with the name "/select"
|
984
579
|
|
985
|
-
|
986
|
-
|
580
|
+
handleSelect="true" is not recommended for new users, but is the default
|
581
|
+
for backwards compatibility
|
582
|
+
-->
|
583
|
+
<requestDispatcher handleSelect="false" >
|
584
|
+
<!-- Request Parsing
|
585
|
+
|
586
|
+
These settings indicate how Solr Requests may be parsed, and
|
587
|
+
what restrictions may be placed on the ContentStreams from
|
588
|
+
those requests
|
589
|
+
|
590
|
+
enableRemoteStreaming - enables use of the stream.file
|
591
|
+
and stream.url parameters for specifying remote streams.
|
592
|
+
|
593
|
+
multipartUploadLimitInKB - specifies the max size (in KiB) of
|
594
|
+
Multipart File Uploads that Solr will allow in a Request.
|
595
|
+
|
596
|
+
formdataUploadLimitInKB - specifies the max size (in KiB) of
|
597
|
+
form data (application/x-www-form-urlencoded) sent via
|
598
|
+
POST. You can use POST to pass request parameters not
|
599
|
+
fitting into the URL.
|
600
|
+
|
601
|
+
addHttpRequestToContext - if set to true, it will instruct
|
602
|
+
the requestParsers to include the original HttpServletRequest
|
603
|
+
object in the context map of the SolrQueryRequest under the
|
604
|
+
key "httpRequest". It will not be used by any of the existing
|
605
|
+
Solr components, but may be useful when developing custom
|
606
|
+
plugins.
|
607
|
+
|
608
|
+
*** WARNING ***
|
609
|
+
The settings below authorize Solr to fetch remote files, You
|
610
|
+
should make sure your system has some authentication before
|
611
|
+
using enableRemoteStreaming="true"
|
612
|
+
|
613
|
+
-->
|
614
|
+
<requestParsers enableRemoteStreaming="true"
|
615
|
+
multipartUploadLimitInKB="2048000"
|
616
|
+
formdataUploadLimitInKB="2048"
|
617
|
+
addHttpRequestToContext="false"/>
|
618
|
+
|
619
|
+
<!-- HTTP Caching
|
620
|
+
|
621
|
+
Set HTTP caching related parameters (for proxy caches and clients).
|
622
|
+
|
623
|
+
The options below instruct Solr not to output any HTTP Caching
|
624
|
+
related headers
|
987
625
|
-->
|
988
|
-
<
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
626
|
+
<httpCaching never304="true" />
|
627
|
+
<!-- If you include a <cacheControl> directive, it will be used to
|
628
|
+
generate a Cache-Control header (as well as an Expires header
|
629
|
+
if the value contains "max-age=")
|
630
|
+
|
631
|
+
By default, no Cache-Control header is generated.
|
632
|
+
|
633
|
+
You can use the <cacheControl> option even if you have set
|
634
|
+
never304="true"
|
635
|
+
-->
|
636
|
+
<!--
|
637
|
+
<httpCaching never304="true" >
|
638
|
+
<cacheControl>max-age=30, public</cacheControl>
|
639
|
+
</httpCaching>
|
640
|
+
-->
|
641
|
+
<!-- To enable Solr to respond with automatically generated HTTP
|
642
|
+
Caching headers, and to response to Cache Validation requests
|
643
|
+
correctly, set the value of never304="false"
|
644
|
+
|
645
|
+
This will cause Solr to generate Last-Modified and ETag
|
646
|
+
headers based on the properties of the Index.
|
647
|
+
|
648
|
+
The following options can also be specified to affect the
|
649
|
+
values of these headers...
|
650
|
+
|
651
|
+
lastModFrom - the default value is "openTime" which means the
|
652
|
+
Last-Modified value (and validation against If-Modified-Since
|
653
|
+
requests) will all be relative to when the current Searcher
|
654
|
+
was opened. You can change it to lastModFrom="dirLastMod" if
|
655
|
+
you want the value to exactly correspond to when the physical
|
656
|
+
index was last modified.
|
657
|
+
|
658
|
+
etagSeed="..." is an option you can change to force the ETag
|
659
|
+
header (and validation against If-None-Match requests) to be
|
660
|
+
different even if the index has not changed (ie: when making
|
661
|
+
significant changes to your config file)
|
662
|
+
|
663
|
+
(lastModifiedFrom and etagSeed are both ignored if you use
|
664
|
+
the never304="true" option)
|
665
|
+
-->
|
666
|
+
<!--
|
667
|
+
<httpCaching lastModifiedFrom="openTime"
|
668
|
+
etagSeed="Solr">
|
669
|
+
<cacheControl>max-age=30, public</cacheControl>
|
670
|
+
</httpCaching>
|
671
|
+
-->
|
672
|
+
</requestDispatcher>
|
999
673
|
|
1000
|
-
|
1001
|
-
<requestHandler name="/update/json" class="solr.UpdateRequestHandler">
|
1002
|
-
<lst name="defaults">
|
1003
|
-
<str name="stream.contentType">application/json</str>
|
1004
|
-
<str name="wt">json</str>
|
1005
|
-
</lst>
|
1006
|
-
</requestHandler>
|
1007
|
-
<requestHandler name="/update/csv" class="solr.UpdateRequestHandler">
|
1008
|
-
<lst name="defaults">
|
1009
|
-
<str name="stream.contentType">application/csv</str>
|
1010
|
-
</lst>
|
1011
|
-
</requestHandler>
|
674
|
+
<!-- Request Handlers
|
1012
675
|
|
1013
|
-
|
676
|
+
http://wiki.apache.org/solr/SolrRequestHandler
|
1014
677
|
|
1015
|
-
|
678
|
+
Incoming queries will be dispatched to a specific handler by name
|
679
|
+
based on the path specified in the request.
|
1016
680
|
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
681
|
+
Legacy behavior: If the request path uses "/select" but no Request
|
682
|
+
Handler has that name, and if handleSelect="true" has been specified in
|
683
|
+
the requestDispatcher, then the Request Handler is dispatched based on
|
684
|
+
the qt parameter. Handlers without a leading '/' are accessed this way
|
685
|
+
like so: http://host/app/[core/]select?qt=name If no qt is
|
686
|
+
given, then the requestHandler that declares default="true" will be
|
687
|
+
used or the one named "standard".
|
1024
688
|
|
1025
|
-
|
1026
|
-
|
1027
|
-
<str name="fmap.a">links</str>
|
1028
|
-
<str name="fmap.div">ignored_</str>
|
1029
|
-
</lst>
|
1030
|
-
</requestHandler>
|
689
|
+
If a Request Handler is declared with startup="lazy", then it will
|
690
|
+
not be initialized until the first request that uses it.
|
1031
691
|
|
692
|
+
-->
|
1032
693
|
|
1033
|
-
|
694
|
+
<requestHandler name="/dataimport" class="solr.DataImportHandler">
|
695
|
+
<lst name="defaults">
|
696
|
+
<str name="config">solr-data-config.xml</str>
|
697
|
+
</lst>
|
698
|
+
</requestHandler>
|
1034
699
|
|
1035
|
-
|
1036
|
-
analysis.jsp. Provides the ability to specify multiple field
|
1037
|
-
types and field names in the same request and outputs
|
1038
|
-
index-time and query-time analysis for each of them.
|
700
|
+
<!-- SearchHandler
|
1039
701
|
|
1040
|
-
|
1041
|
-
analysis.fieldname - field name whose analyzers are to be used
|
702
|
+
http://wiki.apache.org/solr/SearchHandler
|
1042
703
|
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
query analysis is performed, the produced tokens of the
|
1048
|
-
field value analysis will be marked as "matched" for every
|
1049
|
-
token that is produces by the query analysis
|
1050
|
-
-->
|
1051
|
-
<requestHandler name="/analysis/field"
|
1052
|
-
startup="lazy"
|
1053
|
-
class="solr.FieldAnalysisRequestHandler"/>
|
1054
|
-
|
1055
|
-
|
1056
|
-
<!-- Document Analysis Handler
|
1057
|
-
|
1058
|
-
http://wiki.apache.org/solr/AnalysisRequestHandler
|
1059
|
-
|
1060
|
-
An analysis handler that provides a breakdown of the analysis
|
1061
|
-
process of provided documents. This handler expects a (single)
|
1062
|
-
content stream with the following format:
|
1063
|
-
|
1064
|
-
<docs>
|
1065
|
-
<doc>
|
1066
|
-
<field name="id">1</field>
|
1067
|
-
<field name="name">The Name</field>
|
1068
|
-
<field name="text">The Text Value</field>
|
1069
|
-
</doc>
|
1070
|
-
<doc>...</doc>
|
1071
|
-
<doc>...</doc>
|
1072
|
-
...
|
1073
|
-
</docs>
|
1074
|
-
|
1075
|
-
Note: Each document must contain a field which serves as the
|
1076
|
-
unique key. This key is used in the returned response to associate
|
1077
|
-
an analysis breakdown to the analyzed document.
|
1078
|
-
|
1079
|
-
Like the FieldAnalysisRequestHandler, this handler also supports
|
1080
|
-
query analysis by sending either an "analysis.query" or "q"
|
1081
|
-
request parameter that holds the query text to be analyzed. It
|
1082
|
-
also supports the "analysis.showmatch" parameter which when set to
|
1083
|
-
true, all field tokens that match the query tokens will be marked
|
1084
|
-
as a "match".
|
704
|
+
For processing Search Queries, the primary Request Handler
|
705
|
+
provided with Solr is "SearchHandler" It delegates to a sequent
|
706
|
+
of SearchComponents (see below) and supports distributed
|
707
|
+
queries across multiple shards
|
1085
708
|
-->
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
709
|
+
<requestHandler name="/select" class="solr.SearchHandler">
|
710
|
+
<!-- default values for query parameters can be specified, these
|
711
|
+
will be overridden by parameters in the request
|
712
|
+
-->
|
713
|
+
<lst name="defaults">
|
714
|
+
<str name="echoParams">explicit</str>
|
715
|
+
<int name="rows">10</int>
|
716
|
+
<str name="df">text</str>
|
717
|
+
</lst>
|
718
|
+
<!-- In addition to defaults, "appends" params can be specified
|
719
|
+
to identify values which should be appended to the list of
|
720
|
+
multi-val params from the query (or the existing "defaults").
|
721
|
+
-->
|
722
|
+
<!-- In this example, the param "fq=instock:true" would be appended to
|
723
|
+
any query time fq params the user may specify, as a mechanism for
|
724
|
+
partitioning the index, independent of any user selected filtering
|
725
|
+
that may also be desired (perhaps as a result of faceted searching).
|
726
|
+
|
727
|
+
NOTE: there is *absolutely* nothing a client can do to prevent these
|
728
|
+
"appends" values from being used, so don't use this mechanism
|
729
|
+
unless you are sure you always want it.
|
1094
730
|
-->
|
1095
|
-
<requestHandler name="/admin/"
|
1096
|
-
class="solr.admin.AdminHandlers"/>
|
1097
|
-
<!-- This single handler is equivalent to the following... -->
|
1098
731
|
<!--
|
1099
|
-
<
|
1100
|
-
|
1101
|
-
|
1102
|
-
<requestHandler name="/admin/threads" class="solr.admin.ThreadDumpHandler" />
|
1103
|
-
<requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
|
1104
|
-
<requestHandler name="/admin/file" class="solr.admin.ShowFileRequestHandler" >
|
732
|
+
<lst name="appends">
|
733
|
+
<str name="fq">inStock:true</str>
|
734
|
+
</lst>
|
1105
735
|
-->
|
1106
|
-
<!--
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
736
|
+
<!-- "invariants" are a way of letting the Solr maintainer lock down
|
737
|
+
the options available to Solr clients. Any params values
|
738
|
+
specified here are used regardless of what values may be specified
|
739
|
+
in either the query, the "defaults", or the "appends" params.
|
740
|
+
|
741
|
+
In this example, the facet.field and facet.query params would
|
742
|
+
be fixed, limiting the facets clients can use. Faceting is
|
743
|
+
not turned on by default - but if the client does specify
|
744
|
+
facet=true in the request, these are the only facets they
|
745
|
+
will be able to see counts for; regardless of what other
|
746
|
+
facet.field or facet.query params they may specify.
|
747
|
+
|
748
|
+
NOTE: there is *absolutely* nothing a client can do to prevent these
|
749
|
+
"invariants" values from being used, so don't use this mechanism
|
750
|
+
unless you are sure you always want it.
|
1110
751
|
-->
|
1111
752
|
<!--
|
1112
|
-
<
|
1113
|
-
|
1114
|
-
<
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
</lst>
|
1119
|
-
</requestHandler>
|
753
|
+
<lst name="invariants">
|
754
|
+
<str name="facet.field">cat</str>
|
755
|
+
<str name="facet.field">manu_exact</str>
|
756
|
+
<str name="facet.query">price:[* TO 500]</str>
|
757
|
+
<str name="facet.query">price:[500 TO *]</str>
|
758
|
+
</lst>
|
1120
759
|
-->
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
<!-- An optional feature of the PingRequestHandler is to configure the
|
1131
|
-
handler with a "healthcheckFile" which can be used to enable/disable
|
1132
|
-
the PingRequestHandler.
|
1133
|
-
relative paths are resolved against the data dir
|
1134
|
-
-->
|
1135
|
-
<!-- <str name="healthcheckFile">server-enabled.txt</str> -->
|
1136
|
-
</requestHandler>
|
1137
|
-
|
1138
|
-
<!-- Echo the request contents back to the client -->
|
1139
|
-
<requestHandler name="/debug/dump" class="solr.DumpRequestHandler">
|
1140
|
-
<lst name="defaults">
|
1141
|
-
<str name="echoParams">explicit</str>
|
1142
|
-
<str name="echoHandler">true</str>
|
1143
|
-
</lst>
|
1144
|
-
</requestHandler>
|
1145
|
-
|
1146
|
-
<!-- Solr Replication
|
1147
|
-
|
1148
|
-
The SolrReplicationHandler supports replicating indexes from a
|
1149
|
-
"master" used for indexing and "slaves" used for queries.
|
1150
|
-
|
1151
|
-
http://wiki.apache.org/solr/SolrReplication
|
1152
|
-
|
1153
|
-
It is also necessary for SolrCloud to function (in Cloud mode, the
|
1154
|
-
replication handler is used to bulk transfer segments when nodes
|
1155
|
-
are added or need to recover).
|
1156
|
-
|
1157
|
-
https://wiki.apache.org/solr/SolrCloud/
|
760
|
+
<!-- If the default list of SearchComponents is not desired, that
|
761
|
+
list can either be overridden completely, or components can be
|
762
|
+
prepended or appended to the default list. (see below)
|
763
|
+
-->
|
764
|
+
<!--
|
765
|
+
<arr name="components">
|
766
|
+
<str>nameOfCustomComponent1</str>
|
767
|
+
<str>nameOfCustomComponent2</str>
|
768
|
+
</arr>
|
1158
769
|
-->
|
1159
|
-
<requestHandler name="/replication" class="solr.ReplicationHandler">
|
1160
|
-
<!--
|
1161
|
-
To enable simple master/slave replication, uncomment one of the
|
1162
|
-
sections below, depending on whether this solr instance should be
|
1163
|
-
the "master" or a "slave". If this instance is a "slave" you will
|
1164
|
-
also need to fill in the masterUrl to point to a real machine.
|
1165
|
-
-->
|
1166
|
-
<!--
|
1167
|
-
<lst name="master">
|
1168
|
-
<str name="replicateAfter">commit</str>
|
1169
|
-
<str name="replicateAfter">startup</str>
|
1170
|
-
<str name="confFiles">schema.xml,stopwords.txt</str>
|
1171
|
-
</lst>
|
1172
|
-
-->
|
1173
|
-
<!--
|
1174
|
-
<lst name="slave">
|
1175
|
-
<str name="masterUrl">http://your-master-hostname:8983/solr</str>
|
1176
|
-
<str name="pollInterval">00:00:60</str>
|
1177
|
-
</lst>
|
1178
|
-
-->
|
1179
770
|
</requestHandler>
|
1180
771
|
|
1181
|
-
|
772
|
+
<!-- A request handler that returns indented JSON by default -->
|
773
|
+
<requestHandler name="/query" class="solr.SearchHandler">
|
774
|
+
<lst name="defaults">
|
775
|
+
<str name="echoParams">explicit</str>
|
776
|
+
<str name="wt">json</str>
|
777
|
+
<str name="indent">true</str>
|
778
|
+
<str name="df">text</str>
|
779
|
+
</lst>
|
780
|
+
</requestHandler>
|
1182
781
|
|
1183
|
-
|
1184
|
-
instances of SearchHandler (which can access them by name)
|
782
|
+
<!-- A Robust Example
|
1185
783
|
|
1186
|
-
|
784
|
+
This example SearchHandler declaration shows off usage of the
|
785
|
+
SearchHandler with many defaults declared
|
1187
786
|
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
787
|
+
Note that multiple instances of the same Request Handler
|
788
|
+
(SearchHandler) can be registered multiple times with different
|
789
|
+
names (and different init parameters)
|
790
|
+
-->
|
791
|
+
<requestHandler name="/browse" class="solr.SearchHandler">
|
792
|
+
<lst name="defaults">
|
793
|
+
<str name="echoParams">explicit</str>
|
1194
794
|
|
1195
|
-
|
795
|
+
<!-- VelocityResponseWriter settings -->
|
796
|
+
<str name="wt">velocity</str>
|
797
|
+
<str name="v.template">browse</str>
|
798
|
+
<str name="v.layout">layout</str>
|
1196
799
|
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
<str>stats</str>
|
1203
|
-
<str>debug</str>
|
1204
|
-
</arr>
|
800
|
+
<!-- Query settings -->
|
801
|
+
<str name="defType">edismax</str>
|
802
|
+
<str name="q.alt">*:*</str>
|
803
|
+
<str name="rows">10</str>
|
804
|
+
<str name="fl">*,score</str>
|
1205
805
|
|
1206
|
-
|
1207
|
-
|
806
|
+
<!-- Faceting defaults -->
|
807
|
+
<str name="facet">on</str>
|
808
|
+
<str name="facet.mincount">1</str>
|
809
|
+
</lst>
|
810
|
+
</requestHandler>
|
1208
811
|
|
1209
|
-
|
812
|
+
<initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
|
813
|
+
<lst name="defaults">
|
814
|
+
<str name="df">text</str>
|
815
|
+
</lst>
|
816
|
+
</initParams>
|
1210
817
|
|
1211
|
-
|
1212
|
-
<str>myFirstComponentName</str>
|
1213
|
-
</arr>
|
818
|
+
<!-- Solr Cell Update Request Handler
|
1214
819
|
|
1215
|
-
|
1216
|
-
<str>myLastComponentName</str>
|
1217
|
-
</arr>
|
820
|
+
http://wiki.apache.org/solr/ExtractingRequestHandler
|
1218
821
|
|
1219
|
-
|
1220
|
-
|
822
|
+
-->
|
823
|
+
<requestHandler name="/update/extract"
|
824
|
+
startup="lazy"
|
825
|
+
class="solr.extraction.ExtractingRequestHandler" >
|
826
|
+
<lst name="defaults">
|
827
|
+
<str name="lowernames">true</str>
|
828
|
+
<str name="uprefix">ignored_</str>
|
829
|
+
|
830
|
+
<!-- capture link hrefs but ignore div attributes -->
|
831
|
+
<str name="captureAttr">true</str>
|
832
|
+
<str name="fmap.a">links</str>
|
833
|
+
<str name="fmap.div">ignored_</str>
|
834
|
+
</lst>
|
835
|
+
</requestHandler>
|
836
|
+
<!-- Search Components
|
837
|
+
|
838
|
+
Search components are registered to SolrCore and used by
|
839
|
+
instances of SearchHandler (which can access them by name)
|
840
|
+
|
841
|
+
By default, the following components are available:
|
842
|
+
|
843
|
+
<searchComponent name="query" class="solr.QueryComponent" />
|
844
|
+
<searchComponent name="facet" class="solr.FacetComponent" />
|
845
|
+
<searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
|
846
|
+
<searchComponent name="highlight" class="solr.HighlightComponent" />
|
847
|
+
<searchComponent name="stats" class="solr.StatsComponent" />
|
848
|
+
<searchComponent name="debug" class="solr.DebugComponent" />
|
849
|
+
|
850
|
+
Default configuration in a requestHandler would look like:
|
851
|
+
|
852
|
+
<arr name="components">
|
853
|
+
<str>query</str>
|
854
|
+
<str>facet</str>
|
855
|
+
<str>mlt</str>
|
856
|
+
<str>highlight</str>
|
857
|
+
<str>stats</str>
|
858
|
+
<str>debug</str>
|
859
|
+
</arr>
|
860
|
+
|
861
|
+
If you register a searchComponent to one of the standard names,
|
862
|
+
that will be used instead of the default.
|
863
|
+
|
864
|
+
To insert components before or after the 'standard' components, use:
|
865
|
+
|
866
|
+
<arr name="first-components">
|
867
|
+
<str>myFirstComponentName</str>
|
868
|
+
</arr>
|
869
|
+
|
870
|
+
<arr name="last-components">
|
871
|
+
<str>myLastComponentName</str>
|
872
|
+
</arr>
|
873
|
+
|
874
|
+
NOTE: The component registered with the name "debug" will
|
875
|
+
always be executed after the "last-components"
|
876
|
+
|
877
|
+
-->
|
878
|
+
|
879
|
+
<!-- Spell Check
|
1221
880
|
|
1222
|
-
|
881
|
+
The spell check component can return a list of alternative spelling
|
882
|
+
suggestions.
|
1223
883
|
|
1224
|
-
|
884
|
+
http://wiki.apache.org/solr/SpellCheckComponent
|
885
|
+
-->
|
886
|
+
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
|
1225
887
|
|
1226
|
-
|
1227
|
-
suggestions.
|
888
|
+
<str name="queryAnalyzerFieldType">text_general</str>
|
1228
889
|
|
1229
|
-
|
890
|
+
<!-- Multiple "Spell Checkers" can be declared and used by this
|
891
|
+
component
|
1230
892
|
-->
|
1231
|
-
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
|
1232
|
-
|
1233
|
-
<str name="queryAnalyzerFieldType">text_general</str>
|
1234
|
-
|
1235
|
-
<!-- Multiple "Spell Checkers" can be declared and used by this
|
1236
|
-
component
|
1237
|
-
-->
|
1238
|
-
|
1239
|
-
<!-- a spellchecker built from a field of the main index -->
|
1240
|
-
<lst name="spellchecker">
|
1241
|
-
<str name="name">default</str>
|
1242
|
-
<str name="field">text</str>
|
1243
|
-
<str name="classname">solr.DirectSolrSpellChecker</str>
|
1244
|
-
<!-- the spellcheck distance measure used, the default is the internal levenshtein -->
|
1245
|
-
<str name="distanceMeasure">internal</str>
|
1246
|
-
<!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
|
1247
|
-
<float name="accuracy">0.5</float>
|
1248
|
-
<!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
|
1249
|
-
<int name="maxEdits">2</int>
|
1250
|
-
<!-- the minimum shared prefix when enumerating terms -->
|
1251
|
-
<int name="minPrefix">1</int>
|
1252
|
-
<!-- maximum number of inspections per result. -->
|
1253
|
-
<int name="maxInspections">5</int>
|
1254
|
-
<!-- minimum length of a query term to be considered for correction -->
|
1255
|
-
<int name="minQueryLength">4</int>
|
1256
|
-
<!-- maximum threshold of documents a query term can appear to be considered for correction -->
|
1257
|
-
<float name="maxQueryFrequency">0.01</float>
|
1258
|
-
<!-- uncomment this to require suggestions to occur in 1% of the documents
|
1259
|
-
<float name="thresholdTokenFrequency">.01</float>
|
1260
|
-
-->
|
1261
|
-
</lst>
|
1262
|
-
|
1263
|
-
<!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
|
1264
|
-
<lst name="spellchecker">
|
1265
|
-
<str name="name">wordbreak</str>
|
1266
|
-
<str name="classname">solr.WordBreakSolrSpellChecker</str>
|
1267
|
-
<str name="field">name</str>
|
1268
|
-
<str name="combineWords">true</str>
|
1269
|
-
<str name="breakWords">true</str>
|
1270
|
-
<int name="maxChanges">10</int>
|
1271
|
-
</lst>
|
1272
|
-
|
1273
|
-
<!-- a spellchecker that uses a different distance measure -->
|
1274
|
-
<!--
|
1275
|
-
<lst name="spellchecker">
|
1276
|
-
<str name="name">jarowinkler</str>
|
1277
|
-
<str name="field">spell</str>
|
1278
|
-
<str name="classname">solr.DirectSolrSpellChecker</str>
|
1279
|
-
<str name="distanceMeasure">
|
1280
|
-
org.apache.lucene.search.spell.JaroWinklerDistance
|
1281
|
-
</str>
|
1282
|
-
</lst>
|
1283
|
-
-->
|
1284
|
-
|
1285
|
-
<!-- a spellchecker that use an alternate comparator
|
1286
|
-
|
1287
|
-
comparatorClass be one of:
|
1288
|
-
1. score (default)
|
1289
|
-
2. freq (Frequency first, then score)
|
1290
|
-
3. A fully qualified class name
|
1291
|
-
-->
|
1292
|
-
<!--
|
1293
|
-
<lst name="spellchecker">
|
1294
|
-
<str name="name">freq</str>
|
1295
|
-
<str name="field">lowerfilt</str>
|
1296
|
-
<str name="classname">solr.DirectSolrSpellChecker</str>
|
1297
|
-
<str name="comparatorClass">freq</str>
|
1298
|
-
-->
|
1299
|
-
|
1300
|
-
<!-- A spellchecker that reads the list of words from a file -->
|
1301
|
-
<!--
|
1302
|
-
<lst name="spellchecker">
|
1303
|
-
<str name="classname">solr.FileBasedSpellChecker</str>
|
1304
|
-
<str name="name">file</str>
|
1305
|
-
<str name="sourceLocation">spellings.txt</str>
|
1306
|
-
<str name="characterEncoding">UTF-8</str>
|
1307
|
-
<str name="spellcheckIndexDir">spellcheckerFile</str>
|
1308
|
-
</lst>
|
1309
|
-
-->
|
1310
|
-
</searchComponent>
|
1311
|
-
|
1312
|
-
<!-- A request handler for demonstrating the spellcheck component.
|
1313
|
-
|
1314
|
-
NOTE: This is purely as an example. The whole purpose of the
|
1315
|
-
SpellCheckComponent is to hook it into the request handler that
|
1316
|
-
handles your normal user queries so that a separate request is
|
1317
|
-
not needed to get suggestions.
|
1318
893
|
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
894
|
+
<!-- a spellchecker built from a field of the main index -->
|
895
|
+
<lst name="spellchecker">
|
896
|
+
<str name="name">default</str>
|
897
|
+
<str name="field">text</str>
|
898
|
+
<str name="classname">solr.DirectSolrSpellChecker</str>
|
899
|
+
<!-- the spellcheck distance measure used, the default is the internal levenshtein -->
|
900
|
+
<str name="distanceMeasure">internal</str>
|
901
|
+
<!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
|
902
|
+
<float name="accuracy">0.5</float>
|
903
|
+
<!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
|
904
|
+
<int name="maxEdits">2</int>
|
905
|
+
<!-- the minimum shared prefix when enumerating terms -->
|
906
|
+
<int name="minPrefix">1</int>
|
907
|
+
<!-- maximum number of inspections per result. -->
|
908
|
+
<int name="maxInspections">5</int>
|
909
|
+
<!-- minimum length of a query term to be considered for correction -->
|
910
|
+
<int name="minQueryLength">4</int>
|
911
|
+
<!-- maximum threshold of documents a query term can appear to be considered for correction -->
|
912
|
+
<float name="maxQueryFrequency">0.01</float>
|
913
|
+
<!-- uncomment this to require suggestions to occur in 1% of the documents
|
914
|
+
<float name="thresholdTokenFrequency">.01</float>
|
1324
915
|
-->
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
<searchComponent name="suggest" class="solr.SuggestComponent">
|
1350
|
-
<lst name="suggester">
|
1351
|
-
<str name="name">mySuggester</str>
|
1352
|
-
<str name="lookupImpl">FuzzyLookupFactory</str>
|
1353
|
-
<!-- org.apache.solr.spelling.suggest.fst -->
|
1354
|
-
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
|
1355
|
-
<!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory -->
|
1356
|
-
<str name="field">cat</str>
|
1357
|
-
<str name="weightField">price</str>
|
1358
|
-
<str name="suggestAnalyzerFieldType">string</str>
|
1359
|
-
</lst>
|
1360
|
-
</searchComponent>
|
916
|
+
</lst>
|
917
|
+
|
918
|
+
<!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
|
919
|
+
<lst name="spellchecker">
|
920
|
+
<str name="name">wordbreak</str>
|
921
|
+
<str name="classname">solr.WordBreakSolrSpellChecker</str>
|
922
|
+
<str name="field">name</str>
|
923
|
+
<str name="combineWords">true</str>
|
924
|
+
<str name="breakWords">true</str>
|
925
|
+
<int name="maxChanges">10</int>
|
926
|
+
</lst>
|
927
|
+
|
928
|
+
<!-- a spellchecker that uses a different distance measure -->
|
929
|
+
<!--
|
930
|
+
<lst name="spellchecker">
|
931
|
+
<str name="name">jarowinkler</str>
|
932
|
+
<str name="field">spell</str>
|
933
|
+
<str name="classname">solr.DirectSolrSpellChecker</str>
|
934
|
+
<str name="distanceMeasure">
|
935
|
+
org.apache.lucene.search.spell.JaroWinklerDistance
|
936
|
+
</str>
|
937
|
+
</lst>
|
938
|
+
-->
|
1361
939
|
|
1362
|
-
|
1363
|
-
startup="lazy">
|
1364
|
-
<lst name="defaults">
|
1365
|
-
<str name="suggest">true</str>
|
1366
|
-
<str name="suggest.count">10</str>
|
1367
|
-
</lst>
|
1368
|
-
<arr name="components">
|
1369
|
-
<str>suggest</str>
|
1370
|
-
</arr>
|
1371
|
-
</requestHandler>
|
1372
|
-
<!-- Term Vector Component
|
940
|
+
<!-- a spellchecker that use an alternate comparator
|
1373
941
|
|
1374
|
-
|
942
|
+
comparatorClass be one of:
|
943
|
+
1. score (default)
|
944
|
+
2. freq (Frequency first, then score)
|
945
|
+
3. A fully qualified class name
|
1375
946
|
-->
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
In reality you will likely want to add the component to your
|
1383
|
-
already specified request handlers.
|
947
|
+
<!--
|
948
|
+
<lst name="spellchecker">
|
949
|
+
<str name="name">freq</str>
|
950
|
+
<str name="field">lowerfilt</str>
|
951
|
+
<str name="classname">solr.DirectSolrSpellChecker</str>
|
952
|
+
<str name="comparatorClass">freq</str>
|
1384
953
|
-->
|
1385
|
-
<requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
|
1386
|
-
<lst name="defaults">
|
1387
|
-
<str name="df">allfields</str>
|
1388
|
-
<bool name="tv">true</bool>
|
1389
|
-
</lst>
|
1390
|
-
<arr name="last-components">
|
1391
|
-
<str>tvComponent</str>
|
1392
|
-
</arr>
|
1393
|
-
</requestHandler>
|
1394
|
-
|
1395
|
-
<!-- Clustering Component
|
1396
954
|
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
955
|
+
<!-- A spellchecker that reads the list of words from a file -->
|
956
|
+
<!--
|
957
|
+
<lst name="spellchecker">
|
958
|
+
<str name="classname">solr.FileBasedSpellChecker</str>
|
959
|
+
<str name="name">file</str>
|
960
|
+
<str name="sourceLocation">spellings.txt</str>
|
961
|
+
<str name="characterEncoding">UTF-8</str>
|
962
|
+
<str name="spellcheckIndexDir">spellcheckerFile</str>
|
963
|
+
</lst>
|
1404
964
|
-->
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
965
|
+
</searchComponent>
|
966
|
+
|
967
|
+
<!-- A request handler for demonstrating the spellcheck component.
|
968
|
+
|
969
|
+
NOTE: This is purely as an example. The whole purpose of the
|
970
|
+
SpellCheckComponent is to hook it into the request handler that
|
971
|
+
handles your normal user queries so that a separate request is
|
972
|
+
not needed to get suggestions.
|
973
|
+
|
974
|
+
IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
|
975
|
+
NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
|
976
|
+
|
977
|
+
See http://wiki.apache.org/solr/SpellCheckComponent for details
|
978
|
+
on the request parameters.
|
979
|
+
-->
|
980
|
+
<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
|
981
|
+
<lst name="defaults">
|
982
|
+
<str name="df">text</str>
|
983
|
+
<!-- Solr will use suggestions from both the 'default' spellchecker
|
984
|
+
and from the 'wordbreak' spellchecker and combine them.
|
985
|
+
collations (re-written queries) can include a combination of
|
986
|
+
corrections from both spellcheckers -->
|
987
|
+
<str name="spellcheck.dictionary">default</str>
|
988
|
+
<str name="spellcheck.dictionary">wordbreak</str>
|
989
|
+
<str name="spellcheck">on</str>
|
990
|
+
<str name="spellcheck.extendedResults">true</str>
|
991
|
+
<str name="spellcheck.count">10</str>
|
992
|
+
<str name="spellcheck.alternativeTermCount">5</str>
|
993
|
+
<str name="spellcheck.maxResultsForSuggest">5</str>
|
994
|
+
<str name="spellcheck.collate">true</str>
|
995
|
+
<str name="spellcheck.collateExtendedResults">true</str>
|
996
|
+
<str name="spellcheck.maxCollationTries">10</str>
|
997
|
+
<str name="spellcheck.maxCollations">5</str>
|
998
|
+
</lst>
|
999
|
+
<arr name="last-components">
|
1000
|
+
<str>spellcheck</str>
|
1001
|
+
</arr>
|
1002
|
+
</requestHandler>
|
1003
|
+
|
1004
|
+
<searchComponent name="suggest" class="solr.SuggestComponent">
|
1005
|
+
<lst name="suggester">
|
1006
|
+
<str name="name">mySuggester</str>
|
1007
|
+
<str name="lookupImpl">FuzzyLookupFactory</str> <!-- org.apache.solr.spelling.suggest.fst -->
|
1008
|
+
<str name="dictionaryImpl">DocumentDictionaryFactory</str> <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory -->
|
1009
|
+
<str name="field">cat</str>
|
1010
|
+
<str name="weightField">price</str>
|
1011
|
+
<str name="suggestAnalyzerFieldType">string</str>
|
1012
|
+
</lst>
|
1013
|
+
</searchComponent>
|
1014
|
+
|
1015
|
+
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
|
1016
|
+
<lst name="defaults">
|
1017
|
+
<str name="suggest">true</str>
|
1018
|
+
<str name="suggest.count">10</str>
|
1019
|
+
</lst>
|
1020
|
+
<arr name="components">
|
1021
|
+
<str>suggest</str>
|
1022
|
+
</arr>
|
1023
|
+
</requestHandler>
|
1024
|
+
<!-- Term Vector Component
|
1025
|
+
|
1026
|
+
http://wiki.apache.org/solr/TermVectorComponent
|
1027
|
+
-->
|
1028
|
+
<searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
|
1410
1029
|
|
1411
|
-
|
1030
|
+
<!-- A request handler for demonstrating the term vector component
|
1412
1031
|
|
1413
|
-
|
1414
|
-
* org.carrot2.clustering.lingo.LingoClusteringAlgorithm
|
1415
|
-
* org.carrot2.clustering.stc.STCClusteringAlgorithm
|
1416
|
-
* org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
|
1032
|
+
This is purely as an example.
|
1417
1033
|
|
1418
|
-
|
1034
|
+
In reality you will likely want to add the component to your
|
1035
|
+
already specified request handlers.
|
1036
|
+
-->
|
1037
|
+
<requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
|
1038
|
+
<lst name="defaults">
|
1039
|
+
<str name="df">text</str>
|
1040
|
+
<bool name="tv">true</bool>
|
1041
|
+
</lst>
|
1042
|
+
<arr name="last-components">
|
1043
|
+
<str>tvComponent</str>
|
1044
|
+
</arr>
|
1045
|
+
</requestHandler>
|
1046
|
+
|
1047
|
+
<!-- Terms Component
|
1048
|
+
|
1049
|
+
http://wiki.apache.org/solr/TermsComponent
|
1050
|
+
|
1051
|
+
A component to return terms and document frequency of those
|
1052
|
+
terms
|
1053
|
+
-->
|
1054
|
+
<searchComponent name="terms" class="solr.TermsComponent"/>
|
1419
1055
|
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1056
|
+
<!-- A request handler for demonstrating the terms component -->
|
1057
|
+
<requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
|
1058
|
+
<lst name="defaults">
|
1059
|
+
<bool name="terms">true</bool>
|
1060
|
+
<bool name="distrib">false</bool>
|
1061
|
+
</lst>
|
1062
|
+
<arr name="components">
|
1063
|
+
<str>terms</str>
|
1064
|
+
</arr>
|
1065
|
+
</requestHandler>
|
1426
1066
|
|
1427
|
-
<!-- Override location of the clustering algorithm's resources
|
1428
|
-
(attribute definitions and lexical resources).
|
1429
1067
|
|
1430
|
-
|
1431
|
-
stop labels and attribute definition XMLs.
|
1068
|
+
<!-- Query Elevation Component
|
1432
1069
|
|
1433
|
-
|
1434
|
-
http://download.carrot2.org/head/manual/#chapter.lexical-resources
|
1070
|
+
http://wiki.apache.org/solr/QueryElevationComponent
|
1435
1071
|
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1072
|
+
a search component that enables you to configure the top
|
1073
|
+
results for a given query regardless of the normal lucene
|
1074
|
+
scoring.
|
1075
|
+
-->
|
1076
|
+
<searchComponent name="elevator" class="solr.QueryElevationComponent" >
|
1077
|
+
<!-- pick a fieldType to analyze queries -->
|
1078
|
+
<str name="queryFieldType">string</str>
|
1079
|
+
<str name="config-file">elevate.xml</str>
|
1080
|
+
</searchComponent>
|
1081
|
+
|
1082
|
+
<!-- A request handler for demonstrating the elevator component -->
|
1083
|
+
<requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
|
1084
|
+
<lst name="defaults">
|
1085
|
+
<str name="echoParams">explicit</str>
|
1086
|
+
<str name="df">text</str>
|
1087
|
+
</lst>
|
1088
|
+
<arr name="last-components">
|
1089
|
+
<str>elevator</str>
|
1090
|
+
</arr>
|
1091
|
+
</requestHandler>
|
1092
|
+
|
1093
|
+
<!-- Highlighting Component
|
1094
|
+
|
1095
|
+
http://wiki.apache.org/solr/HighlightingParameters
|
1096
|
+
-->
|
1097
|
+
<searchComponent class="solr.HighlightComponent" name="highlight">
|
1098
|
+
<highlighting>
|
1099
|
+
<!-- Configure the standard fragmenter -->
|
1100
|
+
<!-- This could most likely be commented out in the "default" case -->
|
1101
|
+
<fragmenter name="gap"
|
1102
|
+
default="true"
|
1103
|
+
class="solr.highlight.GapFragmenter">
|
1104
|
+
<lst name="defaults">
|
1105
|
+
<int name="hl.fragsize">100</int>
|
1440
1106
|
</lst>
|
1107
|
+
</fragmenter>
|
1441
1108
|
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1109
|
+
<!-- A regular-expression-based fragmenter
|
1110
|
+
(for sentence extraction)
|
1111
|
+
-->
|
1112
|
+
<fragmenter name="regex"
|
1113
|
+
class="solr.highlight.RegexFragmenter">
|
1114
|
+
<lst name="defaults">
|
1115
|
+
<!-- slightly smaller fragsizes work better because of slop -->
|
1116
|
+
<int name="hl.fragsize">70</int>
|
1117
|
+
<!-- allow 50% slop on fragment sizes -->
|
1118
|
+
<float name="hl.regex.slop">0.5</float>
|
1119
|
+
<!-- a basic sentence pattern -->
|
1120
|
+
<str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
|
1448
1121
|
</lst>
|
1122
|
+
</fragmenter>
|
1449
1123
|
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1124
|
+
<!-- Configure the standard formatter -->
|
1125
|
+
<formatter name="html"
|
1126
|
+
default="true"
|
1127
|
+
class="solr.highlight.HtmlFormatter">
|
1128
|
+
<lst name="defaults">
|
1129
|
+
<str name="hl.simple.pre"><![CDATA[<em>]]></str>
|
1130
|
+
<str name="hl.simple.post"><![CDATA[</em>]]></str>
|
1456
1131
|
</lst>
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1132
|
+
</formatter>
|
1133
|
+
|
1134
|
+
<!-- Configure the standard encoder -->
|
1135
|
+
<encoder name="html"
|
1136
|
+
class="solr.highlight.HtmlEncoder" />
|
1137
|
+
|
1138
|
+
<!-- Configure the standard fragListBuilder -->
|
1139
|
+
<fragListBuilder name="simple"
|
1140
|
+
class="solr.highlight.SimpleFragListBuilder"/>
|
1141
|
+
|
1142
|
+
<!-- Configure the single fragListBuilder -->
|
1143
|
+
<fragListBuilder name="single"
|
1144
|
+
class="solr.highlight.SingleFragListBuilder"/>
|
1145
|
+
|
1146
|
+
<!-- Configure the weighted fragListBuilder -->
|
1147
|
+
<fragListBuilder name="weighted"
|
1148
|
+
default="true"
|
1149
|
+
class="solr.highlight.WeightedFragListBuilder"/>
|
1150
|
+
|
1151
|
+
<!-- default tag FragmentsBuilder -->
|
1152
|
+
<fragmentsBuilder name="default"
|
1153
|
+
default="true"
|
1154
|
+
class="solr.highlight.ScoreOrderFragmentsBuilder">
|
1155
|
+
<!--
|
1470
1156
|
<lst name="defaults">
|
1471
|
-
|
1472
|
-
<bool name="clustering.results">true</bool>
|
1473
|
-
<!-- Field name with the logical "title" of a each document (optional) -->
|
1474
|
-
<str name="carrot.title">name</str>
|
1475
|
-
<!-- Field name with the logical "URL" of a each document (optional) -->
|
1476
|
-
<str name="carrot.url">id</str>
|
1477
|
-
<!-- Field name with the logical "content" of a each document (optional) -->
|
1478
|
-
<str name="carrot.snippet">features</str>
|
1479
|
-
<!-- Apply highlighter to the title/ content and use this for clustering. -->
|
1480
|
-
<bool name="carrot.produceSummary">true</bool>
|
1481
|
-
<!-- the maximum number of labels per cluster -->
|
1482
|
-
<!--<int name="carrot.numDescriptions">5</int>-->
|
1483
|
-
<!-- produce sub clusters -->
|
1484
|
-
<bool name="carrot.outputSubClusters">false</bool>
|
1485
|
-
|
1486
|
-
<!-- Configure the remaining request handler parameters. -->
|
1487
|
-
<str name="defType">edismax</str>
|
1488
|
-
<str name="qf">
|
1489
|
-
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1
|
1490
|
-
cat^1.4
|
1491
|
-
</str>
|
1492
|
-
<str name="q.alt">*:*</str>
|
1493
|
-
<str name="rows">10</str>
|
1494
|
-
<str name="fl">*,score</str>
|
1157
|
+
<str name="hl.multiValuedSeparatorChar">/</str>
|
1495
1158
|
</lst>
|
1496
|
-
|
1497
|
-
|
1498
|
-
</arr>
|
1499
|
-
</requestHandler>
|
1500
|
-
|
1501
|
-
<!-- Terms Component
|
1502
|
-
|
1503
|
-
http://wiki.apache.org/solr/TermsComponent
|
1504
|
-
|
1505
|
-
A component to return terms and document frequency of those
|
1506
|
-
terms
|
1507
|
-
-->
|
1508
|
-
<searchComponent name="terms" class="solr.TermsComponent"/>
|
1159
|
+
-->
|
1160
|
+
</fragmentsBuilder>
|
1509
1161
|
|
1510
|
-
|
1511
|
-
|
1162
|
+
<!-- multi-colored tag FragmentsBuilder -->
|
1163
|
+
<fragmentsBuilder name="colored"
|
1164
|
+
class="solr.highlight.ScoreOrderFragmentsBuilder">
|
1512
1165
|
<lst name="defaults">
|
1513
|
-
|
1514
|
-
|
1166
|
+
<str name="hl.tag.pre"><![CDATA[
|
1167
|
+
<b style="background:yellow">,<b style="background:lawgreen">,
|
1168
|
+
<b style="background:aquamarine">,<b style="background:magenta">,
|
1169
|
+
<b style="background:palegreen">,<b style="background:coral">,
|
1170
|
+
<b style="background:wheat">,<b style="background:khaki">,
|
1171
|
+
<b style="background:lime">,<b style="background:deepskyblue">]]></str>
|
1172
|
+
<str name="hl.tag.post"><![CDATA[</b>]]></str>
|
1515
1173
|
</lst>
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1174
|
+
</fragmentsBuilder>
|
1175
|
+
|
1176
|
+
<boundaryScanner name="default"
|
1177
|
+
default="true"
|
1178
|
+
class="solr.highlight.SimpleBoundaryScanner">
|
1179
|
+
<lst name="defaults">
|
1180
|
+
<str name="hl.bs.maxScan">10</str>
|
1181
|
+
<str name="hl.bs.chars">.,!? 	 </str>
|
1182
|
+
</lst>
|
1183
|
+
</boundaryScanner>
|
1184
|
+
|
1185
|
+
<boundaryScanner name="breakIterator"
|
1186
|
+
class="solr.highlight.BreakIteratorBoundaryScanner">
|
1187
|
+
<lst name="defaults">
|
1188
|
+
<!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
|
1189
|
+
<str name="hl.bs.type">WORD</str>
|
1190
|
+
<!-- language and country are used when constructing Locale object. -->
|
1191
|
+
<!-- And the Locale object will be used when getting instance of BreakIterator -->
|
1192
|
+
<str name="hl.bs.language">en</str>
|
1193
|
+
<str name="hl.bs.country">US</str>
|
1194
|
+
</lst>
|
1195
|
+
</boundaryScanner>
|
1196
|
+
</highlighting>
|
1197
|
+
</searchComponent>
|
1529
1198
|
|
1530
|
-
|
1531
|
-
<!-- Deduplication
|
1199
|
+
<!-- Update Processors
|
1532
1200
|
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
id field as the signatureField and Solr will maintain
|
1537
|
-
uniqueness based on that anyway.
|
1201
|
+
Chains of Update Processor Factories for dealing with Update
|
1202
|
+
Requests can be declared, and then used by name in Update
|
1203
|
+
Request Processors
|
1538
1204
|
|
1539
|
-
|
1540
|
-
<!--
|
1541
|
-
<updateRequestProcessorChain name="dedupe">
|
1542
|
-
<processor class="solr.processor.SignatureUpdateProcessorFactory">
|
1543
|
-
<bool name="enabled">true</bool>
|
1544
|
-
<str name="signatureField">id</str>
|
1545
|
-
<bool name="overwriteDupes">false</bool>
|
1546
|
-
<str name="fields">name,features,cat</str>
|
1547
|
-
<str name="signatureClass">solr.processor.Lookup3Signature</str>
|
1548
|
-
</processor>
|
1549
|
-
<processor class="solr.LogUpdateProcessorFactory" />
|
1550
|
-
<processor class="solr.RunUpdateProcessorFactory" />
|
1551
|
-
</updateRequestProcessorChain>
|
1552
|
-
-->
|
1205
|
+
http://wiki.apache.org/solr/UpdateRequestProcessor
|
1553
1206
|
|
1554
|
-
|
1207
|
+
-->
|
1208
|
+
<!-- Deduplication
|
1555
1209
|
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1210
|
+
An example dedup update processor that creates the "id" field
|
1211
|
+
on the fly based on the hash code of some other fields. This
|
1212
|
+
example has overwriteDupes set to false since we are using the
|
1213
|
+
id field as the signatureField and Solr will maintain
|
1214
|
+
uniqueness based on that anyway.
|
1215
|
+
|
1216
|
+
-->
|
1217
|
+
<!--
|
1218
|
+
<updateRequestProcessorChain name="dedupe">
|
1219
|
+
<processor class="solr.processor.SignatureUpdateProcessorFactory">
|
1220
|
+
<bool name="enabled">true</bool>
|
1221
|
+
<str name="signatureField">id</str>
|
1222
|
+
<bool name="overwriteDupes">false</bool>
|
1223
|
+
<str name="fields">name,features,cat</str>
|
1224
|
+
<str name="signatureClass">solr.processor.Lookup3Signature</str>
|
1225
|
+
</processor>
|
1226
|
+
<processor class="solr.LogUpdateProcessorFactory" />
|
1227
|
+
<processor class="solr.RunUpdateProcessorFactory" />
|
1228
|
+
</updateRequestProcessorChain>
|
1229
|
+
-->
|
1230
|
+
|
1231
|
+
<!-- Language identification
|
1232
|
+
|
1233
|
+
This example update chain identifies the language of the incoming
|
1234
|
+
documents using the langid contrib. The detected language is
|
1235
|
+
written to field language_s. No field name mapping is done.
|
1236
|
+
The fields used for detection are text, title, subject and description,
|
1237
|
+
making this example suitable for detecting languages form full-text
|
1238
|
+
rich documents injected via ExtractingRequestHandler.
|
1239
|
+
See more about langId at http://wiki.apache.org/solr/LanguageDetection
|
1240
|
+
-->
|
1564
1241
|
<!--
|
1565
1242
|
<updateRequestProcessorChain name="langid">
|
1566
1243
|
<processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
|
@@ -1573,130 +1250,123 @@
|
|
1573
1250
|
</updateRequestProcessorChain>
|
1574
1251
|
-->
|
1575
1252
|
|
1576
|
-
|
1577
|
-
|
1578
|
-
This example hooks in an update processor implemented using JavaScript.
|
1579
|
-
|
1580
|
-
See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
|
1581
|
-
-->
|
1582
|
-
<!--
|
1583
|
-
<updateRequestProcessorChain name="script">
|
1584
|
-
<processor class="solr.StatelessScriptUpdateProcessorFactory">
|
1585
|
-
<str name="script">update-script.js</str>
|
1586
|
-
<lst name="params">
|
1587
|
-
<str name="config_param">example config parameter</str>
|
1588
|
-
</lst>
|
1589
|
-
</processor>
|
1590
|
-
<processor class="solr.RunUpdateProcessorFactory" />
|
1591
|
-
</updateRequestProcessorChain>
|
1592
|
-
-->
|
1593
|
-
|
1594
|
-
<!-- Response Writers
|
1595
|
-
|
1596
|
-
http://wiki.apache.org/solr/QueryResponseWriter
|
1597
|
-
|
1598
|
-
Request responses will be written using the writer specified by
|
1599
|
-
the 'wt' request parameter matching the name of a registered
|
1600
|
-
writer.
|
1601
|
-
|
1602
|
-
The "default" writer is the default and will be used if 'wt' is
|
1603
|
-
not specified in the request.
|
1604
|
-
-->
|
1605
|
-
<!-- The following response writers are implicitly configured unless
|
1606
|
-
overridden...
|
1607
|
-
-->
|
1608
|
-
<!--
|
1609
|
-
<queryResponseWriter name="xml"
|
1610
|
-
default="true"
|
1611
|
-
class="solr.XMLResponseWriter" />
|
1612
|
-
<queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
|
1613
|
-
<queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
|
1614
|
-
<queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
|
1615
|
-
<queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
|
1616
|
-
<queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
|
1617
|
-
<queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
|
1618
|
-
<queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
|
1619
|
-
-->
|
1620
|
-
|
1621
|
-
<queryResponseWriter name="json" default="true"
|
1622
|
-
class="solr.JSONResponseWriter">
|
1623
|
-
<!-- For the purposes of the tutorial, JSON responses are written as
|
1624
|
-
plain text so that they are easy to read in *any* browser.
|
1625
|
-
If you expect a MIME type of "application/json" just remove this override.
|
1626
|
-
-->
|
1627
|
-
<str name="content-type">text/plain; charset=UTF-8</str>
|
1628
|
-
</queryResponseWriter>
|
1253
|
+
<!-- Script update processor
|
1629
1254
|
|
1630
|
-
|
1631
|
-
Custom response writers can be declared as needed...
|
1632
|
-
-->
|
1633
|
-
<queryResponseWriter name="velocity" class="solr.VelocityResponseWriter"
|
1634
|
-
startup="lazy"/>
|
1255
|
+
This example hooks in an update processor implemented using JavaScript.
|
1635
1256
|
|
1257
|
+
See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
|
1258
|
+
-->
|
1259
|
+
<!--
|
1260
|
+
<updateRequestProcessorChain name="script">
|
1261
|
+
<processor class="solr.StatelessScriptUpdateProcessorFactory">
|
1262
|
+
<str name="script">update-script.js</str>
|
1263
|
+
<lst name="params">
|
1264
|
+
<str name="config_param">example config parameter</str>
|
1265
|
+
</lst>
|
1266
|
+
</processor>
|
1267
|
+
<processor class="solr.RunUpdateProcessorFactory" />
|
1268
|
+
</updateRequestProcessorChain>
|
1269
|
+
-->
|
1270
|
+
|
1271
|
+
<!-- Response Writers
|
1636
1272
|
|
1637
|
-
|
1638
|
-
in Solr's conf/xslt directory. Changes to xslt files are checked for
|
1639
|
-
every xsltCacheLifetimeSeconds.
|
1640
|
-
-->
|
1641
|
-
<queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
|
1642
|
-
<int name="xsltCacheLifetimeSeconds">5</int>
|
1643
|
-
</queryResponseWriter>
|
1273
|
+
http://wiki.apache.org/solr/QueryResponseWriter
|
1644
1274
|
|
1645
|
-
|
1275
|
+
Request responses will be written using the writer specified by
|
1276
|
+
the 'wt' request parameter matching the name of a registered
|
1277
|
+
writer.
|
1646
1278
|
|
1647
|
-
|
1279
|
+
The "default" writer is the default and will be used if 'wt' is
|
1280
|
+
not specified in the request.
|
1281
|
+
-->
|
1282
|
+
<!-- The following response writers are implicitly configured unless
|
1283
|
+
overridden...
|
1284
|
+
-->
|
1285
|
+
<!--
|
1286
|
+
<queryResponseWriter name="xml"
|
1287
|
+
default="true"
|
1288
|
+
class="solr.XMLResponseWriter" />
|
1289
|
+
<queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
|
1290
|
+
<queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
|
1291
|
+
<queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
|
1292
|
+
<queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
|
1293
|
+
<queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
|
1294
|
+
<queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
|
1295
|
+
<queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
|
1296
|
+
-->
|
1648
1297
|
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1298
|
+
<queryResponseWriter name="json" class="solr.JSONResponseWriter">
|
1299
|
+
<!-- For the purposes of the tutorial, JSON responses are written as
|
1300
|
+
plain text so that they are easy to read in *any* browser.
|
1301
|
+
If you expect a MIME type of "application/json" just remove this override.
|
1302
|
+
-->
|
1303
|
+
<str name="content-type">text/plain; charset=UTF-8</str>
|
1304
|
+
</queryResponseWriter>
|
1305
|
+
|
1306
|
+
<!--
|
1307
|
+
Custom response writers can be declared as needed...
|
1308
|
+
-->
|
1309
|
+
<queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">
|
1310
|
+
<str name="template.base.dir">${velocity.template.base.dir:}</str>
|
1311
|
+
</queryResponseWriter>
|
1657
1312
|
|
1658
|
-
|
1313
|
+
<!-- XSLT response writer transforms the XML output by any xslt file found
|
1314
|
+
in Solr's conf/xslt directory. Changes to xslt files are checked for
|
1315
|
+
every xsltCacheLifetimeSeconds.
|
1316
|
+
-->
|
1317
|
+
<queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
|
1318
|
+
<int name="xsltCacheLifetimeSeconds">5</int>
|
1319
|
+
</queryResponseWriter>
|
1659
1320
|
|
1660
|
-
|
1321
|
+
<!-- Query Parsers
|
1661
1322
|
|
1662
|
-
|
1663
|
-
used as function names when using the "func" QParser.
|
1664
|
-
-->
|
1665
|
-
<!-- example of registering a custom function parser -->
|
1666
|
-
<!--
|
1667
|
-
<valueSourceParser name="myfunc"
|
1668
|
-
class="com.mycompany.MyValueSourceParser" />
|
1669
|
-
-->
|
1323
|
+
https://cwiki.apache.org/confluence/display/solr/Query+Syntax+and+Parsing
|
1670
1324
|
|
1325
|
+
Multiple QParserPlugins can be registered by name, and then
|
1326
|
+
used in either the "defType" param for the QueryComponent (used
|
1327
|
+
by SearchHandler) or in LocalParams
|
1328
|
+
-->
|
1329
|
+
<!-- example of registering a query parser -->
|
1330
|
+
<!--
|
1331
|
+
<queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
|
1332
|
+
-->
|
1671
1333
|
|
1672
|
-
|
1673
|
-
http://wiki.apache.org/solr/DocTransformers
|
1674
|
-
-->
|
1675
|
-
<!--
|
1676
|
-
Could be something like:
|
1677
|
-
<transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
|
1678
|
-
<int name="connection">jdbc://....</int>
|
1679
|
-
</transformer>
|
1680
|
-
|
1681
|
-
To add a constant value to all docs, use:
|
1682
|
-
<transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
|
1683
|
-
<int name="value">5</int>
|
1684
|
-
</transformer>
|
1685
|
-
|
1686
|
-
If you want the user to still be able to change it with _value:something_ use this:
|
1687
|
-
<transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
|
1688
|
-
<double name="defaultValue">5</double>
|
1689
|
-
</transformer>
|
1690
|
-
|
1691
|
-
If you are using the QueryElevationComponent, you may wish to mark documents that get boosted. The
|
1692
|
-
EditorialMarkerFactory will do exactly that:
|
1693
|
-
<transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
|
1694
|
-
-->
|
1334
|
+
<!-- Function Parsers
|
1695
1335
|
|
1336
|
+
http://wiki.apache.org/solr/FunctionQuery
|
1696
1337
|
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1338
|
+
Multiple ValueSourceParsers can be registered by name, and then
|
1339
|
+
used as function names when using the "func" QParser.
|
1340
|
+
-->
|
1341
|
+
<!-- example of registering a custom function parser -->
|
1342
|
+
<!--
|
1343
|
+
<valueSourceParser name="myfunc"
|
1344
|
+
class="com.mycompany.MyValueSourceParser" />
|
1345
|
+
-->
|
1346
|
+
|
1347
|
+
|
1348
|
+
<!-- Document Transformers
|
1349
|
+
http://wiki.apache.org/solr/DocTransformers
|
1350
|
+
-->
|
1351
|
+
<!--
|
1352
|
+
Could be something like:
|
1353
|
+
<transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
|
1354
|
+
<int name="connection">jdbc://....</int>
|
1355
|
+
</transformer>
|
1356
|
+
|
1357
|
+
To add a constant value to all docs, use:
|
1358
|
+
<transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
|
1359
|
+
<int name="value">5</int>
|
1360
|
+
</transformer>
|
1361
|
+
|
1362
|
+
If you want the user to still be able to change it with _value:something_ use this:
|
1363
|
+
<transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
|
1364
|
+
<double name="defaultValue">5</double>
|
1365
|
+
</transformer>
|
1366
|
+
|
1367
|
+
If you are using the QueryElevationComponent, you may wish to mark documents that get boosted. The
|
1368
|
+
EditorialMarkerFactory will do exactly that:
|
1369
|
+
<transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
|
1370
|
+
-->
|
1701
1371
|
|
1702
1372
|
</config>
|