outoftime-sunspot 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/Manifest.txt +104 -0
- data/PostInstall.txt +7 -0
- data/README.rdoc +115 -0
- data/Rakefile +27 -0
- data/config/hoe.rb +74 -0
- data/config/requirements.rb +15 -0
- data/lib/light_config.rb +40 -0
- data/lib/sunspot/adapters.rb +54 -0
- data/lib/sunspot/conditions.rb +50 -0
- data/lib/sunspot/conditions_builder.rb +37 -0
- data/lib/sunspot/configuration.rb +17 -0
- data/lib/sunspot/field.rb +108 -0
- data/lib/sunspot/field_builder.rb +37 -0
- data/lib/sunspot/indexer.rb +65 -0
- data/lib/sunspot/query.rb +115 -0
- data/lib/sunspot/query_builder.rb +30 -0
- data/lib/sunspot/restriction.rb +72 -0
- data/lib/sunspot/scope_builder.rb +33 -0
- data/lib/sunspot/search.rb +83 -0
- data/lib/sunspot/session.rb +43 -0
- data/lib/sunspot/type.rb +62 -0
- data/lib/sunspot/util.rb +13 -0
- data/lib/sunspot/version.rb +10 -0
- data/lib/sunspot.rb +50 -0
- data/setup.rb +1585 -0
- data/solr/README.txt +36 -0
- data/solr/etc/jetty.xml +206 -0
- data/solr/etc/webdefault.xml +379 -0
- data/solr/exampledocs/books.csv +11 -0
- data/solr/exampledocs/hd.xml +46 -0
- data/solr/exampledocs/ipod_other.xml +50 -0
- data/solr/exampledocs/ipod_video.xml +35 -0
- data/solr/exampledocs/mem.xml +58 -0
- data/solr/exampledocs/monitor.xml +31 -0
- data/solr/exampledocs/monitor2.xml +30 -0
- data/solr/exampledocs/mp500.xml +39 -0
- data/solr/exampledocs/post.jar +0 -0
- data/solr/exampledocs/post.sh +28 -0
- data/solr/exampledocs/sd500.xml +33 -0
- data/solr/exampledocs/solr.xml +38 -0
- data/solr/exampledocs/spellchecker.xml +58 -0
- data/solr/exampledocs/utf8-example.xml +42 -0
- data/solr/exampledocs/vidcard.xml +52 -0
- data/solr/lib/jetty-6.1.3.jar +0 -0
- data/solr/lib/jetty-util-6.1.3.jar +0 -0
- data/solr/lib/jsp-2.1/ant-1.6.5.jar +0 -0
- data/solr/lib/jsp-2.1/core-3.1.1.jar +0 -0
- data/solr/lib/jsp-2.1/jsp-2.1.jar +0 -0
- data/solr/lib/jsp-2.1/jsp-api-2.1.jar +0 -0
- data/solr/lib/servlet-api-2.5-6.1.3.jar +0 -0
- data/solr/solr/README.txt +52 -0
- data/solr/solr/bin/abc +176 -0
- data/solr/solr/bin/abo +176 -0
- data/solr/solr/bin/backup +108 -0
- data/solr/solr/bin/backupcleaner +142 -0
- data/solr/solr/bin/commit +128 -0
- data/solr/solr/bin/optimize +129 -0
- data/solr/solr/bin/readercycle +129 -0
- data/solr/solr/bin/rsyncd-disable +77 -0
- data/solr/solr/bin/rsyncd-enable +76 -0
- data/solr/solr/bin/rsyncd-start +145 -0
- data/solr/solr/bin/rsyncd-stop +105 -0
- data/solr/solr/bin/scripts-util +83 -0
- data/solr/solr/bin/snapcleaner +148 -0
- data/solr/solr/bin/snapinstaller +168 -0
- data/solr/solr/bin/snappuller +248 -0
- data/solr/solr/bin/snappuller-disable +77 -0
- data/solr/solr/bin/snappuller-enable +77 -0
- data/solr/solr/bin/snapshooter +109 -0
- data/solr/solr/conf/admin-extra.html +31 -0
- data/solr/solr/conf/protwords.txt +21 -0
- data/solr/solr/conf/schema.xml +231 -0
- data/solr/solr/conf/scripts.conf +24 -0
- data/solr/solr/conf/solrconfig.xml +394 -0
- data/solr/solr/conf/stopwords.txt +57 -0
- data/solr/solr/conf/synonyms.txt +31 -0
- data/solr/start.jar +0 -0
- data/solr/webapps/solr.war +0 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/rcov.rake +6 -0
- data/tasks/solr.rake +12 -0
- data/tasks/website.rake +17 -0
- data/test/api/test_build_search.rb +216 -0
- data/test/api/test_helper.rb +4 -0
- data/test/api/test_indexer.rb +110 -0
- data/test/api/test_retrieve_search.rb +114 -0
- data/test/api/test_session.rb +46 -0
- data/test/custom_expectation.rb +53 -0
- data/test/integration/test_field_types.rb +62 -0
- data/test/integration/test_helper.rb +1 -0
- data/test/integration/test_keyword_search.rb +32 -0
- data/test/integration/test_pagination.rb +32 -0
- data/test/mocks/base_class.rb +2 -0
- data/test/mocks/comment.rb +28 -0
- data/test/mocks/mock_adapter.rb +25 -0
- data/test/mocks/post.rb +41 -0
- data/test/test_helper.rb +31 -0
- metadata +191 -0
@@ -0,0 +1,231 @@
|
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<!--
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
4
|
+
contributor license agreements. See the NOTICE file distributed with
|
5
|
+
this work for additional information regarding copyright ownership.
|
6
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
7
|
+
(the "License"); you may not use this file except in compliance with
|
8
|
+
the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
See the License for the specific language governing permissions and
|
16
|
+
limitations under the License.
|
17
|
+
-->
|
18
|
+
|
19
|
+
<!-- This is the Solr schema file. This file should be named "schema.xml" and
|
20
|
+
should be in the conf directory under the solr home
|
21
|
+
(i.e. ./solr/conf/schema.xml by default)
|
22
|
+
or located where the classloader for the Solr webapp can find it.
|
23
|
+
|
24
|
+
For more information, on how to customize this file, please see
|
25
|
+
http://wiki.apache.org/solr/SchemaXml
|
26
|
+
-->
|
27
|
+
|
28
|
+
<schema name="sunspot" version="1.1">
|
29
|
+
<!-- attribute "name" is the name of this schema and is only used for display purposes.
|
30
|
+
Applications should change this to reflect the nature of the search collection.
|
31
|
+
version="1.1" is Solr's version number for the schema syntax and semantics. It should
|
32
|
+
not normally be changed by applications.
|
33
|
+
1.0: multiValued attribute did not exist, all fields are multiValued by nature
|
34
|
+
1.1: multiValued attribute introduced, false by default -->
|
35
|
+
|
36
|
+
<types>
|
37
|
+
<!-- field type definitions. The "name" attribute is
|
38
|
+
just a label to be used by field definitions. The "class"
|
39
|
+
attribute and any other attributes determine the real
|
40
|
+
behavior of the fieldtype.
|
41
|
+
Class names starting with "solr" refer to java classes in the
|
42
|
+
org.apache.solr.analysis package.
|
43
|
+
-->
|
44
|
+
|
45
|
+
<!-- The StrField type is not analyzed, but indexed/stored verbatim.
|
46
|
+
- StrField and TextField support an optional compressThreshold which
|
47
|
+
limits compression (if enabled in the derived fields) to values which
|
48
|
+
exceed a certain size (in characters).
|
49
|
+
-->
|
50
|
+
<fieldtype name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
|
51
|
+
|
52
|
+
<!-- boolean type: "true" or "false" -->
|
53
|
+
<fieldtype name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
|
54
|
+
|
55
|
+
<!-- The optional sortMissingLast and sortMissingFirst attributes are
|
56
|
+
currently supported on types that are sorted internally as strings.
|
57
|
+
- If sortMissingLast="true", then a sort on this field will cause documents
|
58
|
+
without the field to come after documents with the field,
|
59
|
+
regardless of the requested sort order (asc or desc).
|
60
|
+
- If sortMissingFirst="true", then a sort on this field will cause documents
|
61
|
+
without the field to come before documents with the field,
|
62
|
+
regardless of the requested sort order.
|
63
|
+
- If sortMissingLast="false" and sortMissingFirst="false" (the default),
|
64
|
+
then default lucene sorting will be used which places docs without the
|
65
|
+
field first in an ascending sort and last in a descending sort.
|
66
|
+
-->
|
67
|
+
|
68
|
+
|
69
|
+
<!-- numeric field types that store and index the text
|
70
|
+
value verbatim (and hence don't support range queries, since the
|
71
|
+
lexicographic ordering isn't equal to the numeric ordering) -->
|
72
|
+
<fieldtype name="integer" class="solr.IntField" omitNorms="true"/>
|
73
|
+
<fieldtype name="long" class="solr.LongField" omitNorms="true"/>
|
74
|
+
<fieldtype name="float" class="solr.FloatField" omitNorms="true"/>
|
75
|
+
<fieldtype name="double" class="solr.DoubleField" omitNorms="true"/>
|
76
|
+
|
77
|
+
|
78
|
+
<!-- Numeric field types that manipulate the value into
|
79
|
+
a string value that isn't human-readable in its internal form,
|
80
|
+
but with a lexicographic ordering the same as the numeric ordering,
|
81
|
+
so that range queries work correctly. -->
|
82
|
+
<fieldtype name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
|
83
|
+
<fieldtype name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
|
84
|
+
<fieldtype name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
|
85
|
+
<fieldtype name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>
|
86
|
+
|
87
|
+
|
88
|
+
<!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
|
89
|
+
is a more restricted form of the canonical representation of dateTime
|
90
|
+
http://www.w3.org/TR/xmlschema-2/#dateTime
|
91
|
+
The trailing "Z" designates UTC time and is mandatory.
|
92
|
+
Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
|
93
|
+
All other components are mandatory.
|
94
|
+
|
95
|
+
Expressions can also be used to denote calculations that should be
|
96
|
+
performed relative to "NOW" to determine the value, ie...
|
97
|
+
|
98
|
+
NOW/HOUR
|
99
|
+
... Round to the start of the current hour
|
100
|
+
NOW-1DAY
|
101
|
+
... Exactly 1 day prior to now
|
102
|
+
NOW/DAY+6MONTHS+3DAYS
|
103
|
+
... 6 months and 3 days in the future from the start of
|
104
|
+
the current day
|
105
|
+
|
106
|
+
Consult the DateField javadocs for more information.
|
107
|
+
-->
|
108
|
+
<fieldtype name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>
|
109
|
+
|
110
|
+
<!-- solr.TextField allows the specification of custom text analyzers
|
111
|
+
specified as a tokenizer and a list of token filters. Different
|
112
|
+
analyzers may be specified for indexing and querying.
|
113
|
+
|
114
|
+
The optional positionIncrementGap puts space between multiple fields of
|
115
|
+
this type on the same document, with the purpose of preventing false phrase
|
116
|
+
matching across fields.
|
117
|
+
|
118
|
+
For more info on customizing your analyzer chain, please see
|
119
|
+
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
|
120
|
+
-->
|
121
|
+
|
122
|
+
<!-- One can also specify an existing Analyzer class that has a
|
123
|
+
default constructor via the class attribute on the analyzer element
|
124
|
+
<fieldtype name="text_greek" class="solr.TextField">
|
125
|
+
<analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
|
126
|
+
</fieldType>
|
127
|
+
-->
|
128
|
+
|
129
|
+
<!-- A text field that only splits on whitespace for exact matching of words -->
|
130
|
+
<fieldtype name="text_ws" class="solr.TextField" positionIncrementGap="100">
|
131
|
+
<analyzer>
|
132
|
+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
133
|
+
</analyzer>
|
134
|
+
</fieldtype>
|
135
|
+
|
136
|
+
<fieldtype name="text" class="solr.TextField" positionIncrementGap="100">
|
137
|
+
<analyzer>
|
138
|
+
<tokenizer class="solr.StandardTokenizerFactory"/>
|
139
|
+
<filter class="solr.StandardFilterFactory"/>
|
140
|
+
<filter class="solr.LowerCaseFilterFactory"/>
|
141
|
+
</analyzer>
|
142
|
+
</fieldtype>
|
143
|
+
|
144
|
+
<fieldtype name="text_zh" class="solr.TextField">
|
145
|
+
<analyzer class="org.apache.lucene.analysis.cn.ChineseAnalyzer"/>
|
146
|
+
</fieldtype>
|
147
|
+
|
148
|
+
|
149
|
+
<!-- Less flexible matching, but less false matches. Probably not ideal for product names,
|
150
|
+
but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
|
151
|
+
<fieldtype name="textTight" class="solr.TextField" positionIncrementGap="100" >
|
152
|
+
<analyzer>
|
153
|
+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
154
|
+
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
|
155
|
+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
|
156
|
+
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
|
157
|
+
<filter class="solr.LowerCaseFilterFactory"/>
|
158
|
+
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
|
159
|
+
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
|
160
|
+
</analyzer>
|
161
|
+
</fieldtype>
|
162
|
+
|
163
|
+
</types>
|
164
|
+
|
165
|
+
|
166
|
+
<fields>
|
167
|
+
<!-- Valid attributes for fields:
|
168
|
+
name: mandatory - the name for the field
|
169
|
+
type: mandatory - the name of a previously defined type from the <types> section
|
170
|
+
indexed: true if this field should be indexed (searchable or sortable)
|
171
|
+
stored: true if this field should be retrievable
|
172
|
+
compressed: [false] if this field should be stored using gzip compression
|
173
|
+
(this will only apply if the field type is compressable; among
|
174
|
+
the standard field types, only TextField and StrField are)
|
175
|
+
multiValued: true if this field may contain multiple values per document
|
176
|
+
omitNorms: (expert) set to true to omit the norms associated with
|
177
|
+
this field (this disables length normalization and index-time
|
178
|
+
boosting for the field, and saves some memory). Only full-text
|
179
|
+
fields or fields that need an index-time boost need norms.
|
180
|
+
-->
|
181
|
+
|
182
|
+
<field name="id" type="string" indexed="true" stored="true"/>
|
183
|
+
<field name="pk" type="string" indexed="true" stored="true"/>
|
184
|
+
<field name="type" type="string" indexed="true" stored="false" multiValued="true"/>
|
185
|
+
|
186
|
+
<!-- catchall field, containing all other searchable text fields (implemented
|
187
|
+
via copyField further on in this schema -->
|
188
|
+
<field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
|
189
|
+
|
190
|
+
<!-- Dynamic field definitions. If a field name is not found, dynamicFields
|
191
|
+
will be used if the name matches any of the patterns.
|
192
|
+
RESTRICTION: the glob-like pattern in the name attribute must have
|
193
|
+
a "*" only at the start or the end.
|
194
|
+
EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
|
195
|
+
Longer patterns will be matched first. if equal size patterns
|
196
|
+
both match, the first appearing in the schema will be used. -->
|
197
|
+
<dynamicField name="*_text" type="text" indexed="true" stored="false" multiValued="true"/>
|
198
|
+
|
199
|
+
<dynamicField name="*_s" type="string" indexed="true" stored="false" multiValued="false"/>
|
200
|
+
<dynamicField name="*_i" type="sint" indexed="true" stored="false" multiValued="false"/>
|
201
|
+
<dynamicField name="*_f" type="sfloat" indexed="true" stored="false" multiValued="false"/>
|
202
|
+
<dynamicField name="*_d" type="date" indexed="true" stored="false" multiValued="false"/>
|
203
|
+
<dynamicField name="*_b" type="boolean" indexed="true" stored="false" multiValued="false"/>
|
204
|
+
|
205
|
+
<dynamicField name="*_sm" type="string" indexed="true" stored="false" multiValued="true"/>
|
206
|
+
<dynamicField name="*_im" type="sint" indexed="true" stored="false" multiValued="true"/>
|
207
|
+
<dynamicField name="*_fm" type="sfloat" indexed="true" stored="false" multiValued="true"/>
|
208
|
+
<dynamicField name="*_dm" type="date" indexed="true" stored="false" multiValued="true"/>
|
209
|
+
<dynamicField name="*_bm" type="boolean" indexed="true" stored="false" multiValued="true"/>
|
210
|
+
</fields>
|
211
|
+
|
212
|
+
<!-- field to use to determine and enforce document uniqueness. -->
|
213
|
+
<uniqueKey>id</uniqueKey>
|
214
|
+
|
215
|
+
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
|
216
|
+
<defaultSearchField>text</defaultSearchField>
|
217
|
+
|
218
|
+
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
|
219
|
+
<solrQueryParser defaultOperator="AND"/>
|
220
|
+
|
221
|
+
<!-- copyField commands copy one field to another at the time a document
|
222
|
+
is added to the index. It's used either to index the same field differently,
|
223
|
+
or to add multiple fields to the same field for easier/faster searching. -->
|
224
|
+
<copyField source="*_text" dest="text"/>
|
225
|
+
|
226
|
+
<!-- Similarity is the scoring routine for each document vs. a query.
|
227
|
+
A custom similarity may be specified here, but the default is fine
|
228
|
+
for most applications. -->
|
229
|
+
<!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->
|
230
|
+
|
231
|
+
</schema>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright ownership.
|
4
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with
|
6
|
+
# the License. You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
user=
|
17
|
+
solr_hostname=localhost
|
18
|
+
solr_port=8983
|
19
|
+
rsyncd_port=18983
|
20
|
+
data_dir=
|
21
|
+
webapp_name=solr
|
22
|
+
master_host=
|
23
|
+
master_data_dir=
|
24
|
+
master_status_dir=
|
@@ -0,0 +1,394 @@
|
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<!--
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
4
|
+
contributor license agreements. See the NOTICE file distributed with
|
5
|
+
this work for additional information regarding copyright ownership.
|
6
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
7
|
+
(the "License"); you may not use this file except in compliance with
|
8
|
+
the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
See the License for the specific language governing permissions and
|
16
|
+
limitations under the License.
|
17
|
+
-->
|
18
|
+
|
19
|
+
<config>
|
20
|
+
<!-- Set this to 'false' if you want solr to continue working after it has
|
21
|
+
encountered an severe configuration error. In a production environment,
|
22
|
+
you may want solr to keep working even if one handler is mis-configured.
|
23
|
+
|
24
|
+
You may also set this to false using by setting the system property:
|
25
|
+
-Dsolr.abortOnConfigurationError=false
|
26
|
+
-->
|
27
|
+
<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
|
28
|
+
|
29
|
+
<!-- Used to specify an alternate directory to hold all index data
|
30
|
+
other than the default ./data under the Solr home.
|
31
|
+
If replication is in use, this should match the replication configuration. -->
|
32
|
+
<dataDir>${solr.data.dir:./solr/data}</dataDir>
|
33
|
+
|
34
|
+
<indexDefaults>
|
35
|
+
<!-- Values here affect all index writers and act as a default unless overridden. -->
|
36
|
+
<useCompoundFile>false</useCompoundFile>
|
37
|
+
<ramBufferSizeMB>32</ramBufferSizeMB>
|
38
|
+
<mergeFactor>10</mergeFactor>
|
39
|
+
<maxMergeDocs>2147483647</maxMergeDocs>
|
40
|
+
<maxFieldLength>10000</maxFieldLength>
|
41
|
+
<writeLockTimeout>1000</writeLockTimeout>
|
42
|
+
<commitLockTimeout>10000</commitLockTimeout>
|
43
|
+
</indexDefaults>
|
44
|
+
|
45
|
+
<mainIndex>
|
46
|
+
<!-- options specific to the main on-disk lucene index -->
|
47
|
+
<useCompoundFile>false</useCompoundFile>
|
48
|
+
<ramBufferSizeMB>32</ramBufferSizeMB>
|
49
|
+
<mergeFactor>10</mergeFactor>
|
50
|
+
<maxMergeDocs>2147483647</maxMergeDocs>
|
51
|
+
<maxFieldLength>10000</maxFieldLength>
|
52
|
+
|
53
|
+
<!-- If true, unlock any held write or commit locks on startup.
|
54
|
+
This defeats the locking mechanism that allows multiple
|
55
|
+
processes to safely access a lucene index, and should be
|
56
|
+
used with care. -->
|
57
|
+
<unlockOnStartup>false</unlockOnStartup>
|
58
|
+
</mainIndex>
|
59
|
+
|
60
|
+
<!-- the default high-performance update handler -->
|
61
|
+
<updateHandler class="solr.DirectUpdateHandler2">
|
62
|
+
|
63
|
+
<!-- A prefix of "solr." for class names is an alias that
|
64
|
+
causes solr to search appropriate packages, including
|
65
|
+
org.apache.solr.(search|update|request|core|analysis)
|
66
|
+
-->
|
67
|
+
|
68
|
+
<!-- autocommit pending docs if certain criteria are met
|
69
|
+
<autoCommit>
|
70
|
+
<maxDocs>10000</maxDocs>
|
71
|
+
<maxTime>1000</maxTime>
|
72
|
+
</autoCommit>
|
73
|
+
-->
|
74
|
+
|
75
|
+
<!-- The RunExecutableListener executes an external command.
|
76
|
+
exe - the name of the executable to run
|
77
|
+
dir - dir to use as the current working directory. default="."
|
78
|
+
wait - the calling thread waits until the executable returns. default="true"
|
79
|
+
args - the arguments to pass to the program. default=nothing
|
80
|
+
env - environment variables to set. default=nothing
|
81
|
+
-->
|
82
|
+
<!-- A postCommit event is fired after every commit or optimize command
|
83
|
+
<listener event="postCommit" class="solr.RunExecutableListener">
|
84
|
+
<str name="exe">snapshooter</str>
|
85
|
+
<str name="dir">solr/bin</str>
|
86
|
+
<bool name="wait">true</bool>
|
87
|
+
<arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
|
88
|
+
<arr name="env"> <str>MYVAR=val1</str> </arr>
|
89
|
+
</listener>
|
90
|
+
-->
|
91
|
+
<!-- A postOptimize event is fired only after every optimize command, useful
|
92
|
+
in conjunction with index distribution to only distribute optimized indicies
|
93
|
+
<listener event="postOptimize" class="solr.RunExecutableListener">
|
94
|
+
<str name="exe">snapshooter</str>
|
95
|
+
<str name="dir">solr/bin</str>
|
96
|
+
<bool name="wait">true</bool>
|
97
|
+
</listener>
|
98
|
+
-->
|
99
|
+
|
100
|
+
</updateHandler>
|
101
|
+
|
102
|
+
|
103
|
+
<query>
|
104
|
+
<!-- Maximum number of clauses in a boolean query... can affect
|
105
|
+
range or prefix queries that expand to big boolean
|
106
|
+
queries. An exception is thrown if exceeded. -->
|
107
|
+
<maxBooleanClauses>1024</maxBooleanClauses>
|
108
|
+
|
109
|
+
|
110
|
+
<!-- Cache used by SolrIndexSearcher for filters (DocSets),
|
111
|
+
unordered sets of *all* documents that match a query.
|
112
|
+
When a new searcher is opened, its caches may be prepopulated
|
113
|
+
or "autowarmed" using data from caches in the old searcher.
|
114
|
+
autowarmCount is the number of items to prepopulate. For LRUCache,
|
115
|
+
the autowarmed items will be the most recently accessed items.
|
116
|
+
Parameters:
|
117
|
+
class - the SolrCache implementation (currently only LRUCache)
|
118
|
+
size - the maximum number of entries in the cache
|
119
|
+
initialSize - the initial capacity (number of entries) of
|
120
|
+
the cache. (seel java.util.HashMap)
|
121
|
+
autowarmCount - the number of entries to prepopulate from
|
122
|
+
and old cache.
|
123
|
+
-->
|
124
|
+
<filterCache
|
125
|
+
class="solr.LRUCache"
|
126
|
+
size="512"
|
127
|
+
initialSize="512"
|
128
|
+
autowarmCount="256"/>
|
129
|
+
|
130
|
+
<!-- queryResultCache caches results of searches - ordered lists of
|
131
|
+
document ids (DocList) based on a query, a sort, and the range
|
132
|
+
of documents requested. -->
|
133
|
+
<queryResultCache
|
134
|
+
class="solr.LRUCache"
|
135
|
+
size="512"
|
136
|
+
initialSize="512"
|
137
|
+
autowarmCount="256"/>
|
138
|
+
|
139
|
+
<!-- documentCache caches Lucene Document objects (the stored fields for each document).
|
140
|
+
Since Lucene internal document ids are transient, this cache will not be autowarmed. -->
|
141
|
+
<documentCache
|
142
|
+
class="solr.LRUCache"
|
143
|
+
size="512"
|
144
|
+
initialSize="512"
|
145
|
+
autowarmCount="0"/>
|
146
|
+
|
147
|
+
<!-- If true, stored fields that are not requested will be loaded lazily.
|
148
|
+
-->
|
149
|
+
<enableLazyFieldLoading>false</enableLazyFieldLoading>
|
150
|
+
|
151
|
+
<!-- Example of a generic cache. These caches may be accessed by name
|
152
|
+
through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
|
153
|
+
The purpose is to enable easy caching of user/application level data.
|
154
|
+
The regenerator argument should be specified as an implementation
|
155
|
+
of solr.search.CacheRegenerator if autowarming is desired. -->
|
156
|
+
<!--
|
157
|
+
<cache name="myUserCache"
|
158
|
+
class="solr.LRUCache"
|
159
|
+
size="4096"
|
160
|
+
initialSize="1024"
|
161
|
+
autowarmCount="1024"
|
162
|
+
regenerator="org.mycompany.mypackage.MyRegenerator"
|
163
|
+
/>
|
164
|
+
-->
|
165
|
+
|
166
|
+
<!-- An optimization that attempts to use a filter to satisfy a search.
|
167
|
+
If the requested sort does not include score, then the filterCache
|
168
|
+
will be checked for a filter matching the query. If found, the filter
|
169
|
+
will be used as the source of document ids, and then the sort will be
|
170
|
+
applied to that.
|
171
|
+
<useFilterForSortedQuery>true</useFilterForSortedQuery>
|
172
|
+
-->
|
173
|
+
|
174
|
+
<!-- An optimization for use with the queryResultCache. When a search
|
175
|
+
is requested, a superset of the requested number of document ids
|
176
|
+
are collected. For example, if a search for a particular query
|
177
|
+
requests matching documents 10 through 19, and queryWindowSize is 50,
|
178
|
+
then documents 0 through 50 will be collected and cached. Any further
|
179
|
+
requests in that range can be satisfied via the cache. -->
|
180
|
+
<queryResultWindowSize>10</queryResultWindowSize>
|
181
|
+
|
182
|
+
<!-- This entry enables an int hash representation for filters (DocSets)
|
183
|
+
when the number of items in the set is less than maxSize. For smaller
|
184
|
+
sets, this representation is more memory efficient, more efficient to
|
185
|
+
iterate over, and faster to take intersections. -->
|
186
|
+
<HashDocSet maxSize="3000" loadFactor="0.75"/>
|
187
|
+
|
188
|
+
|
189
|
+
<!-- boolToFilterOptimizer converts boolean clauses with zero boost
|
190
|
+
into cached filters if the number of docs selected by the clause exceeds
|
191
|
+
the threshold (represented as a fraction of the total index) -->
|
192
|
+
<boolTofilterOptimizer enabled="true" cacheSize="32" threshold=".05"/>
|
193
|
+
|
194
|
+
|
195
|
+
<!-- a newSearcher event is fired whenever a new searcher is being prepared
|
196
|
+
and there is a current searcher handling requests (aka registered). -->
|
197
|
+
<!-- QuerySenderListener takes an array of NamedList and executes a
|
198
|
+
local query request for each NamedList in sequence. -->
|
199
|
+
<!--
|
200
|
+
<listener event="newSearcher" class="solr.QuerySenderListener">
|
201
|
+
<arr name="queries">
|
202
|
+
<lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
|
203
|
+
<lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
|
204
|
+
</arr>
|
205
|
+
</listener>
|
206
|
+
-->
|
207
|
+
|
208
|
+
<!-- a firstSearcher event is fired whenever a new searcher is being
|
209
|
+
prepared but there is no current registered searcher to handle
|
210
|
+
requests or to gain autowarming data from. -->
|
211
|
+
<!--
|
212
|
+
<listener event="firstSearcher" class="solr.QuerySenderListener">
|
213
|
+
<arr name="queries">
|
214
|
+
<lst> <str name="q">fast_warm</str> <str name="start">0</str> <str name="rows">10</str> </lst>
|
215
|
+
</arr>
|
216
|
+
</listener>
|
217
|
+
-->
|
218
|
+
|
219
|
+
<!-- If a search request comes in and there is no current registered searcher,
|
220
|
+
then immediately register the still warming searcher and use it. If
|
221
|
+
"false" then all requests will block until the first searcher is done
|
222
|
+
warming. -->
|
223
|
+
<useColdSearcher>false</useColdSearcher>
|
224
|
+
|
225
|
+
<!-- Maximum number of searchers that may be warming in the background
|
226
|
+
concurrently. An error is returned if this limit is exceeded. Recommend
|
227
|
+
1-2 for read-only slaves, higher for masters w/o cache warming. -->
|
228
|
+
<maxWarmingSearchers>4</maxWarmingSearchers>
|
229
|
+
|
230
|
+
</query>
|
231
|
+
|
232
|
+
<!--
|
233
|
+
Let the dispatch filter handler /select?qt=XXX
|
234
|
+
handleSelect=true will use consistent error handling for /select and /update
|
235
|
+
handleSelect=false will use solr1.1 style error formatting
|
236
|
+
-->
|
237
|
+
<requestDispatcher handleSelect="true" >
|
238
|
+
<!--Make sure your system has some authentication before enabling remote streaming! -->
|
239
|
+
<requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
|
240
|
+
</requestDispatcher>
|
241
|
+
|
242
|
+
|
243
|
+
<!-- requestHandler plugins... incoming queries will be dispatched to the
|
244
|
+
correct handler based on the qt (query type) param matching the
|
245
|
+
name of registered handlers.
|
246
|
+
The "standard" request handler is the default and will be used if qt
|
247
|
+
is not specified in the request.
|
248
|
+
-->
|
249
|
+
<requestHandler name="standard" class="solr.StandardRequestHandler">
|
250
|
+
<!-- default values for query parameters -->
|
251
|
+
<lst name="defaults">
|
252
|
+
<str name="echoParams">explicit</str>
|
253
|
+
<!--
|
254
|
+
<int name="rows">10</int>
|
255
|
+
<str name="fl">*</str>
|
256
|
+
<str name="version">2.1</str>
|
257
|
+
-->
|
258
|
+
</lst>
|
259
|
+
</requestHandler>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
<requestHandler name="browse" class="solr.DisMaxRequestHandler" >
|
265
|
+
<lst name="defaults">
|
266
|
+
<str name="echoParams">explicit</str>
|
267
|
+
<str name="qf">text^1.0 title_text^2.0 description_text^1.5 id^10.0</str>
|
268
|
+
<str name="mm">2<-1 5<-2 6<90%</str>
|
269
|
+
<str name="q.alt">*:*</str>
|
270
|
+
</lst>
|
271
|
+
<!-- In addition to defaults, "appends" params can be specified
|
272
|
+
to identify values which should be appended to the list of
|
273
|
+
multi-val params from the query (or the existing "defaults").
|
274
|
+
|
275
|
+
In this example, the param "fq=instock:true" will be appended to
|
276
|
+
any query time fq params the user may specify, as a mechanism for
|
277
|
+
partitioning the index, independent of any user selected filtering
|
278
|
+
that may also be desired (perhaps as a result of faceted searching).
|
279
|
+
|
280
|
+
NOTE: there is *absolutely* nothing a client can do to prevent these
|
281
|
+
"appends" values from being used, so don't use this mechanism
|
282
|
+
unless you are sure you always want it.
|
283
|
+
-->
|
284
|
+
<lst name="appends">
|
285
|
+
</lst>
|
286
|
+
<!-- "invariants" are a way of letting the Solr maintainer lock down
|
287
|
+
the options available to Solr clients. Any params values
|
288
|
+
specified here are used regardless of what values may be specified
|
289
|
+
in either the query, the "defaults", or the "appends" params.
|
290
|
+
|
291
|
+
In this example, the facet.field and facet.query params are fixed,
|
292
|
+
limiting the facets clients can use. Faceting is not turned on by
|
293
|
+
default - but if the client does specify facet=true in the request,
|
294
|
+
these are the only facets they will be able to see counts for;
|
295
|
+
regardless of what other facet.field or facet.query params they
|
296
|
+
may specify.
|
297
|
+
|
298
|
+
NOTE: there is *absolutely* nothing a client can do to prevent these
|
299
|
+
"invariants" values from being used, so don't use this mechanism
|
300
|
+
unless you are sure you always want it.
|
301
|
+
-->
|
302
|
+
<lst name="invariants">
|
303
|
+
<str name="facet">on</str>
|
304
|
+
<str name="facet.mincount">1</str>
|
305
|
+
<str name="facet.field">genre_facet</str>
|
306
|
+
<str name="facet.field">medium_facet</str>
|
307
|
+
<str name="facet.field">rating_facet</str>
|
308
|
+
<str name="facet.field">publisher_facet</str>
|
309
|
+
</lst>
|
310
|
+
</requestHandler>
|
311
|
+
|
312
|
+
|
313
|
+
<!-- SpellCheckerRequestHandler takes in a word (or several words) as the
|
314
|
+
value of the "q" parameter and returns a list of alternative spelling
|
315
|
+
suggestions. If invoked with a ...&cmd=rebuild, it will rebuild the
|
316
|
+
spellchecker index.
|
317
|
+
-->
|
318
|
+
<requestHandler name="spellchecker" class="solr.SpellCheckerRequestHandler">
|
319
|
+
<!-- default values for query parameters -->
|
320
|
+
<lst name="defaults">
|
321
|
+
<int name="suggestionCount">1</int>
|
322
|
+
<float name="accuracy">0.5</float>
|
323
|
+
</lst>
|
324
|
+
|
325
|
+
<!-- Main init params for handler -->
|
326
|
+
|
327
|
+
<!-- The directory where your SpellChecker Index should live. -->
|
328
|
+
<!-- May be absolute, or relative to the Solr "dataDir" directory. -->
|
329
|
+
<!-- If this option is not specified, a RAM directory will be used -->
|
330
|
+
<str name="spellcheckerIndexDir">spell</str>
|
331
|
+
|
332
|
+
<!-- the field in your schema that you want to be able to build -->
|
333
|
+
<!-- your spell index on. This should be a field that uses a very -->
|
334
|
+
<!-- simple FieldType without a lot of Analysis (ie: string) -->
|
335
|
+
<str name="termSourceField">word</str>
|
336
|
+
|
337
|
+
</requestHandler>
|
338
|
+
|
339
|
+
|
340
|
+
<!-- Update request handler.
|
341
|
+
|
342
|
+
Note: Since solr1.1 requestHandlers requires a valid content type header if posted in
|
343
|
+
the body. For example, curl now requires: -H 'Content-type:text/xml; charset=utf-8'
|
344
|
+
The response format differs from solr1.1 formatting and returns a standard error code.
|
345
|
+
|
346
|
+
To enable solr1.1 behavior, remove the /update handler or change its path
|
347
|
+
-->
|
348
|
+
<requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
|
349
|
+
|
350
|
+
<!-- CSV update handler, loaded on demand -->
|
351
|
+
<requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
|
352
|
+
|
353
|
+
<!-- requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" /-->
|
354
|
+
|
355
|
+
<!-- Echo the request contents back to the client -->
|
356
|
+
<requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
|
357
|
+
<lst name="defaults">
|
358
|
+
<str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' -->
|
359
|
+
<str name="echoHandler">true</str>
|
360
|
+
</lst>
|
361
|
+
</requestHandler>
|
362
|
+
|
363
|
+
<!-- queryResponseWriter plugins... query responses will be written using the
|
364
|
+
writer specified by the 'wt' request parameter matching the name of a registered
|
365
|
+
writer.
|
366
|
+
The "standard" writer is the default and will be used if 'wt' is not specified
|
367
|
+
in the request. XMLResponseWriter will be used if nothing is specified here.
|
368
|
+
The json, python, and ruby writers are also available by default.
|
369
|
+
|
370
|
+
<queryResponseWriter name="standard" class="org.apache.solr.request.XMLResponseWriter"/>
|
371
|
+
<queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
|
372
|
+
<queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
|
373
|
+
<queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
|
374
|
+
|
375
|
+
<queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
|
376
|
+
-->
|
377
|
+
|
378
|
+
<!-- XSLT response writer transforms the XML output by any xslt file found
|
379
|
+
in Solr's conf/xslt directory. Changes to xslt files are checked for
|
380
|
+
every xsltCacheLifetimeSeconds.
|
381
|
+
-->
|
382
|
+
<queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
|
383
|
+
<int name="xsltCacheLifetimeSeconds">5</int>
|
384
|
+
</queryResponseWriter>
|
385
|
+
|
386
|
+
<!-- config for the admin interface -->
|
387
|
+
<admin>
|
388
|
+
<defaultQuery>solr</defaultQuery>
|
389
|
+
<!-- configure a healthcheck file for servers behind a loadbalancer
|
390
|
+
<healthcheck type="file">server-enabled</healthcheck>
|
391
|
+
-->
|
392
|
+
</admin>
|
393
|
+
|
394
|
+
</config>
|