acts_as_solr_reloaded 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +22 -0
- data/README.markdown +64 -0
- data/README.rdoc +93 -0
- data/Rakefile +71 -0
- data/TESTING_THE_PLUGIN +25 -0
- data/VERSION +1 -0
- data/config/solr.yml +14 -0
- data/config/solr_environment.rb +35 -0
- data/generators/dynamic_attributes_migration/dynamic_attributes_migration_generator.rb +7 -0
- data/generators/dynamic_attributes_migration/templates/migration.rb +15 -0
- data/generators/local_migration/local_migration_generator.rb +7 -0
- data/generators/local_migration/templates/migration.rb +16 -0
- data/lib/acts_as_solr.rb +65 -0
- data/lib/acts_as_solr/acts_methods.rb +363 -0
- data/lib/acts_as_solr/class_methods.rb +240 -0
- data/lib/acts_as_solr/common_methods.rb +89 -0
- data/lib/acts_as_solr/deprecation.rb +61 -0
- data/lib/acts_as_solr/dynamic_attribute.rb +3 -0
- data/lib/acts_as_solr/instance_methods.rb +194 -0
- data/lib/acts_as_solr/lazy_document.rb +18 -0
- data/lib/acts_as_solr/local.rb +4 -0
- data/lib/acts_as_solr/parser_methods.rb +248 -0
- data/lib/acts_as_solr/search_results.rb +74 -0
- data/lib/acts_as_solr/solr_fixtures.rb +13 -0
- data/lib/acts_as_solr/tasks.rb +10 -0
- data/lib/acts_as_solr/tasks/database.rake +16 -0
- data/lib/acts_as_solr/tasks/solr.rake +142 -0
- data/lib/acts_as_solr/tasks/test.rake +5 -0
- data/lib/solr.rb +26 -0
- data/lib/solr/connection.rb +177 -0
- data/lib/solr/document.rb +75 -0
- data/lib/solr/exception.rb +13 -0
- data/lib/solr/field.rb +36 -0
- data/lib/solr/importer.rb +19 -0
- data/lib/solr/importer/array_mapper.rb +26 -0
- data/lib/solr/importer/delimited_file_source.rb +38 -0
- data/lib/solr/importer/hpricot_mapper.rb +27 -0
- data/lib/solr/importer/mapper.rb +51 -0
- data/lib/solr/importer/solr_source.rb +41 -0
- data/lib/solr/importer/xpath_mapper.rb +35 -0
- data/lib/solr/indexer.rb +52 -0
- data/lib/solr/request.rb +26 -0
- data/lib/solr/request/add_document.rb +58 -0
- data/lib/solr/request/base.rb +36 -0
- data/lib/solr/request/commit.rb +29 -0
- data/lib/solr/request/delete.rb +48 -0
- data/lib/solr/request/dismax.rb +46 -0
- data/lib/solr/request/index_info.rb +22 -0
- data/lib/solr/request/modify_document.rb +46 -0
- data/lib/solr/request/optimize.rb +19 -0
- data/lib/solr/request/ping.rb +36 -0
- data/lib/solr/request/select.rb +54 -0
- data/lib/solr/request/spellcheck.rb +30 -0
- data/lib/solr/request/standard.rb +406 -0
- data/lib/solr/request/update.rb +23 -0
- data/lib/solr/response.rb +27 -0
- data/lib/solr/response/add_document.rb +17 -0
- data/lib/solr/response/base.rb +42 -0
- data/lib/solr/response/commit.rb +15 -0
- data/lib/solr/response/delete.rb +13 -0
- data/lib/solr/response/dismax.rb +8 -0
- data/lib/solr/response/index_info.rb +26 -0
- data/lib/solr/response/modify_document.rb +17 -0
- data/lib/solr/response/optimize.rb +14 -0
- data/lib/solr/response/ping.rb +26 -0
- data/lib/solr/response/ruby.rb +42 -0
- data/lib/solr/response/select.rb +17 -0
- data/lib/solr/response/spellcheck.rb +20 -0
- data/lib/solr/response/standard.rb +65 -0
- data/lib/solr/response/xml.rb +39 -0
- data/lib/solr/solrtasks.rb +27 -0
- data/lib/solr/util.rb +32 -0
- data/lib/solr/xml.rb +44 -0
- data/solr/README.txt +36 -0
- data/solr/etc/jetty.xml +212 -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/locales.xml +16 -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/test_utf8.sh +83 -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/multicore/README.txt +3 -0
- data/solr/multicore/core0/conf/schema.xml +41 -0
- data/solr/multicore/core0/conf/solrconfig.xml +40 -0
- data/solr/multicore/core1/conf/schema.xml +41 -0
- data/solr/multicore/core1/conf/solrconfig.xml +40 -0
- data/solr/multicore/exampledocs/ipod_other.xml +34 -0
- data/solr/multicore/exampledocs/ipod_video.xml +22 -0
- data/solr/multicore/solr.xml +35 -0
- data/solr/solr/README.txt +52 -0
- data/solr/solr/bin/abc +190 -0
- data/solr/solr/bin/abo +190 -0
- data/solr/solr/bin/backup +117 -0
- data/solr/solr/bin/backupcleaner +142 -0
- data/solr/solr/bin/commit +133 -0
- data/solr/solr/bin/optimize +134 -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 +99 -0
- data/solr/solr/bin/snapcleaner +154 -0
- data/solr/solr/bin/snapinstaller +198 -0
- data/solr/solr/bin/snappuller +269 -0
- data/solr/solr/bin/snappuller-disable +77 -0
- data/solr/solr/bin/snappuller-enable +77 -0
- data/solr/solr/bin/snapshooter +136 -0
- data/solr/solr/conf/admin-extra.html +31 -0
- data/solr/solr/conf/elevate.xml +36 -0
- data/solr/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/solr/solr/conf/protwords.txt +21 -0
- data/solr/solr/conf/schema.xml +132 -0
- data/solr/solr/conf/scripts.conf +24 -0
- data/solr/solr/conf/solrconfig.xml +906 -0
- data/solr/solr/conf/spellings.txt +2 -0
- data/solr/solr/conf/stopwords.txt +58 -0
- data/solr/solr/conf/synonyms.txt +31 -0
- data/solr/solr/conf/xslt/example.xsl +132 -0
- data/solr/solr/conf/xslt/example_atom.xsl +67 -0
- data/solr/solr/conf/xslt/example_rss.xsl +66 -0
- data/solr/solr/conf/xslt/luke.xsl +337 -0
- data/solr/solr/lib/localsolr.jar +0 -0
- data/solr/solr/lib/lucene-spatial-2.9-dev.jar +0 -0
- data/solr/start.jar +0 -0
- data/solr/webapps/solr.war +0 -0
- data/test/config/solr.yml +2 -0
- data/test/db/connections/mysql/connection.rb +11 -0
- data/test/db/connections/sqlite/connection.rb +8 -0
- data/test/db/migrate/001_create_books.rb +15 -0
- data/test/db/migrate/002_create_movies.rb +12 -0
- data/test/db/migrate/003_create_categories.rb +11 -0
- data/test/db/migrate/004_create_electronics.rb +16 -0
- data/test/db/migrate/005_create_authors.rb +12 -0
- data/test/db/migrate/006_create_postings.rb +9 -0
- data/test/db/migrate/007_create_posts.rb +13 -0
- data/test/db/migrate/008_create_gadgets.rb +11 -0
- data/test/db/migrate/009_create_dynamic_attributes.rb +15 -0
- data/test/db/migrate/010_create_advertises.rb +13 -0
- data/test/db/migrate/011_create_locals.rb +15 -0
- data/test/db/test.db +0 -0
- data/test/fixtures/advertises.yml +12 -0
- data/test/fixtures/authors.yml +9 -0
- data/test/fixtures/books.yml +13 -0
- data/test/fixtures/categories.yml +7 -0
- data/test/fixtures/db_definitions/mysql.sql +41 -0
- data/test/fixtures/dynamic_attributes.yml +11 -0
- data/test/fixtures/electronics.yml +49 -0
- data/test/fixtures/locals.yml +9 -0
- data/test/fixtures/movies.yml +9 -0
- data/test/fixtures/postings.yml +10 -0
- data/test/functional/acts_as_solr_test.rb +463 -0
- data/test/functional/association_indexing_test.rb +37 -0
- data/test/functional/faceted_search_test.rb +163 -0
- data/test/functional/multi_solr_search_test.rb +57 -0
- data/test/models/advertise.rb +6 -0
- data/test/models/author.rb +10 -0
- data/test/models/book.rb +10 -0
- data/test/models/category.rb +8 -0
- data/test/models/dynamic_attribute.rb +7 -0
- data/test/models/electronic.rb +25 -0
- data/test/models/gadget.rb +9 -0
- data/test/models/local.rb +7 -0
- data/test/models/movie.rb +17 -0
- data/test/models/novel.rb +2 -0
- data/test/models/post.rb +3 -0
- data/test/models/posting.rb +11 -0
- data/test/test_helper.rb +56 -0
- data/test/unit/acts_methods_shoulda.rb +95 -0
- data/test/unit/class_methods_shoulda.rb +85 -0
- data/test/unit/common_methods_shoulda.rb +111 -0
- data/test/unit/instance_methods_shoulda.rb +372 -0
- data/test/unit/lazy_document_shoulda.rb +34 -0
- data/test/unit/parser_instance.rb +19 -0
- data/test/unit/parser_methods_shoulda.rb +338 -0
- data/test/unit/solr_instance.rb +74 -0
- data/test/unit/test_helper.rb +24 -0
- metadata +290 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
2
|
+
# (the "License"); you may not use this file except in compliance with
|
3
|
+
# the License. You may obtain a copy of the License at
|
4
|
+
#
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
#-----------------------------------------------------------------------
|
14
|
+
# Use a protected word file to protect against the stemmer reducing two
|
15
|
+
# unrelated words to the same base word.
|
16
|
+
|
17
|
+
# Some non-words that normally won't be encountered,
|
18
|
+
# just to test that they won't be stemmed.
|
19
|
+
dontstems
|
20
|
+
zwhacky
|
21
|
+
|
@@ -0,0 +1,132 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<!--
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
4
|
+
contributor license agreements. See the NOTICE file distributed with
|
5
|
+
this work for additional information regarding copyright ownership.
|
6
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
7
|
+
(the "License"); you may not use this file except in compliance with
|
8
|
+
the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
See the License for the specific language governing permissions and
|
16
|
+
limitations under the License.
|
17
|
+
-->
|
18
|
+
|
19
|
+
<!--
|
20
|
+
This is the Solr schema file. This file should be named "schema.xml" and
|
21
|
+
should be in the conf directory under the solr home
|
22
|
+
(i.e. ./solr/conf/schema.xml by default)
|
23
|
+
or located where the classloader for the Solr webapp can find it.
|
24
|
+
|
25
|
+
This example schema is the recommended starting point for users.
|
26
|
+
It should be kept correct and concise, usable out-of-the-box.
|
27
|
+
|
28
|
+
For more information, on how to customize this file, please see
|
29
|
+
http://wiki.apache.org/solr/SchemaXml
|
30
|
+
-->
|
31
|
+
|
32
|
+
<schema name="acts_as_solr" version="0.9">
|
33
|
+
<types>
|
34
|
+
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="false"/>
|
35
|
+
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="false"/>
|
36
|
+
<fieldType name="integer" class="solr.IntField" omitNorms="false"/>
|
37
|
+
<fieldType name="long" class="solr.LongField" omitNorms="false"/>
|
38
|
+
<fieldType name="float" class="solr.FloatField" omitNorms="false"/>
|
39
|
+
<fieldType name="double" class="solr.DoubleField" omitNorms="false"/>
|
40
|
+
<fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="false"/>
|
41
|
+
<fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="false"/>
|
42
|
+
<fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="false"/>
|
43
|
+
<fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="false"/>
|
44
|
+
<fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="false"/>
|
45
|
+
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
|
46
|
+
<analyzer>
|
47
|
+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
48
|
+
</analyzer>
|
49
|
+
</fieldType>
|
50
|
+
|
51
|
+
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
|
52
|
+
<analyzer type="index">
|
53
|
+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
54
|
+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
|
55
|
+
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
|
56
|
+
<filter class="solr.LowerCaseFilterFactory"/>
|
57
|
+
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
|
58
|
+
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
|
59
|
+
</analyzer>
|
60
|
+
<analyzer type="query">
|
61
|
+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
62
|
+
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
|
63
|
+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
|
64
|
+
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0"/>
|
65
|
+
<filter class="solr.LowerCaseFilterFactory"/>
|
66
|
+
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
|
67
|
+
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
|
68
|
+
</analyzer>
|
69
|
+
</fieldType>
|
70
|
+
|
71
|
+
<fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" >
|
72
|
+
<analyzer>
|
73
|
+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
74
|
+
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
|
75
|
+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
|
76
|
+
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
|
77
|
+
<filter class="solr.LowerCaseFilterFactory"/>
|
78
|
+
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
|
79
|
+
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
|
80
|
+
</analyzer>
|
81
|
+
</fieldType>
|
82
|
+
|
83
|
+
<fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="false">
|
84
|
+
<analyzer>
|
85
|
+
<tokenizer class="solr.KeywordTokenizerFactory"/>
|
86
|
+
<filter class="solr.LowerCaseFilterFactory" />
|
87
|
+
<filter class="solr.TrimFilterFactory" />
|
88
|
+
<filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])" replacement="" replace="all"/>
|
89
|
+
</analyzer>
|
90
|
+
</fieldType>
|
91
|
+
|
92
|
+
<fieldtype name="text_zh" class="solr.TextField">
|
93
|
+
<analyzer class="org.apache.lucene.analysis.cn.ChineseAnalyzer"/>
|
94
|
+
</fieldtype>
|
95
|
+
|
96
|
+
</types>
|
97
|
+
|
98
|
+
|
99
|
+
<fields>
|
100
|
+
<field name="id" type="string" indexed="true" stored="true" required="true" />
|
101
|
+
<field name="pk_i" type="integer" indexed="true" stored="true"/>
|
102
|
+
<field name="pk_s" type="string" indexed="true" stored="true"/>
|
103
|
+
<field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
|
104
|
+
|
105
|
+
<dynamicField name="*_i" type="integer" indexed="true" stored="false"/>
|
106
|
+
<dynamicField name="*_t" type="text" indexed="true" stored="true"/>
|
107
|
+
<dynamicField name="*_f" type="float" indexed="true" stored="false"/>
|
108
|
+
<dynamicField name="*_b" type="boolean" indexed="true" stored="false"/>
|
109
|
+
<dynamicField name="*_d" type="date" indexed="true" stored="false"/>
|
110
|
+
<dynamicField name="*_s" type="string" indexed="true" stored="false"/>
|
111
|
+
<dynamicField name="*_ri" type="sint" indexed="true" stored="false"/>
|
112
|
+
<dynamicField name="*_rf" type="sfloat" indexed="true" stored="false"/>
|
113
|
+
<dynamicField name="*_facet" type="string" indexed="true" stored="false"/>
|
114
|
+
<dynamicField name="*_s_mv" type="string" indexed="true" stored="false" multiValued="true"/>
|
115
|
+
<dynamicField name="*_zh_text" type="text_zh" indexed="true" stored="false" multiValued="true"/>
|
116
|
+
<dynamicField name="*_display" type="text" indexed="false" stored="true" multiValued="true"/>
|
117
|
+
|
118
|
+
<field name="lat" type="sdouble" indexed="true" stored="true"/><!-- must match the latField in solrconfig.xml -->
|
119
|
+
<field name="lng" type="sdouble" indexed="true" stored="true"/><!-- must match the lngField in solrconfig.xml -->
|
120
|
+
<field name="geo_distance" type="sdouble"/> <!-- Optional but used for distributed searching -->
|
121
|
+
<dynamicField name="_local*" type="sdouble" indexed="true" stored="true"/><!-- used internally by localsolr -->
|
122
|
+
</fields>
|
123
|
+
|
124
|
+
<uniqueKey>id</uniqueKey>
|
125
|
+
<defaultSearchField>text</defaultSearchField>
|
126
|
+
|
127
|
+
<copyField source="*_t" dest="text"/>
|
128
|
+
<copyField source="*_facet" dest="text"/>
|
129
|
+
<solrQueryParser defaultOperator="AND"/>
|
130
|
+
|
131
|
+
</schema>
|
132
|
+
|
@@ -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,906 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<!--
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
4
|
+
contributor license agreements. See the NOTICE file distributed with
|
5
|
+
this work for additional information regarding copyright ownership.
|
6
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
7
|
+
(the "License"); you may not use this file except in compliance with
|
8
|
+
the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
See the License for the specific language governing permissions and
|
16
|
+
limitations under the License.
|
17
|
+
-->
|
18
|
+
|
19
|
+
<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
|
+
|
35
|
+
<indexDefaults>
|
36
|
+
<!-- Values here affect all index writers and act as a default unless overridden. -->
|
37
|
+
<useCompoundFile>false</useCompoundFile>
|
38
|
+
|
39
|
+
<mergeFactor>10</mergeFactor>
|
40
|
+
<!--
|
41
|
+
If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
|
42
|
+
|
43
|
+
-->
|
44
|
+
<!--<maxBufferedDocs>1000</maxBufferedDocs>-->
|
45
|
+
<!-- Tell Lucene when to flush documents to disk.
|
46
|
+
Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
|
47
|
+
|
48
|
+
If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
|
49
|
+
|
50
|
+
-->
|
51
|
+
<ramBufferSizeMB>32</ramBufferSizeMB>
|
52
|
+
<maxMergeDocs>2147483647</maxMergeDocs>
|
53
|
+
<maxFieldLength>10000</maxFieldLength>
|
54
|
+
<writeLockTimeout>1000</writeLockTimeout>
|
55
|
+
<commitLockTimeout>10000</commitLockTimeout>
|
56
|
+
|
57
|
+
<!--
|
58
|
+
Expert: Turn on Lucene's auto commit capability.
|
59
|
+
This causes intermediate segment flushes to write a new lucene
|
60
|
+
index descriptor, enabling it to be opened by an external
|
61
|
+
IndexReader.
|
62
|
+
NOTE: Despite the name, this value does not have any relation to Solr's autoCommit functionality
|
63
|
+
-->
|
64
|
+
<!--<luceneAutoCommit>false</luceneAutoCommit>-->
|
65
|
+
<!--
|
66
|
+
Expert:
|
67
|
+
The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
|
68
|
+
versions used LogDocMergePolicy.
|
69
|
+
|
70
|
+
LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
|
71
|
+
to merge based on number of documents
|
72
|
+
|
73
|
+
Other implementations of MergePolicy must have a no-argument constructor
|
74
|
+
-->
|
75
|
+
<!--<mergePolicy>org.apache.lucene.index.LogByteSizeMergePolicy</mergePolicy>-->
|
76
|
+
|
77
|
+
<!--
|
78
|
+
Expert:
|
79
|
+
The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
|
80
|
+
can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
|
81
|
+
-->
|
82
|
+
<!--<mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>-->
|
83
|
+
|
84
|
+
<!--
|
85
|
+
This option specifies which Lucene LockFactory implementation to use.
|
86
|
+
|
87
|
+
single = SingleInstanceLockFactory - suggested for a read-only index
|
88
|
+
or when there is no possibility of another process trying
|
89
|
+
to modify the index.
|
90
|
+
native = NativeFSLockFactory
|
91
|
+
simple = SimpleFSLockFactory
|
92
|
+
|
93
|
+
(For backwards compatibility with Solr 1.2, 'simple' is the default
|
94
|
+
if not specified.)
|
95
|
+
-->
|
96
|
+
<lockType>single</lockType>
|
97
|
+
</indexDefaults>
|
98
|
+
|
99
|
+
<mainIndex>
|
100
|
+
<!-- options specific to the main on-disk lucene index -->
|
101
|
+
<useCompoundFile>false</useCompoundFile>
|
102
|
+
<ramBufferSizeMB>32</ramBufferSizeMB>
|
103
|
+
<mergeFactor>10</mergeFactor>
|
104
|
+
<!-- Deprecated -->
|
105
|
+
<!--<maxBufferedDocs>1000</maxBufferedDocs>-->
|
106
|
+
<maxMergeDocs>2147483647</maxMergeDocs>
|
107
|
+
<maxFieldLength>10000</maxFieldLength>
|
108
|
+
|
109
|
+
<!-- If true, unlock any held write or commit locks on startup.
|
110
|
+
This defeats the locking mechanism that allows multiple
|
111
|
+
processes to safely access a lucene index, and should be
|
112
|
+
used with care.
|
113
|
+
This is not needed if lock type is 'none' or 'single'
|
114
|
+
-->
|
115
|
+
<unlockOnStartup>false</unlockOnStartup>
|
116
|
+
|
117
|
+
<!-- If true, IndexReaders will be reopened (often more efficient) instead
|
118
|
+
of closed and then opened.
|
119
|
+
-->
|
120
|
+
<reopenReaders>true</reopenReaders>
|
121
|
+
|
122
|
+
<!--
|
123
|
+
Custom deletion policies can specified here. The class must
|
124
|
+
implement org.apache.lucene.index.IndexDeletionPolicy.
|
125
|
+
|
126
|
+
http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/index/IndexDeletionPolicy.html
|
127
|
+
|
128
|
+
The standard Solr IndexDeletionPolicy implementation supports deleting
|
129
|
+
index commit points on number of commits, age of commit point and
|
130
|
+
optimized status.
|
131
|
+
|
132
|
+
The latest commit point should always be preserved regardless
|
133
|
+
of the criteria.
|
134
|
+
-->
|
135
|
+
<deletionPolicy class="solr.SolrDeletionPolicy">
|
136
|
+
<!-- Keep only optimized commit points -->
|
137
|
+
<str name="keepOptimizedOnly">false</str>
|
138
|
+
<!-- The maximum number of commit points to be kept -->
|
139
|
+
<str name="maxCommitsToKeep">1</str>
|
140
|
+
<!--
|
141
|
+
Delete all commit points once they have reached the given age.
|
142
|
+
Supports DateMathParser syntax e.g.
|
143
|
+
|
144
|
+
<str name="maxCommitAge">30MINUTES</str>
|
145
|
+
<str name="maxCommitAge">1DAY</str>
|
146
|
+
-->
|
147
|
+
</deletionPolicy>
|
148
|
+
|
149
|
+
</mainIndex>
|
150
|
+
|
151
|
+
<!-- Enables JMX if and only if an existing MBeanServer is found, use
|
152
|
+
this if you want to configure JMX through JVM parameters. Remove
|
153
|
+
this to disable exposing Solr configuration and statistics to JMX.
|
154
|
+
|
155
|
+
If you want to connect to a particular server, specify the agentId
|
156
|
+
e.g. <jmx agentId="myAgent" />
|
157
|
+
|
158
|
+
If you want to start a new MBeanServer, specify the serviceUrl
|
159
|
+
e.g <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr" />
|
160
|
+
|
161
|
+
For more details see http://wiki.apache.org/solr/SolrJmx
|
162
|
+
-->
|
163
|
+
<jmx />
|
164
|
+
|
165
|
+
<!-- the default high-performance update handler -->
|
166
|
+
<updateHandler class="solr.DirectUpdateHandler2">
|
167
|
+
|
168
|
+
<!-- A prefix of "solr." for class names is an alias that
|
169
|
+
causes solr to search appropriate packages, including
|
170
|
+
org.apache.solr.(search|update|request|core|analysis)
|
171
|
+
-->
|
172
|
+
|
173
|
+
<!-- Perform a <commit/> automatically under certain conditions:
|
174
|
+
maxDocs - number of updates since last commit is greater than this
|
175
|
+
maxTime - oldest uncommited update (in ms) is this long ago
|
176
|
+
<autoCommit>
|
177
|
+
<maxDocs>10000</maxDocs>
|
178
|
+
<maxTime>1000</maxTime>
|
179
|
+
</autoCommit>
|
180
|
+
-->
|
181
|
+
|
182
|
+
<!-- The RunExecutableListener executes an external command.
|
183
|
+
exe - the name of the executable to run
|
184
|
+
dir - dir to use as the current working directory. default="."
|
185
|
+
wait - the calling thread waits until the executable returns. default="true"
|
186
|
+
args - the arguments to pass to the program. default=nothing
|
187
|
+
env - environment variables to set. default=nothing
|
188
|
+
-->
|
189
|
+
<!-- A postCommit event is fired after every commit or optimize command
|
190
|
+
<listener event="postCommit" class="solr.RunExecutableListener">
|
191
|
+
<str name="exe">solr/bin/snapshooter</str>
|
192
|
+
<str name="dir">.</str>
|
193
|
+
<bool name="wait">true</bool>
|
194
|
+
<arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
|
195
|
+
<arr name="env"> <str>MYVAR=val1</str> </arr>
|
196
|
+
</listener>
|
197
|
+
-->
|
198
|
+
<!-- A postOptimize event is fired only after every optimize command, useful
|
199
|
+
in conjunction with index distribution to only distribute optimized indicies
|
200
|
+
<listener event="postOptimize" class="solr.RunExecutableListener">
|
201
|
+
<str name="exe">snapshooter</str>
|
202
|
+
<str name="dir">solr/bin</str>
|
203
|
+
<bool name="wait">true</bool>
|
204
|
+
</listener>
|
205
|
+
-->
|
206
|
+
|
207
|
+
</updateHandler>
|
208
|
+
|
209
|
+
<!-- Use the following format to specify a custom IndexReaderFactory - allows for alternate
|
210
|
+
IndexReader implementations.
|
211
|
+
<indexReaderFactory name="IndexReaderFactory" class="package.class">
|
212
|
+
Parameters as required by the implementation
|
213
|
+
</indexReaderFactory >
|
214
|
+
-->
|
215
|
+
|
216
|
+
<updateRequestProcessorChain>
|
217
|
+
<processor class="com.pjaol.search.solr.update.LocalUpdateProcessorFactory">
|
218
|
+
<str name="latField">lat</str>
|
219
|
+
<str name="lngField">lng</str>
|
220
|
+
<int name="startTier">9</int>
|
221
|
+
<int name="endTier">17</int>
|
222
|
+
</processor>
|
223
|
+
<processor class="solr.RunUpdateProcessorFactory" />
|
224
|
+
<processor class="solr.LogUpdateProcessorFactory" />
|
225
|
+
</updateRequestProcessorChain>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
<query>
|
230
|
+
<!-- Maximum number of clauses in a boolean query... can affect
|
231
|
+
range or prefix queries that expand to big boolean
|
232
|
+
queries. An exception is thrown if exceeded. -->
|
233
|
+
<maxBooleanClauses>1024</maxBooleanClauses>
|
234
|
+
|
235
|
+
|
236
|
+
<!-- There are two implementations of cache available for Solr,
|
237
|
+
LRUCache, based on a synchronized LinkedHashMap, and
|
238
|
+
FastLRUCache, based on a ConcurrentHashMap. FastLRUCache has faster gets
|
239
|
+
and slower puts in single threaded operation and thus is generally faster
|
240
|
+
than LRUCache when the hit ratio of the cache is high (> 75%), and may be
|
241
|
+
faster under other scenarios on multi-cpu systems. -->
|
242
|
+
<!-- Cache used by SolrIndexSearcher for filters (DocSets),
|
243
|
+
unordered sets of *all* documents that match a query.
|
244
|
+
When a new searcher is opened, its caches may be prepopulated
|
245
|
+
or "autowarmed" using data from caches in the old searcher.
|
246
|
+
autowarmCount is the number of items to prepopulate. For LRUCache,
|
247
|
+
the autowarmed items will be the most recently accessed items.
|
248
|
+
Parameters:
|
249
|
+
class - the SolrCache implementation LRUCache or FastLRUCache
|
250
|
+
size - the maximum number of entries in the cache
|
251
|
+
initialSize - the initial capacity (number of entries) of
|
252
|
+
the cache. (seel java.util.HashMap)
|
253
|
+
autowarmCount - the number of entries to prepopulate from
|
254
|
+
and old cache.
|
255
|
+
-->
|
256
|
+
<filterCache
|
257
|
+
class="solr.FastLRUCache"
|
258
|
+
size="512"
|
259
|
+
initialSize="512"
|
260
|
+
autowarmCount="128"/>
|
261
|
+
|
262
|
+
<!-- Cache used to hold field values that are quickly accessible
|
263
|
+
by document id. The fieldValueCache is created by default
|
264
|
+
even if not configured here.
|
265
|
+
<fieldValueCache
|
266
|
+
class="solr.FastLRUCache"
|
267
|
+
size="512"
|
268
|
+
autowarmCount="128"
|
269
|
+
showItems="32"
|
270
|
+
/>
|
271
|
+
-->
|
272
|
+
|
273
|
+
<!-- queryResultCache caches results of searches - ordered lists of
|
274
|
+
document ids (DocList) based on a query, a sort, and the range
|
275
|
+
of documents requested. -->
|
276
|
+
<queryResultCache
|
277
|
+
class="solr.LRUCache"
|
278
|
+
size="512"
|
279
|
+
initialSize="512"
|
280
|
+
autowarmCount="32"/>
|
281
|
+
|
282
|
+
<!-- documentCache caches Lucene Document objects (the stored fields for each document).
|
283
|
+
Since Lucene internal document ids are transient, this cache will not be autowarmed. -->
|
284
|
+
<documentCache
|
285
|
+
class="solr.LRUCache"
|
286
|
+
size="512"
|
287
|
+
initialSize="512"
|
288
|
+
autowarmCount="0"/>
|
289
|
+
|
290
|
+
<!-- If true, stored fields that are not requested will be loaded lazily.
|
291
|
+
|
292
|
+
This can result in a significant speed improvement if the usual case is to
|
293
|
+
not load all stored fields, especially if the skipped fields are large compressed
|
294
|
+
text fields.
|
295
|
+
-->
|
296
|
+
<enableLazyFieldLoading>true</enableLazyFieldLoading>
|
297
|
+
|
298
|
+
<!-- Example of a generic cache. These caches may be accessed by name
|
299
|
+
through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
|
300
|
+
The purpose is to enable easy caching of user/application level data.
|
301
|
+
The regenerator argument should be specified as an implementation
|
302
|
+
of solr.search.CacheRegenerator if autowarming is desired. -->
|
303
|
+
<!--
|
304
|
+
<cache name="myUserCache"
|
305
|
+
class="solr.LRUCache"
|
306
|
+
size="4096"
|
307
|
+
initialSize="1024"
|
308
|
+
autowarmCount="1024"
|
309
|
+
regenerator="org.mycompany.mypackage.MyRegenerator"
|
310
|
+
/>
|
311
|
+
-->
|
312
|
+
|
313
|
+
<!-- An optimization that attempts to use a filter to satisfy a search.
|
314
|
+
If the requested sort does not include score, then the filterCache
|
315
|
+
will be checked for a filter matching the query. If found, the filter
|
316
|
+
will be used as the source of document ids, and then the sort will be
|
317
|
+
applied to that.
|
318
|
+
<useFilterForSortedQuery>true</useFilterForSortedQuery>
|
319
|
+
-->
|
320
|
+
|
321
|
+
<!-- An optimization for use with the queryResultCache. When a search
|
322
|
+
is requested, a superset of the requested number of document ids
|
323
|
+
are collected. For example, if a search for a particular query
|
324
|
+
requests matching documents 10 through 19, and queryWindowSize is 50,
|
325
|
+
then documents 0 through 49 will be collected and cached. Any further
|
326
|
+
requests in that range can be satisfied via the cache. -->
|
327
|
+
<queryResultWindowSize>50</queryResultWindowSize>
|
328
|
+
|
329
|
+
<!-- Maximum number of documents to cache for any entry in the
|
330
|
+
queryResultCache. -->
|
331
|
+
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
|
332
|
+
|
333
|
+
<!-- a newSearcher event is fired whenever a new searcher is being prepared
|
334
|
+
and there is a current searcher handling requests (aka registered). -->
|
335
|
+
<!-- QuerySenderListener takes an array of NamedList and executes a
|
336
|
+
local query request for each NamedList in sequence. -->
|
337
|
+
<listener event="newSearcher" class="solr.QuerySenderListener">
|
338
|
+
<arr name="queries">
|
339
|
+
<lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
|
340
|
+
<lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
|
341
|
+
<lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst>
|
342
|
+
</arr>
|
343
|
+
</listener>
|
344
|
+
|
345
|
+
<!-- a firstSearcher event is fired whenever a new searcher is being
|
346
|
+
prepared but there is no current registered searcher to handle
|
347
|
+
requests or to gain autowarming data from. -->
|
348
|
+
<listener event="firstSearcher" class="solr.QuerySenderListener">
|
349
|
+
<arr name="queries">
|
350
|
+
<lst> <str name="q">fast_warm</str> <str name="start">0</str> <str name="rows">10</str> </lst>
|
351
|
+
<lst><str name="q">static firstSearcher warming query from solrconfig.xml</str></lst>
|
352
|
+
</arr>
|
353
|
+
</listener>
|
354
|
+
|
355
|
+
<!-- If a search request comes in and there is no current registered searcher,
|
356
|
+
then immediately register the still warming searcher and use it. If
|
357
|
+
"false" then all requests will block until the first searcher is done
|
358
|
+
warming. -->
|
359
|
+
<useColdSearcher>false</useColdSearcher>
|
360
|
+
|
361
|
+
<!-- Maximum number of searchers that may be warming in the background
|
362
|
+
concurrently. An error is returned if this limit is exceeded. Recommend
|
363
|
+
1-2 for read-only slaves, higher for masters w/o cache warming. -->
|
364
|
+
<maxWarmingSearchers>2</maxWarmingSearchers>
|
365
|
+
|
366
|
+
</query>
|
367
|
+
|
368
|
+
<!--
|
369
|
+
Let the dispatch filter handler /select?qt=XXX
|
370
|
+
handleSelect=true will use consistent error handling for /select and /update
|
371
|
+
handleSelect=false will use solr1.1 style error formatting
|
372
|
+
-->
|
373
|
+
<requestDispatcher handleSelect="true" >
|
374
|
+
<!--Make sure your system has some authentication before enabling remote streaming! -->
|
375
|
+
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000" />
|
376
|
+
|
377
|
+
<!-- Set HTTP caching related parameters (for proxy caches and clients).
|
378
|
+
|
379
|
+
To get the behaviour of Solr 1.2 (ie: no caching related headers)
|
380
|
+
use the never304="true" option and do not specify a value for
|
381
|
+
<cacheControl>
|
382
|
+
-->
|
383
|
+
<!-- <httpCaching never304="true"> -->
|
384
|
+
<httpCaching lastModifiedFrom="openTime"
|
385
|
+
etagSeed="Solr">
|
386
|
+
<!-- lastModFrom="openTime" is the default, the Last-Modified value
|
387
|
+
(and validation against If-Modified-Since requests) will all be
|
388
|
+
relative to when the current Searcher was opened.
|
389
|
+
You can change it to lastModFrom="dirLastMod" if you want the
|
390
|
+
value to exactly corrispond to when the physical index was last
|
391
|
+
modified.
|
392
|
+
|
393
|
+
etagSeed="..." is an option you can change to force the ETag
|
394
|
+
header (and validation against If-None-Match requests) to be
|
395
|
+
differnet even if the index has not changed (ie: when making
|
396
|
+
significant changes to your config file)
|
397
|
+
|
398
|
+
lastModifiedFrom and etagSeed are both ignored if you use the
|
399
|
+
never304="true" option.
|
400
|
+
-->
|
401
|
+
<!-- If you include a <cacheControl> directive, it will be used to
|
402
|
+
generate a Cache-Control header, as well as an Expires header
|
403
|
+
if the value contains "max-age="
|
404
|
+
|
405
|
+
By default, no Cache-Control header is generated.
|
406
|
+
|
407
|
+
You can use the <cacheControl> option even if you have set
|
408
|
+
never304="true"
|
409
|
+
-->
|
410
|
+
<!-- <cacheControl>max-age=30, public</cacheControl> -->
|
411
|
+
</httpCaching>
|
412
|
+
</requestDispatcher>
|
413
|
+
|
414
|
+
|
415
|
+
<!-- requestHandler plugins... incoming queries will be dispatched to the
|
416
|
+
correct handler based on the path or the qt (query type) param.
|
417
|
+
Names starting with a '/' are accessed with the a path equal to the
|
418
|
+
registered name. Names without a leading '/' are accessed with:
|
419
|
+
http://host/app/select?qt=name
|
420
|
+
If no qt is defined, the requestHandler that declares default="true"
|
421
|
+
will be used.
|
422
|
+
-->
|
423
|
+
<requestHandler name="standard" class="solr.SearchHandler" default="true">
|
424
|
+
<!-- default values for query parameters -->
|
425
|
+
<lst name="defaults">
|
426
|
+
<str name="echoParams">explicit</str>
|
427
|
+
<str name="json.nl">map</str>
|
428
|
+
<!--
|
429
|
+
<int name="rows">10</int>
|
430
|
+
<str name="fl">*</str>
|
431
|
+
<str name="version">2.1</str>
|
432
|
+
-->
|
433
|
+
</lst>
|
434
|
+
</requestHandler>
|
435
|
+
|
436
|
+
<!-- Please refer to http://wiki.apache.org/solr/SolrReplication for details on configuring replication -->
|
437
|
+
<!--Master config-->
|
438
|
+
<!--
|
439
|
+
<requestHandler name="/replication" class="solr.ReplicationHandler" >
|
440
|
+
<lst name="master">
|
441
|
+
<str name="replicateAfter">commit</str>
|
442
|
+
<str name="confFiles">schema.xml,stopwords.txt</str>
|
443
|
+
</lst>
|
444
|
+
</requestHandler>
|
445
|
+
-->
|
446
|
+
<!-- Slave config-->
|
447
|
+
<!--
|
448
|
+
<requestHandler name="/replication" class="solr.ReplicationHandler">
|
449
|
+
<lst name="slave">
|
450
|
+
<str name="masterUrl">http://localhost:8983/solr/replication</str>
|
451
|
+
<str name="pollInterval">00:00:60</str>
|
452
|
+
</lst>
|
453
|
+
</requestHandler>
|
454
|
+
-->
|
455
|
+
|
456
|
+
<!-- DisMaxRequestHandler allows easy searching across multiple fields
|
457
|
+
for simple user-entered phrases. It's implementation is now
|
458
|
+
just the standard SearchHandler with a default query type
|
459
|
+
of "dismax".
|
460
|
+
see http://wiki.apache.org/solr/DisMaxRequestHandler
|
461
|
+
-->
|
462
|
+
<requestHandler name="dismax" class="solr.SearchHandler" >
|
463
|
+
<lst name="defaults">
|
464
|
+
<str name="defType">dismax</str>
|
465
|
+
<str name="echoParams">explicit</str>
|
466
|
+
<float name="tie">0.01</float>
|
467
|
+
<str name="qf">
|
468
|
+
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
|
469
|
+
</str>
|
470
|
+
<str name="pf">
|
471
|
+
text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9
|
472
|
+
</str>
|
473
|
+
<str name="bf">
|
474
|
+
ord(popularity)^0.5 recip(rord(price),1,1000,1000)^0.3
|
475
|
+
</str>
|
476
|
+
<str name="fl">
|
477
|
+
id,name,price,score
|
478
|
+
</str>
|
479
|
+
<str name="mm">
|
480
|
+
2<-1 5<-2 6<90%
|
481
|
+
</str>
|
482
|
+
<int name="ps">100</int>
|
483
|
+
<str name="q.alt">*:*</str>
|
484
|
+
<!-- example highlighter config, enable per-query with hl=true -->
|
485
|
+
<str name="hl.fl">text features name</str>
|
486
|
+
<!-- for this field, we want no fragmenting, just highlighting -->
|
487
|
+
<str name="f.name.hl.fragsize">0</str>
|
488
|
+
<!-- instructs Solr to return the field itself if no query terms are
|
489
|
+
found -->
|
490
|
+
<str name="f.name.hl.alternateField">name</str>
|
491
|
+
<str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
|
492
|
+
</lst>
|
493
|
+
</requestHandler>
|
494
|
+
|
495
|
+
<!-- Note how you can register the same handler multiple times with
|
496
|
+
different names (and different init parameters)
|
497
|
+
-->
|
498
|
+
<requestHandler name="partitioned" class="solr.SearchHandler" >
|
499
|
+
<lst name="defaults">
|
500
|
+
<str name="defType">dismax</str>
|
501
|
+
<str name="echoParams">explicit</str>
|
502
|
+
<str name="qf">text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0</str>
|
503
|
+
<str name="mm">2<-1 5<-2 6<90%</str>
|
504
|
+
<!-- This is an example of using Date Math to specify a constantly
|
505
|
+
moving date range in a config...
|
506
|
+
-->
|
507
|
+
<str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str>
|
508
|
+
</lst>
|
509
|
+
<!-- In addition to defaults, "appends" params can be specified
|
510
|
+
to identify values which should be appended to the list of
|
511
|
+
multi-val params from the query (or the existing "defaults").
|
512
|
+
|
513
|
+
In this example, the param "fq=instock:true" will be appended to
|
514
|
+
any query time fq params the user may specify, as a mechanism for
|
515
|
+
partitioning the index, independent of any user selected filtering
|
516
|
+
that may also be desired (perhaps as a result of faceted searching).
|
517
|
+
|
518
|
+
NOTE: there is *absolutely* nothing a client can do to prevent these
|
519
|
+
"appends" values from being used, so don't use this mechanism
|
520
|
+
unless you are sure you always want it.
|
521
|
+
-->
|
522
|
+
<lst name="appends">
|
523
|
+
<str name="fq">inStock:true</str>
|
524
|
+
</lst>
|
525
|
+
<!-- "invariants" are a way of letting the Solr maintainer lock down
|
526
|
+
the options available to Solr clients. Any params values
|
527
|
+
specified here are used regardless of what values may be specified
|
528
|
+
in either the query, the "defaults", or the "appends" params.
|
529
|
+
|
530
|
+
In this example, the facet.field and facet.query params are fixed,
|
531
|
+
limiting the facets clients can use. Faceting is not turned on by
|
532
|
+
default - but if the client does specify facet=true in the request,
|
533
|
+
these are the only facets they will be able to see counts for;
|
534
|
+
regardless of what other facet.field or facet.query params they
|
535
|
+
may specify.
|
536
|
+
|
537
|
+
NOTE: there is *absolutely* nothing a client can do to prevent these
|
538
|
+
"invariants" values from being used, so don't use this mechanism
|
539
|
+
unless you are sure you always want it.
|
540
|
+
-->
|
541
|
+
<lst name="invariants">
|
542
|
+
<str name="facet.field">cat</str>
|
543
|
+
<str name="facet.field">manu_exact</str>
|
544
|
+
<str name="facet.query">price:[* TO 500]</str>
|
545
|
+
<str name="facet.query">price:[500 TO *]</str>
|
546
|
+
</lst>
|
547
|
+
</requestHandler>
|
548
|
+
|
549
|
+
|
550
|
+
<!--
|
551
|
+
Search components are registered to SolrCore and used by Search Handlers
|
552
|
+
|
553
|
+
By default, the following components are avaliable:
|
554
|
+
|
555
|
+
<searchComponent name="query" class="org.apache.solr.handler.component.QueryComponent" />
|
556
|
+
<searchComponent name="facet" class="org.apache.solr.handler.component.FacetComponent" />
|
557
|
+
<searchComponent name="mlt" class="org.apache.solr.handler.component.MoreLikeThisComponent" />
|
558
|
+
<searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" />
|
559
|
+
<searchComponent name="stats" class="org.apache.solr.handler.component.StatsComponent" />
|
560
|
+
<searchComponent name="debug" class="org.apache.solr.handler.component.DebugComponent" />
|
561
|
+
|
562
|
+
Default configuration in a requestHandler would look like:
|
563
|
+
<arr name="components">
|
564
|
+
<str>query</str>
|
565
|
+
<str>facet</str>
|
566
|
+
<str>mlt</str>
|
567
|
+
<str>highlight</str>
|
568
|
+
<str>stats</str>
|
569
|
+
<str>debug</str>
|
570
|
+
</arr>
|
571
|
+
|
572
|
+
If you register a searchComponent to one of the standard names, that will be used instead.
|
573
|
+
To insert components before or after the 'standard' components, use:
|
574
|
+
|
575
|
+
<arr name="first-components">
|
576
|
+
<str>myFirstComponentName</str>
|
577
|
+
</arr>
|
578
|
+
|
579
|
+
<arr name="last-components">
|
580
|
+
<str>myLastComponentName</str>
|
581
|
+
</arr>
|
582
|
+
-->
|
583
|
+
|
584
|
+
<!-- The spell check component can return a list of alternative spelling
|
585
|
+
suggestions. -->
|
586
|
+
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
|
587
|
+
|
588
|
+
<str name="queryAnalyzerFieldType">textSpell</str>
|
589
|
+
|
590
|
+
<lst name="spellchecker">
|
591
|
+
<str name="name">default</str>
|
592
|
+
<str name="field">spell</str>
|
593
|
+
<str name="spellcheckIndexDir">./spellchecker1</str>
|
594
|
+
|
595
|
+
</lst>
|
596
|
+
<lst name="spellchecker">
|
597
|
+
<str name="name">jarowinkler</str>
|
598
|
+
<str name="field">spell</str>
|
599
|
+
<!-- Use a different Distance Measure -->
|
600
|
+
<str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
|
601
|
+
<str name="spellcheckIndexDir">./spellchecker2</str>
|
602
|
+
|
603
|
+
</lst>
|
604
|
+
|
605
|
+
<lst name="spellchecker">
|
606
|
+
<str name="classname">solr.FileBasedSpellChecker</str>
|
607
|
+
<str name="name">file</str>
|
608
|
+
<str name="sourceLocation">spellings.txt</str>
|
609
|
+
<str name="characterEncoding">UTF-8</str>
|
610
|
+
<str name="spellcheckIndexDir">./spellcheckerFile</str>
|
611
|
+
</lst>
|
612
|
+
</searchComponent>
|
613
|
+
|
614
|
+
<!-- A request handler utilizing the spellcheck component.
|
615
|
+
################################################################################################
|
616
|
+
NOTE: This is purely as an example. The whole purpose of the SpellCheckComponent is to hook it into
|
617
|
+
the request handler that handles (i.e. the standard or dismax SearchHandler)
|
618
|
+
queries such that a separate request is not needed to get suggestions.
|
619
|
+
|
620
|
+
IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
|
621
|
+
################################################################################################
|
622
|
+
-->
|
623
|
+
<requestHandler name="/spellCheckCompRH" class="solr.SearchHandler">
|
624
|
+
<lst name="defaults">
|
625
|
+
<!-- omp = Only More Popular -->
|
626
|
+
<str name="spellcheck.onlyMorePopular">false</str>
|
627
|
+
<!-- exr = Extended Results -->
|
628
|
+
<str name="spellcheck.extendedResults">false</str>
|
629
|
+
<!-- The number of suggestions to return -->
|
630
|
+
<str name="spellcheck.count">1</str>
|
631
|
+
</lst>
|
632
|
+
<arr name="last-components">
|
633
|
+
<str>spellcheck</str>
|
634
|
+
</arr>
|
635
|
+
</requestHandler>
|
636
|
+
|
637
|
+
<searchComponent name="tvComponent" class="org.apache.solr.handler.component.TermVectorComponent"/>
|
638
|
+
<!-- A Req Handler for working with the tvComponent. This is purely as an example.
|
639
|
+
You will likely want to add the component to your already specified request handlers. -->
|
640
|
+
<requestHandler name="tvrh" class="org.apache.solr.handler.component.SearchHandler">
|
641
|
+
<lst name="defaults">
|
642
|
+
<bool name="tv">true</bool>
|
643
|
+
</lst>
|
644
|
+
<arr name="last-components">
|
645
|
+
<str>tvComponent</str>
|
646
|
+
</arr>
|
647
|
+
</requestHandler>
|
648
|
+
|
649
|
+
<!--
|
650
|
+
<requestHandler name="/update/extract" class="org.apache.solr.handler.extraction.ExtractingRequestHandler">
|
651
|
+
<lst name="defaults">
|
652
|
+
<str name="ext.map.Last-Modified">last_modified</str>
|
653
|
+
<bool name="ext.ignore.und.fl">true</bool>
|
654
|
+
</lst>
|
655
|
+
</requestHandler>
|
656
|
+
-->
|
657
|
+
|
658
|
+
|
659
|
+
<!-- A component to return terms and document frequency of those terms.
|
660
|
+
This component does not yet support distributed search. -->
|
661
|
+
<searchComponent name="termsComponent" class="org.apache.solr.handler.component.TermsComponent"/>
|
662
|
+
|
663
|
+
<requestHandler name="/terms" class="org.apache.solr.handler.component.SearchHandler">
|
664
|
+
<lst name="defaults">
|
665
|
+
<bool name="terms">true</bool>
|
666
|
+
</lst>
|
667
|
+
<arr name="components">
|
668
|
+
<str>termsComponent</str>
|
669
|
+
</arr>
|
670
|
+
</requestHandler>
|
671
|
+
|
672
|
+
|
673
|
+
<!-- a search component that enables you to configure the top results for
|
674
|
+
a given query regardless of the normal lucene scoring.-->
|
675
|
+
<searchComponent name="elevator" class="solr.QueryElevationComponent" >
|
676
|
+
<!-- pick a fieldType to analyze queries -->
|
677
|
+
<str name="queryFieldType">string</str>
|
678
|
+
<str name="config-file">elevate.xml</str>
|
679
|
+
</searchComponent>
|
680
|
+
|
681
|
+
<!-- a request handler utilizing the elevator component -->
|
682
|
+
<requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
|
683
|
+
<lst name="defaults">
|
684
|
+
<str name="echoParams">explicit</str>
|
685
|
+
</lst>
|
686
|
+
<arr name="last-components">
|
687
|
+
<str>elevator</str>
|
688
|
+
</arr>
|
689
|
+
</requestHandler>
|
690
|
+
|
691
|
+
|
692
|
+
<!-- Update request handler.
|
693
|
+
|
694
|
+
Note: Since solr1.1 requestHandlers requires a valid content type header if posted in
|
695
|
+
the body. For example, curl now requires: -H 'Content-type:text/xml; charset=utf-8'
|
696
|
+
The response format differs from solr1.1 formatting and returns a standard error code.
|
697
|
+
|
698
|
+
To enable solr1.1 behavior, remove the /update handler or change its path
|
699
|
+
-->
|
700
|
+
<requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
|
701
|
+
|
702
|
+
|
703
|
+
<requestHandler name="/update/javabin" class="solr.BinaryUpdateRequestHandler" />
|
704
|
+
|
705
|
+
<!--
|
706
|
+
Analysis request handler. Since Solr 1.3. Use to return how a document is analyzed. Useful
|
707
|
+
for debugging and as a token server for other types of applications.
|
708
|
+
|
709
|
+
This is deprecated in favor of the improved DocumentAnalysisRequestHandler and FieldAnalysisRequestHandler
|
710
|
+
|
711
|
+
<requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
|
712
|
+
-->
|
713
|
+
|
714
|
+
<!--
|
715
|
+
An analysis handler that provides a breakdown of the analysis process of provided docuemnts. This handler expects a
|
716
|
+
(single) content stream with the following format:
|
717
|
+
|
718
|
+
<docs>
|
719
|
+
<doc>
|
720
|
+
<field name="id">1</field>
|
721
|
+
<field name="name">The Name</field>
|
722
|
+
<field name="text">The Text Value</field>
|
723
|
+
<doc>
|
724
|
+
<doc>...</doc>
|
725
|
+
<doc>...</doc>
|
726
|
+
...
|
727
|
+
</docs>
|
728
|
+
|
729
|
+
Note: Each document must contain a field which serves as the unique key. This key is used in the returned
|
730
|
+
response to assoicate an analysis breakdown to the analyzed document.
|
731
|
+
|
732
|
+
Like the FieldAnalysisRequestHandler, this handler also supports query analysis by
|
733
|
+
sending either an "analysis.query" or "q" request paraemter that holds the query text to be analyized. It also
|
734
|
+
supports the "analysis.showmatch" parameter which when set to true, all field tokens that match the query
|
735
|
+
tokens will be marked as a "match".
|
736
|
+
-->
|
737
|
+
<requestHandler name="/analysis/document" class="solr.DocumentAnalysisRequestHandler" />
|
738
|
+
|
739
|
+
<!--
|
740
|
+
RequestHandler that provides much the same functionality as analysis.jsp. Provides the ability
|
741
|
+
to specify multiple field types and field names in the same request and outputs index-time and
|
742
|
+
query-time analysis for each of them.
|
743
|
+
|
744
|
+
Request parameters are:
|
745
|
+
analysis.fieldname - The field name whose analyzers are to be used
|
746
|
+
analysis.fieldtype - The field type whose analyzers are to be used
|
747
|
+
analysis.fieldvalue - The text for index-time analysis
|
748
|
+
q (or analysis.q) - The text for query time analysis
|
749
|
+
analysis.showmatch (true|false) - When set to true and when query analysis is performed, the produced
|
750
|
+
tokens of the field value analysis will be marked as "matched" for every
|
751
|
+
token that is produces by the query analysis
|
752
|
+
-->
|
753
|
+
<requestHandler name="/analysis/field" class="solr.FieldAnalysisRequestHandler" />
|
754
|
+
|
755
|
+
|
756
|
+
<!-- CSV update handler, loaded on demand -->
|
757
|
+
<requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
|
758
|
+
|
759
|
+
|
760
|
+
<!--
|
761
|
+
Admin Handlers - This will register all the standard admin RequestHandlers. Adding
|
762
|
+
this single handler is equivalent to registering:
|
763
|
+
|
764
|
+
<requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" />
|
765
|
+
<requestHandler name="/admin/system" class="org.apache.solr.handler.admin.SystemInfoHandler" />
|
766
|
+
<requestHandler name="/admin/plugins" class="org.apache.solr.handler.admin.PluginInfoHandler" />
|
767
|
+
<requestHandler name="/admin/threads" class="org.apache.solr.handler.admin.ThreadDumpHandler" />
|
768
|
+
<requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" />
|
769
|
+
<requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
|
770
|
+
|
771
|
+
If you wish to hide files under ${solr.home}/conf, explicitly register the ShowFileRequestHandler using:
|
772
|
+
<requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
|
773
|
+
<lst name="invariants">
|
774
|
+
<str name="hidden">synonyms.txt</str>
|
775
|
+
<str name="hidden">anotherfile.txt</str>
|
776
|
+
</lst>
|
777
|
+
</requestHandler>
|
778
|
+
-->
|
779
|
+
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
|
780
|
+
|
781
|
+
<!-- ping/healthcheck -->
|
782
|
+
<requestHandler name="/admin/ping" class="PingRequestHandler">
|
783
|
+
<lst name="defaults">
|
784
|
+
<str name="qt">standard</str>
|
785
|
+
<str name="q">solrpingquery</str>
|
786
|
+
<str name="echoParams">all</str>
|
787
|
+
</lst>
|
788
|
+
</requestHandler>
|
789
|
+
|
790
|
+
<!-- Echo the request contents back to the client -->
|
791
|
+
<requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
|
792
|
+
<lst name="defaults">
|
793
|
+
<str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' -->
|
794
|
+
<str name="echoHandler">true</str>
|
795
|
+
</lst>
|
796
|
+
</requestHandler>
|
797
|
+
|
798
|
+
<highlighting>
|
799
|
+
<!-- Configure the standard fragmenter -->
|
800
|
+
<!-- This could most likely be commented out in the "default" case -->
|
801
|
+
<fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
|
802
|
+
<lst name="defaults">
|
803
|
+
<int name="hl.fragsize">100</int>
|
804
|
+
</lst>
|
805
|
+
</fragmenter>
|
806
|
+
|
807
|
+
<!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
|
808
|
+
<fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
|
809
|
+
<lst name="defaults">
|
810
|
+
<!-- slightly smaller fragsizes work better because of slop -->
|
811
|
+
<int name="hl.fragsize">70</int>
|
812
|
+
<!-- allow 50% slop on fragment sizes -->
|
813
|
+
<float name="hl.regex.slop">0.5</float>
|
814
|
+
<!-- a basic sentence pattern -->
|
815
|
+
<str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
|
816
|
+
</lst>
|
817
|
+
</fragmenter>
|
818
|
+
|
819
|
+
<!-- Configure the standard formatter -->
|
820
|
+
<formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
|
821
|
+
<lst name="defaults">
|
822
|
+
<str name="hl.simple.pre"><![CDATA[<em>]]></str>
|
823
|
+
<str name="hl.simple.post"><![CDATA[</em>]]></str>
|
824
|
+
</lst>
|
825
|
+
</formatter>
|
826
|
+
</highlighting>
|
827
|
+
|
828
|
+
<!-- An example dedup update processor that creates the "id" field on the fly
|
829
|
+
based on the hash code of some other fields. This example has overwriteDupes
|
830
|
+
set to false since we are using the id field as the signatureField and Solr
|
831
|
+
will maintain uniqueness based on that anyway. -->
|
832
|
+
<!--
|
833
|
+
<updateRequestProcessorChain name="dedupe">
|
834
|
+
<processor class="org.apache.solr.update.processor.SignatureUpdateProcessorFactory">
|
835
|
+
<bool name="enabled">true</bool>
|
836
|
+
<str name="signatureField">id</str>
|
837
|
+
<bool name="overwriteDupes">false</bool>
|
838
|
+
<str name="fields">name,features,cat</str>
|
839
|
+
<str name="signatureClass">org.apache.solr.update.processor.Lookup3Signature</str>
|
840
|
+
</processor>
|
841
|
+
<processor class="solr.LogUpdateProcessorFactory" />
|
842
|
+
<processor class="solr.RunUpdateProcessorFactory" />
|
843
|
+
</updateRequestProcessorChain>
|
844
|
+
-->
|
845
|
+
|
846
|
+
|
847
|
+
<!-- queryResponseWriter plugins... query responses will be written using the
|
848
|
+
writer specified by the 'wt' request parameter matching the name of a registered
|
849
|
+
writer.
|
850
|
+
The "default" writer is the default and will be used if 'wt' is not specified
|
851
|
+
in the request. XMLResponseWriter will be used if nothing is specified here.
|
852
|
+
The json, python, and ruby writers are also available by default.
|
853
|
+
|
854
|
+
<queryResponseWriter name="xml" class="org.apache.solr.request.XMLResponseWriter" default="true"/>
|
855
|
+
<queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
|
856
|
+
<queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
|
857
|
+
<queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
|
858
|
+
<queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
|
859
|
+
<queryResponseWriter name="phps" class="org.apache.solr.request.PHPSerializedResponseWriter"/>
|
860
|
+
|
861
|
+
<queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
|
862
|
+
-->
|
863
|
+
|
864
|
+
<!-- localsolr request handler -->
|
865
|
+
<searchComponent name="localsolr" class="com.pjaol.search.solr.component.LocalSolrQueryComponent"/>
|
866
|
+
<searchComponent name="geofacet" class="com.pjaol.search.solr.component.LocalSolrFacetComponent"/>
|
867
|
+
|
868
|
+
<requestHandler name="geo" class="org.apache.solr.handler.component.SearchHandler">
|
869
|
+
<arr name="components">
|
870
|
+
<str>localsolr</str>
|
871
|
+
<str>geofacet</str>
|
872
|
+
<str>mlt</str>
|
873
|
+
<str>highlight</str>
|
874
|
+
<str>debug</str>
|
875
|
+
</arr>
|
876
|
+
</requestHandler>
|
877
|
+
|
878
|
+
|
879
|
+
|
880
|
+
<!-- XSLT response writer transforms the XML output by any xslt file found
|
881
|
+
in Solr's conf/xslt directory. Changes to xslt files are checked for
|
882
|
+
every xsltCacheLifetimeSeconds.
|
883
|
+
-->
|
884
|
+
<queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
|
885
|
+
<int name="xsltCacheLifetimeSeconds">5</int>
|
886
|
+
</queryResponseWriter>
|
887
|
+
|
888
|
+
|
889
|
+
<!-- example of registering a query parser
|
890
|
+
<queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
|
891
|
+
-->
|
892
|
+
|
893
|
+
<!-- example of registering a custom function parser
|
894
|
+
<valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" />
|
895
|
+
-->
|
896
|
+
|
897
|
+
<!-- config for the admin interface -->
|
898
|
+
<admin>
|
899
|
+
<defaultQuery>solr</defaultQuery>
|
900
|
+
|
901
|
+
<!-- configure a healthcheck file for servers behind a loadbalancer
|
902
|
+
<healthcheck type="file">server-enabled</healthcheck>
|
903
|
+
-->
|
904
|
+
</admin>
|
905
|
+
|
906
|
+
</config>
|