/[drupal]/contributions/modules/apachesolr/schema.xml
ViewVC logotype

Contents of /contributions/modules/apachesolr/schema.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.7 - (show annotations) (download) (as text)
Mon Jun 29 23:23:08 2009 UTC (4 months, 4 weeks ago) by pwolanin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +6 -3 lines
File MIME type: text/xml
sync with DRUPAL-6--1
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!-- $Id: schema.xml,v 1.1.2.1.2.32 2009/06/12 18:26:34 pwolanin Exp $ -->
3
4 <!--
5 This is the Solr schema file. This file should be named "schema.xml" and
6 should be in the conf directory under the solr home
7 (i.e. ./solr/conf/schema.xml by default)
8 or located where the classloader for the Solr webapp can find it.
9
10 For more information, on how to customize this file, please see
11 http://wiki.apache.org/solr/SchemaXml
12 -->
13
14 <schema name="drupal-0.9.3" version="1.1">
15 <!-- attribute "name" is the name of this schema and is only used for display purposes.
16 Applications should change this to reflect the nature of the search collection.
17 version="1.1" is Solr's version number for the schema syntax and semantics. It should
18 not normally be changed by applications.
19 1.0: multiValued attribute did not exist, all fields are multiValued by nature
20 1.1: multiValued attribute introduced, false by default -->
21
22 <types>
23 <!-- field type definitions. The "name" attribute is
24 just a label to be used by field definitions. The "class"
25 attribute and any other attributes determine the real
26 behavior of the fieldType.
27 Class names starting with "solr" refer to java classes in the
28 org.apache.solr.analysis package.
29 -->
30
31 <!-- The StrField type is not analyzed, but indexed/stored verbatim.
32 - StrField and TextField support an optional compressThreshold which
33 limits compression (if enabled in the derived fields) to values which
34 exceed a certain size (in characters).
35 -->
36 <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
37
38 <!-- boolean type: "true" or "false" -->
39 <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
40
41 <!-- The optional sortMissingLast and sortMissingFirst attributes are
42 currently supported on types that are sorted internally as strings.
43 - If sortMissingLast="true", then a sort on this field will cause documents
44 without the field to come after documents with the field,
45 regardless of the requested sort order (asc or desc).
46 - If sortMissingFirst="true", then a sort on this field will cause documents
47 without the field to come before documents with the field,
48 regardless of the requested sort order.
49 - If sortMissingLast="false" and sortMissingFirst="false" (the default),
50 then default lucene sorting will be used which places docs without the
51 field first in an ascending sort and last in a descending sort.
52 -->
53
54
55 <!-- numeric field types that store and index the text
56 value verbatim (and hence don't support range queries, since the
57 lexicographic ordering isn't equal to the numeric ordering) -->
58 <fieldType name="integer" class="solr.IntField" omitNorms="true"/>
59 <fieldType name="long" class="solr.LongField" omitNorms="true"/>
60 <fieldType name="float" class="solr.FloatField" omitNorms="true"/>
61 <fieldType name="double" class="solr.DoubleField" omitNorms="true"/>
62
63
64 <!-- Numeric field types that manipulate the value into
65 a string value that isn't human-readable in its internal form,
66 but with a lexicographic ordering the same as the numeric ordering,
67 so that range queries work correctly. -->
68 <fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
69 <fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
70 <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
71 <fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>
72
73
74 <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
75 is a more restricted form of the canonical representation of dateTime
76 http://www.w3.org/TR/xmlschema-2/#dateTime
77 The trailing "Z" designates UTC time and is mandatory.
78 Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
79 All other components are mandatory.
80
81 Expressions can also be used to denote calculations that should be
82 performed relative to "NOW" to determine the value, ie...
83
84 NOW/HOUR
85 ... Round to the start of the current hour
86 NOW-1DAY
87 ... Exactly 1 day prior to now
88 NOW/DAY+6MONTHS+3DAYS
89 ... 6 months and 3 days in the future from the start of
90 the current day
91
92 Consult the DateField javadocs for more information.
93 -->
94 <fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>
95
96 <!-- solr.TextField allows the specification of custom text analyzers
97 specified as a tokenizer and a list of token filters. Different
98 analyzers may be specified for indexing and querying.
99
100 The optional positionIncrementGap puts space between multiple fields of
101 this type on the same document, with the purpose of preventing false phrase
102 matching across fields.
103
104 For more info on customizing your analyzer chain, please see
105 http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
106 -->
107
108 <!-- One can also specify an existing Analyzer class that has a
109 default constructor via the class attribute on the analyzer element
110 <fieldType name="text_greek" class="solr.TextField">
111 <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
112 </fieldType>
113 -->
114
115 <!-- A text field that only splits on whitespace for exact matching of words -->
116 <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
117 <analyzer>
118 <tokenizer class="solr.WhitespaceTokenizerFactory"/>
119 </analyzer>
120 </fieldType>
121
122 <!-- A text field that uses WordDelimiterFilter to enable splitting and matching of
123 words on case-change, alpha numeric boundaries, and non-alphanumeric chars,
124 so that a query of "wifi" or "wi fi" could match a document containing "Wi-Fi".
125 Synonyms and stopwords are customized by external files, and stemming is enabled.
126 Duplicate tokens at the same position (which may result from Stemmed Synonyms or
127 WordDelim parts) are removed.
128 -->
129 <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
130 <analyzer type="index">
131 <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
132 <tokenizer class="solr.CharStreamAwareWhitespaceTokenizerFactory"/>
133 <!-- in this example, we will only use synonyms at query time
134 <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
135 -->
136 <!-- Case insensitive stop word removal.
137 add enablePositionIncrements=true in both the index and query
138 analyzers to leave a 'gap' for more accurate phrase queries.
139 -->
140 <filter class="solr.StopFilterFactory"
141 ignoreCase="true"
142 words="stopwords.txt"
143 enablePositionIncrements="true"
144 />
145 <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
146 <filter class="solr.LowerCaseFilterFactory"/>
147 <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
148 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
149 </analyzer>
150 <analyzer type="query">
151 <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
152 <tokenizer class="solr.CharStreamAwareWhitespaceTokenizerFactory"/>
153 <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
154 <filter class="solr.StopFilterFactory"
155 ignoreCase="true"
156 words="stopwords.txt"
157 enablePositionIncrements="true"
158 />
159 <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
160 <filter class="solr.LowerCaseFilterFactory"/>
161 <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
162 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
163 </analyzer>
164 </fieldType>
165
166
167 <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
168 but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
169 <fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" >
170 <analyzer>
171 <tokenizer class="solr.WhitespaceTokenizerFactory"/>
172 <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
173 <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
174 <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
175 <filter class="solr.LowerCaseFilterFactory"/>
176 <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
177 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
178 </analyzer>
179 </fieldType>
180
181 <!-- Setup simple analysis for spell checking -->
182
183 <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100">
184 <analyzer>
185 <tokenizer class="solr.StandardTokenizerFactory" />
186 <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
187 <filter class="solr.LengthFilterFactory" min="4" max="20" />
188 <filter class="solr.LowerCaseFilterFactory" />
189 <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
190 </analyzer>
191 </fieldType>
192
193 <!-- This is an example of using the KeywordTokenizer along
194 With various TokenFilterFactories to produce a sortable field
195 that does not include some properties of the source text
196 -->
197 <fieldType name="sortString" class="solr.TextField" sortMissingLast="true" omitNorms="true">
198 <analyzer>
199 <!-- KeywordTokenizer does no actual tokenizing, so the entire
200 input string is preserved as a single token
201 -->
202 <tokenizer class="solr.KeywordTokenizerFactory"/>
203 <!-- The LowerCase TokenFilter does what you expect, which can be
204 when you want your sorting to be case insensitive
205 -->
206 <filter class="solr.LowerCaseFilterFactory" />
207 <!-- The TrimFilter removes any leading or trailing whitespace -->
208 <filter class="solr.TrimFilterFactory" />
209 <!-- The PatternReplaceFilter gives you the flexibility to use
210 Java Regular expression to replace any sequence of characters
211 matching a pattern with an arbitrary replacement string,
212 which may include back refrences to portions of the orriginal
213 string matched by the pattern.
214
215 See the Java Regular Expression documentation for more
216 infomation on pattern and replacement string syntax.
217
218 http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
219
220 <filter class="solr.PatternReplaceFilterFactory"
221 pattern="(^\p{Punct}+)" replacement="" replace="all"
222 />
223 -->
224 </analyzer>
225 </fieldType>
226
227 <!-- since fields of this type are by default not stored or indexed, any data added to
228 them will be ignored outright
229 -->
230 <fieldtype name="ignored" stored="false" indexed="false" class="solr.StrField" />
231
232 </types>
233
234
235 <fields>
236 <!-- Valid attributes for fields:
237 name: mandatory - the name for the field
238 type: mandatory - the name of a previously defined type from the <types> section
239 indexed: true if this field should be indexed (searchable or sortable)
240 stored: true if this field should be retrievable
241 compressed: [false] if this field should be stored using gzip compression
242 (this will only apply if the field type is compressable; among
243 the standard field types, only TextField and StrField are)
244 multiValued: true if this field may contain multiple values per document
245 omitNorms: (expert) set to true to omit the norms associated with
246 this field (this disables length normalization and index-time
247 boosting for the field, and saves some memory). Only full-text
248 fields or fields that need an index-time boost need norms.
249 -->
250
251 <!-- The document id is derived from a site-spcific key (hash) and the node ID like:
252 $document->id = $hash . '/node/' . $node->nid; -->
253
254 <field name="id" type="string" indexed="true" stored="true" required="true" />
255
256 <!-- These are the fields that correspond to a Drupal node. The beauty of having
257 Lucene store title, body, type, etc., is that we retrieve them with the search
258 result set and don't need to go to the database with a node_load. -->
259
260 <field name="site" type="string" indexed="true" stored="true"/>
261 <field name="hash" type="string" indexed="true" stored="true"/>
262 <field name="url" type="string" indexed="true" stored="true"/>
263 <field name="title" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true"/>
264 <field name="sort_title" type="sortString" indexed="true" stored="false"/>
265 <field name="body" type="text" indexed="true" stored="true" termVectors="true"/>
266 <field name="teaser" type="text" indexed="false" stored="true"/>
267 <field name="type" type="string" indexed="true" stored="true"/>
268 <field name="type_name" type="string" indexed="true" stored="true"/>
269 <field name="path" type="string" indexed="true" stored="true"/>
270 <field name="path_alias" type="text" indexed="true" stored="true" termVectors="true"/>
271 <field name="uid" type="integer" indexed="true" stored="true"/>
272 <field name="name" type="text" indexed="true" stored="true" termVectors="true"/>
273 <field name="sname" type="string" indexed="true" stored="false"/>
274 <field name="sort_name" type="sortString" indexed="true" stored="false"/>
275 <field name="created" type="date" indexed="true" stored="true"/>
276 <field name="changed" type="date" indexed="true" stored="true"/>
277 <field name="last_comment_or_change" type="date" indexed="true" stored="true"/>
278 <field name="nid" type="integer" indexed="true" stored="true"/>
279 <field name="status" type="boolean" indexed="true" stored="true"/>
280 <field name="promote" type="boolean" indexed="true" stored="true"/>
281 <field name="moderate" type="boolean" indexed="true" stored="true"/>
282 <field name="sticky" type="boolean" indexed="true" stored="true"/>
283 <field name="tnid" type="integer" indexed="true" stored="true"/>
284 <field name="translate" type="boolean" indexed="true" stored="true"/>
285 <field name="language" type="string" indexed="true" stored="true"/>
286 <field name="comment_count" type="integer" indexed="true" stored="true"/>
287 <field name="tid" type="integer" indexed="true" stored="true" multiValued="true"/>
288 <field name="vid" type="integer" indexed="true" stored="true" multiValued="true"/>
289 <field name="taxonomy_names" type="text" indexed="true" stored="false" termVectors="true" multiValued="true" omitNorms="true"/>
290 <!-- The string version of the title is used for sorting -->
291 <copyField source="title" dest="sort_title"/>
292 <!-- The string versions of the name used for sorting/multi-site facets -->
293 <copyField source="name" dest="sname"/>
294 <copyField source="name" dest="sort_name"/>
295 <!-- Copy terms to a single field that contains all taxonomy term names -->
296 <copyField source="ts_vid_*" dest="taxonomy_names"/>
297 <!-- The teaser can be used when a better snippet is not available -->
298 <copyField source="body" dest="teaser" maxChars="300"/>
299
300 <!-- A set of fields to contain text extracted from tag contents which we
301 can boost at query time. -->
302 <field name="tags_h1" type="text" indexed="true" stored="false" omitNorms="true"/>
303 <field name="tags_h2_h3" type="text" indexed="true" stored="false" omitNorms="true"/>
304 <field name="tags_h4_h5_h6" type="text" indexed="true" stored="false" omitNorms="true"/>
305 <field name="tags_a" type="text" indexed="true" stored="false" omitNorms="true"/>
306 <!-- Inline tags are typically u, b, i, em, strong -->
307 <field name="tags_inline" type="text" indexed="true" stored="false" omitNorms="true"/>
308
309 <!-- Here, default is used to create a "timestamp" field indicating
310 when each document was indexed.-->
311 <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
312
313 <!-- This field is used to build the spellchecker index -->
314 <field name="spell" type="textSpell" indexed="true" stored="true" multiValued="true"/>
315
316 <!-- copyField commands copy one field to another at the time a document
317 is added to the index. It's used either to index the same field differently,
318 or to add multiple fields to the same field for easier/faster searching. -->
319 <copyField source="title" dest="spell"/>
320 <copyField source="body" dest="spell"/>
321
322 <!-- Dynamic field definitions. If a field name is not found, dynamicFields
323 will be used if the name matches any of the patterns.
324 RESTRICTION: the glob-like pattern in the name attribute must have
325 a "*" only at the start or the end.
326 EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
327 Longer patterns will be matched first. if equal size patterns
328 both match, the first appearing in the schema will be used. -->
329
330 <dynamicField name="is_*" type="integer" indexed="true" stored="true" multiValued="false"/>
331 <dynamicField name="im_*" type="integer" indexed="true" stored="true" multiValued="true"/>
332 <dynamicField name="sis_*" type="sint" indexed="true" stored="true" multiValued="false"/>
333 <dynamicField name="sim_*" type="sint" indexed="true" stored="true" multiValued="true"/>
334 <dynamicField name="sm_*" type="string" indexed="true" stored="true" multiValued="true"/>
335 <dynamicField name="tm_*" type="text" indexed="true" stored="true" multiValued="true" termVectors="true"/>
336 <dynamicField name="ss_*" type="string" indexed="true" stored="true" multiValued="false"/>
337 <dynamicField name="ts_*" type="text" indexed="true" stored="true" multiValued="false" termVectors="true"/>
338 <dynamicField name="ds_*" type="date" indexed="true" stored="true" multiValued="false"/>
339 <dynamicField name="dm_*" type="date" indexed="true" stored="true" multiValued="true"/>
340 <dynamicField name="bm_*" type="boolean" indexed="true" stored="true" multiValued="true"/>
341 <dynamicField name="bs_*" type="boolean" indexed="true" stored="true" multiValued="false"/>
342 <dynamicField name="fs_*" type="sfloat" indexed="true" stored="true" multiValued="false"/>
343 <dynamicField name="fm_*" type="sfloat" indexed="true" stored="true" multiValued="true"/>
344 <dynamicField name="ps_*" type="sdouble" indexed="true" stored="true" multiValued="false"/>
345 <dynamicField name="pm_*" type="sdouble" indexed="true" stored="true" multiValued="true"/>
346 <!-- Sortable version of the dynamic string field -->
347 <dynamicField name="sort_ss_*" type="sortString" indexed="true" stored="false"/>
348 <copyField source="ss_*" dest="sort_ss_*"/>
349 <!-- This field is used to store node access records, as opposed to CCK field data -->
350 <dynamicField name="nodeaccess*" type="integer" indexed="true" stored="false" multiValued="true"/>
351
352 <!-- The following causes solr to ignore any fields that don't already match an existing
353 field name or dynamic field, rather than reporting them as an error.
354 Alternately, change the type="ignored" to some other type e.g. "text" if you want
355 unknown fields indexed and/or stored by default -->
356 <dynamicField name="*" type="ignored" multiValued="true" />
357
358
359
360 <!-- BACKWARDS COMPATIBILITY -->
361 <!-- Here is where we store fields which are no longer used -->
362
363 <!-- Fields previously used for sorting -->
364 <field name="stitle" type="string" indexed="true" stored="true"/>
365 <field name="title_sort" type="sortString" indexed="true" stored="false"/>
366
367 <field name="name_sort" type="sortString" indexed="true" stored="false"/>
368
369
370 <!-- /BACKWARDS COMPATIBILITY -->
371 </fields>
372
373 <!-- Field to use to determine and enforce document uniqueness.
374 Unless this field is marked with required="false", it will be a required field
375 -->
376 <uniqueKey>id</uniqueKey>
377
378 <!-- field for the QueryParser to use when an explicit fieldname is absent -->
379 <defaultSearchField>body</defaultSearchField>
380
381 <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
382 <solrQueryParser defaultOperator="AND"/>
383
384 </schema>

  ViewVC Help
Powered by ViewVC 1.1.2