Skip to content

Commit 2e845cc

Browse files
author
synapticloop
committed
Added in original Solr schema versions, updated gradle build to produce a tgz file, rather than a straight tar file
1 parent f86660a commit 2e845cc

49 files changed

Lines changed: 12815 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ tasks.register('testIntegrationSpider', Test) {
234234
outputs.upToDateWhen { false }
235235
}
236236

237+
tasks.named('distTar', Tar) {
238+
// Example: Change the compression to GZIP (if it wasn't already)
239+
compression = Compression.GZIP
240+
}
241+
237242
jacocoTestReport {
238243
dependsOn test
239244
}
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<schema name="book-store" version="1.6">
3+
<field name="_version_" type="plong" indexed="false" stored="false"/>
4+
5+
<field name="id" type="string" stored="true" indexed="true" required="true" multiValued="false" />
6+
7+
<field name="author" type="string" indexed="true" stored="true" multiValued="true" />
8+
<field name="title" type="string" indexed="true" stored="true" multiValued="false" />
9+
<field name="description" type="string" indexed="true" stored="true" multiValued="false" />
10+
<field name="book_image" type="string" indexed="false" stored="true" multiValued="false" />
11+
<field name="buy_url" type="string" indexed="false" stored="true" multiValued="false" />
12+
<field name="genre" type="string" indexed="true" stored="true" multiValued="true" />
13+
<field name="num_pages" type="pint" indexed="false" stored="true" multiValued="false" />
14+
<field name="first_published_year" type="pint" indexed="true" stored="true" multiValued="false" />
15+
<field name="language" type="string" indexed="true" stored="true" multiValued="false" />
16+
<field name="is_paperback" type="boolean" indexed="true" stored="true" multiValued="false" />
17+
<field name="series" type="string" indexed="true" stored="true" multiValued="false" />
18+
<field name="price" type="pfloat" indexed="true" stored="true" multiValued="false" />
19+
20+
<field name="a_to_z_index" type="string" indexed="true" stored="false" multiValued="false" />
21+
<field name="decade_published" type="pint" indexed="true" stored="false" multiValued="false" />
22+
<field name="book_length" type="string" indexed="true" stored="false" multiValued="false" />
23+
24+
<field name="text" type="text_general" indexed="true" stored="false" multiValued="true" />
25+
26+
<uniqueKey>id</uniqueKey>
27+
28+
<copyField source="author" dest="text" />
29+
<copyField source="title" dest="text" />
30+
<copyField source="description" dest="text" />
31+
<copyField source="genre" dest="text" />
32+
<copyField source="series" dest="text" />
33+
34+
35+
<!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
36+
<fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true" />
37+
<fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true" docValues="true" />
38+
39+
40+
<!-- boolean type: "true" or "false" -->
41+
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
42+
<fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
43+
44+
<fieldType name="pint" class="solr.IntPointField" docValues="true"/>
45+
<fieldType name="pfloat" class="solr.FloatPointField" docValues="true"/>
46+
<fieldType name="plong" class="solr.LongPointField" docValues="true"/>
47+
<fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
48+
49+
<fieldType name="pints" class="solr.IntPointField" docValues="true" multiValued="true"/>
50+
<fieldType name="pfloats" class="solr.FloatPointField" docValues="true" multiValued="true"/>
51+
<fieldType name="plongs" class="solr.LongPointField" docValues="true" multiValued="true"/>
52+
<fieldType name="pdoubles" class="solr.DoublePointField" docValues="true" multiValued="true"/>
53+
<fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
54+
55+
<fieldType name="pdate" class="solr.DatePointField" docValues="true"/>
56+
<fieldType name="pdates" class="solr.DatePointField" docValues="true" multiValued="true"/>
57+
58+
<fieldType name="binary" class="solr.BinaryField"/>
59+
60+
<fieldType name="random" class="solr.RandomSortField" indexed="true" />
61+
62+
63+
<!-- A text field that only splits on whitespace for exact matching of words -->
64+
<dynamicField name="*_ws" type="text_ws" indexed="true" stored="true"/>
65+
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
66+
<analyzer>
67+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
68+
</analyzer>
69+
</fieldType>
70+
71+
<!-- A general text field that has reasonable, generic
72+
cross-language defaults: it tokenizes with StandardTokenizer,
73+
removes stop words from case-insensitive "stopwords.txt"
74+
(empty by default), and down cases. At query time only, it
75+
also applies synonyms.
76+
-->
77+
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
78+
<analyzer type="index">
79+
<tokenizer class="solr.StandardTokenizerFactory"/>
80+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
81+
<!-- in this example, we will only use synonyms at query time
82+
<filter class="solr.SynonymGraphFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
83+
<filter class="solr.FlattenGraphFilterFactory"/>
84+
-->
85+
<filter class="solr.LowerCaseFilterFactory"/>
86+
</analyzer>
87+
<analyzer type="query">
88+
<tokenizer class="solr.StandardTokenizerFactory"/>
89+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
90+
<filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
91+
<filter class="solr.LowerCaseFilterFactory"/>
92+
</analyzer>
93+
</fieldType>
94+
95+
96+
<!-- SortableTextField generaly functions exactly like TextField,
97+
except that it supports, and by default uses, docValues for sorting (or faceting)
98+
on the first 1024 characters of the original field values (which is configurable).
99+
100+
This makes it a bit more useful then TextField in many situations, but the trade-off
101+
is that it takes up more space on disk; which is why it's not used in place of TextField
102+
for every fieldType in this _default schema.
103+
-->
104+
<dynamicField name="*_t_sort" type="text_gen_sort" indexed="true" stored="true" multiValued="false"/>
105+
<dynamicField name="*_txt_sort" type="text_gen_sort" indexed="true" stored="true"/>
106+
<fieldType name="text_gen_sort" class="solr.SortableTextField" positionIncrementGap="100" multiValued="true">
107+
<analyzer type="index">
108+
<tokenizer class="solr.StandardTokenizerFactory"/>
109+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
110+
<filter class="solr.LowerCaseFilterFactory"/>
111+
</analyzer>
112+
<analyzer type="query">
113+
<tokenizer class="solr.StandardTokenizerFactory"/>
114+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
115+
<filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
116+
<filter class="solr.LowerCaseFilterFactory"/>
117+
</analyzer>
118+
</fieldType>
119+
120+
121+
<!-- Just like text_general except it reverses the characters of
122+
each token, to enable more efficient leading wildcard queries.
123+
-->
124+
<dynamicField name="*_txt_rev" type="text_general_rev" indexed="true" stored="true"/>
125+
<fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
126+
<analyzer type="index">
127+
<tokenizer class="solr.StandardTokenizerFactory"/>
128+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
129+
<filter class="solr.LowerCaseFilterFactory"/>
130+
<filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
131+
maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
132+
</analyzer>
133+
<analyzer type="query">
134+
<tokenizer class="solr.StandardTokenizerFactory"/>
135+
<filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
136+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
137+
<filter class="solr.LowerCaseFilterFactory"/>
138+
</analyzer>
139+
</fieldType>
140+
141+
<dynamicField name="*_phon_en" type="phonetic_en" indexed="true" stored="true"/>
142+
<fieldType name="phonetic_en" stored="false" indexed="true" class="solr.TextField" >
143+
<analyzer>
144+
<tokenizer class="solr.StandardTokenizerFactory"/>
145+
<filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
146+
</analyzer>
147+
</fieldType>
148+
149+
<!-- lowercases the entire field value, keeping it as a single token. -->
150+
<dynamicField name="*_s_lower" type="lowercase" indexed="true" stored="true"/>
151+
<fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
152+
<analyzer>
153+
<tokenizer class="solr.KeywordTokenizerFactory"/>
154+
<filter class="solr.LowerCaseFilterFactory" />
155+
</analyzer>
156+
</fieldType>
157+
158+
<!--
159+
Example of using PathHierarchyTokenizerFactory at index time, so
160+
queries for paths match documents at that path, or in descendent paths
161+
-->
162+
<dynamicField name="*_descendent_path" type="descendent_path" indexed="true" stored="true"/>
163+
<fieldType name="descendent_path" class="solr.TextField">
164+
<analyzer type="index">
165+
<tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
166+
</analyzer>
167+
<analyzer type="query">
168+
<tokenizer class="solr.KeywordTokenizerFactory" />
169+
</analyzer>
170+
</fieldType>
171+
172+
<!--
173+
Example of using PathHierarchyTokenizerFactory at query time, so
174+
queries for paths match documents at that path, or in ancestor paths
175+
-->
176+
<dynamicField name="*_ancestor_path" type="ancestor_path" indexed="true" stored="true"/>
177+
<fieldType name="ancestor_path" class="solr.TextField">
178+
<analyzer type="index">
179+
<tokenizer class="solr.KeywordTokenizerFactory" />
180+
</analyzer>
181+
<analyzer type="query">
182+
<tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
183+
</analyzer>
184+
</fieldType>
185+
186+
<!-- This point type indexes the coordinates as separate fields (subFields)
187+
If subFieldType is defined, it references a type, and a dynamic field
188+
definition is created matching *___<typename>. Alternately, if
189+
subFieldSuffix is defined, that is used to create the subFields.
190+
Example: if subFieldType="double", then the coordinates would be
191+
indexed in fields myloc_0___double,myloc_1___double.
192+
Example: if subFieldSuffix="_d" then the coordinates would be indexed
193+
in fields myloc_0_d,myloc_1_d
194+
The subFields are an implementation detail of the fieldType, and end
195+
users normally should not need to know about them.
196+
-->
197+
<dynamicField name="*_point" type="point" indexed="true" stored="true"/>
198+
<fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
199+
200+
<!-- A specialized field for geospatial search filters and distance sorting. -->
201+
<fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true"/>
202+
203+
<!-- A geospatial field type that supports multiValued and polygon shapes.
204+
For more information about this and other spatial fields see:
205+
http://lucene.apache.org/solr/guide/spatial-search.html
206+
-->
207+
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
208+
geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
209+
210+
<!-- Payloaded field types -->
211+
<fieldType name="delimited_payloads_float" stored="false" indexed="true" class="solr.TextField">
212+
<analyzer>
213+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
214+
<filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
215+
</analyzer>
216+
</fieldType>
217+
<fieldType name="delimited_payloads_int" stored="false" indexed="true" class="solr.TextField">
218+
<analyzer>
219+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
220+
<filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="integer"/>
221+
</analyzer>
222+
</fieldType>
223+
<fieldType name="delimited_payloads_string" stored="false" indexed="true" class="solr.TextField">
224+
<analyzer>
225+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
226+
<filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="identity"/>
227+
</analyzer>
228+
</fieldType>
229+
</schema>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 commit comments

Comments
 (0)