schema.xml 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. This is the Solr schema file. This file should be named "schema.xml" and
  4. should be in the conf directory under the solr home
  5. (i.e. ./solr/conf/schema.xml by default)
  6. or located where the classloader for the Solr webapp can find it.
  7. For more information, on how to customize this file, please see
  8. http://wiki.apache.org/solr/SchemaXml
  9. -->
  10. <schema name="drupal-4.3-solr-5.x" version="1.5">
  11. <!-- attribute "name" is the name of this schema and is only used for
  12. display purposes. Applications should change this to reflect the nature
  13. of the search collection.
  14. version="1.2" is Solr's version number for the schema syntax and
  15. semantics. It should not normally be changed by applications.
  16. 1.0: multiValued attribute did not exist, all fields are multiValued by
  17. nature
  18. 1.1: multiValued attribute introduced, false by default
  19. 1.2: omitTermFreqAndPositions attribute introduced, true by default
  20. except for text fields.
  21. 1.3: removed optional field compress feature
  22. 1.4: autoGeneratePhraseQueries attribute introduced to drive
  23. QueryParser behavior when a single string produces multiple
  24. tokens. Defaults to off for version >= 1.4
  25. 1.5: omitNorms defaults to true for primitive field types
  26. (int, float, boolean, string...)
  27. -->
  28. <types>
  29. <!-- field type definitions. The "name" attribute is
  30. just a label to be used by field definitions. The "class"
  31. attribute and any other attributes determine the real
  32. behavior of the fieldType.
  33. Class names starting with "solr" refer to java classes in the
  34. org.apache.solr.analysis package.
  35. -->
  36. <!-- The StrField type is not analyzed, but indexed/stored verbatim.
  37. - StrField and TextField support an optional compressThreshold which
  38. limits compression (if enabled in the derived fields) to values which
  39. exceed a certain size (in characters).
  40. -->
  41. <fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
  42. <!-- boolean type: "true" or "false" -->
  43. <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
  44. <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
  45. <fieldtype name="binary" class="solr.BinaryField"/>
  46. <!-- The optional sortMissingLast and sortMissingFirst attributes are
  47. currently supported on types that are sorted internally as strings.
  48. - If sortMissingLast="true", then a sort on this field will cause documents
  49. without the field to come after documents with the field,
  50. regardless of the requested sort order (asc or desc).
  51. - If sortMissingFirst="true", then a sort on this field will cause documents
  52. without the field to come before documents with the field,
  53. regardless of the requested sort order.
  54. - If sortMissingLast="false" and sortMissingFirst="false" (the default),
  55. then default lucene sorting will be used which places docs without the
  56. field first in an ascending sort and last in a descending sort.
  57. -->
  58. <!-- numeric field types that can be sorted, but are not optimized for range queries -->
  59. <fieldType name="integer" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
  60. <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
  61. <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
  62. <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
  63. <!--
  64. Note:
  65. These should only be used for compatibility with existing indexes (created with older Solr versions)
  66. or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
  67. Numeric field types that manipulate the value into
  68. a string value that isn't human-readable in its internal form,
  69. but with a lexicographic ordering the same as the numeric ordering,
  70. so that range queries work correctly.
  71. -->
  72. <fieldType name="sint" class="solr.TrieIntField" sortMissingLast="true"/>
  73. <fieldType name="sfloat" class="solr.TrieFloatField" sortMissingLast="true"/>
  74. <fieldType name="slong" class="solr.TrieLongField" sortMissingLast="true"/>
  75. <fieldType name="sdouble" class="solr.TrieDoubleField" sortMissingLast="true"/>
  76. <!--
  77. Numeric field types that index each value at various levels of precision
  78. to accelerate range queries when the number of values between the range
  79. endpoints is large. See the javadoc for NumericRangeQuery for internal
  80. implementation details.
  81. Smaller precisionStep values (specified in bits) will lead to more tokens
  82. indexed per value, slightly larger index size, and faster range queries.
  83. A precisionStep of 0 disables indexing at different precision levels.
  84. -->
  85. <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
  86. <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
  87. <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
  88. <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>
  89. <!--
  90. The ExternalFileField type gets values from an external file instead of the
  91. index. This is useful for data such as rankings that might change frequently
  92. and require different update frequencies than the documents they are
  93. associated with.
  94. -->
  95. <fieldType name="file" keyField="id" defVal="1" stored="false" indexed="false" class="solr.ExternalFileField" valType="float"/>
  96. <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
  97. is a more restricted form of the canonical representation of dateTime
  98. http://www.w3.org/TR/xmlschema-2/#dateTime
  99. The trailing "Z" designates UTC time and is mandatory.
  100. Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
  101. All other components are mandatory.
  102. Expressions can also be used to denote calculations that should be
  103. performed relative to "NOW" to determine the value, ie...
  104. NOW/HOUR
  105. ... Round to the start of the current hour
  106. NOW-1DAY
  107. ... Exactly 1 day prior to now
  108. NOW/DAY+6MONTHS+3DAYS
  109. ... 6 months and 3 days in the future from the start of
  110. the current day
  111. Consult the TrieDateField javadocs for more information.
  112. Note: For faster range queries, consider the tdate type
  113. -->
  114. <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0" sortMissingLast="true" omitNorms="true"/>
  115. <!-- A Trie based date field for faster date range queries and date faceting. -->
  116. <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
  117. <!-- solr.TextField allows the specification of custom text analyzers
  118. specified as a tokenizer and a list of token filters. Different
  119. analyzers may be specified for indexing and querying.
  120. The optional positionIncrementGap puts space between multiple fields of
  121. this type on the same document, with the purpose of preventing false phrase
  122. matching across fields.
  123. For more info on customizing your analyzer chain, please see
  124. http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
  125. -->
  126. <!-- One can also specify an existing Analyzer class that has a
  127. default constructor via the class attribute on the analyzer element
  128. <fieldType name="text_greek" class="solr.TextField">
  129. <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
  130. </fieldType>
  131. -->
  132. <!-- A text field that only splits on whitespace for exact matching of words -->
  133. <fieldType name="text_ws" class="solr.TextField" omitNorms="true" positionIncrementGap="100">
  134. <analyzer>
  135. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  136. <filter class="solr.LowerCaseFilterFactory"/>
  137. </analyzer>
  138. </fieldType>
  139. <!-- A text field that uses WordDelimiterFilter to enable splitting and matching of
  140. words on case-change, alpha numeric boundaries, and non-alphanumeric chars,
  141. so that a query of "wifi" or "wi fi" could match a document containing "Wi-Fi".
  142. Synonyms and stopwords are customized by external files, and stemming is enabled.
  143. Duplicate tokens at the same position (which may result from Stemmed Synonyms or
  144. WordDelim parts) are removed.
  145. -->
  146. <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
  147. <analyzer type="index">
  148. <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
  149. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  150. <!-- in this example, we will only use synonyms at query time
  151. <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  152. -->
  153. <!-- Case insensitive stop word removal. -->
  154. <filter class="solr.StopFilterFactory"
  155. ignoreCase="true"
  156. words="stopwords.txt"
  157. />
  158. <filter class="solr.WordDelimiterFilterFactory"
  159. protected="protwords.txt"
  160. generateWordParts="1"
  161. generateNumberParts="1"
  162. catenateWords="1"
  163. catenateNumbers="1"
  164. catenateAll="0"
  165. splitOnCaseChange="0"
  166. preserveOriginal="1"/>
  167. <filter class="solr.LengthFilterFactory" min="2" max="100" />
  168. <filter class="solr.LowerCaseFilterFactory"/>
  169. <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
  170. <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
  171. </analyzer>
  172. <analyzer type="query">
  173. <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
  174. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  175. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  176. <filter class="solr.StopFilterFactory"
  177. ignoreCase="true"
  178. words="stopwords.txt"
  179. />
  180. <filter class="solr.WordDelimiterFilterFactory"
  181. protected="protwords.txt"
  182. generateWordParts="1"
  183. generateNumberParts="1"
  184. catenateWords="0"
  185. catenateNumbers="0"
  186. catenateAll="0"
  187. splitOnCaseChange="0"
  188. preserveOriginal="1"/>
  189. <filter class="solr.LengthFilterFactory" min="2" max="100" />
  190. <filter class="solr.LowerCaseFilterFactory"/>
  191. <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
  192. <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
  193. </analyzer>
  194. <analyzer type="multiterm">
  195. <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
  196. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  197. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  198. <filter class="solr.StopFilterFactory"
  199. ignoreCase="true"
  200. words="stopwords.txt"
  201. />
  202. <filter class="solr.WordDelimiterFilterFactory"
  203. protected="protwords.txt"
  204. generateWordParts="1"
  205. generateNumberParts="1"
  206. catenateWords="0"
  207. catenateNumbers="0"
  208. catenateAll="0"
  209. splitOnCaseChange="1"
  210. preserveOriginal="1"/>
  211. <filter class="solr.LengthFilterFactory" min="2" max="100" />
  212. <filter class="solr.LowerCaseFilterFactory"/>
  213. <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
  214. <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
  215. </analyzer>
  216. </fieldType>
  217. <!-- An unstemmed text field - good if one does not know the language of the field -->
  218. <fieldType name="text_und" class="solr.TextField" positionIncrementGap="100">
  219. <analyzer type="index">
  220. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  221. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  222. <filter class="solr.WordDelimiterFilterFactory"
  223. protected="protwords.txt"
  224. generateWordParts="1"
  225. generateNumberParts="1"
  226. catenateWords="1"
  227. catenateNumbers="1"
  228. catenateAll="0"
  229. splitOnCaseChange="0"/>
  230. <filter class="solr.LengthFilterFactory" min="2" max="100" />
  231. <filter class="solr.LowerCaseFilterFactory"/>
  232. </analyzer>
  233. <analyzer type="query">
  234. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  235. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  236. <filter class="solr.StopFilterFactory"
  237. ignoreCase="true"
  238. words="stopwords.txt"
  239. />
  240. <filter class="solr.WordDelimiterFilterFactory"
  241. protected="protwords.txt"
  242. generateWordParts="1"
  243. generateNumberParts="1"
  244. catenateWords="0"
  245. catenateNumbers="0"
  246. catenateAll="0"
  247. splitOnCaseChange="0"/>
  248. <filter class="solr.LengthFilterFactory" min="2" max="100" />
  249. <filter class="solr.LowerCaseFilterFactory"/>
  250. </analyzer>
  251. <analyzer type="multiterm">
  252. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  253. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  254. <filter class="solr.StopFilterFactory"
  255. ignoreCase="true"
  256. words="stopwords.txt"
  257. />
  258. <filter class="solr.WordDelimiterFilterFactory"
  259. protected="protwords.txt"
  260. generateWordParts="1"
  261. generateNumberParts="1"
  262. catenateWords="0"
  263. catenateNumbers="0"
  264. catenateAll="0"
  265. splitOnCaseChange="0"/>
  266. <filter class="solr.LengthFilterFactory" min="2" max="100" />
  267. <filter class="solr.LowerCaseFilterFactory"/>
  268. </analyzer>
  269. </fieldType>
  270. <!-- Edge N gram type - for example for matching against queries with results
  271. KeywordTokenizer leaves input string intact as a single term.
  272. see: http://www.lucidimagination.com/blog/2009/09/08/auto-suggest-from-popular-queries-using-edgengrams/
  273. -->
  274. <fieldType name="edge_n2_kw_text" class="solr.TextField" omitNorms="true" positionIncrementGap="100">
  275. <analyzer type="index">
  276. <tokenizer class="solr.KeywordTokenizerFactory"/>
  277. <filter class="solr.LowerCaseFilterFactory"/>
  278. <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="25" />
  279. </analyzer>
  280. <analyzer type="query">
  281. <tokenizer class="solr.KeywordTokenizerFactory"/>
  282. <filter class="solr.LowerCaseFilterFactory"/>
  283. </analyzer>
  284. </fieldType>
  285. <!-- Setup simple analysis for spell checking -->
  286. <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100">
  287. <analyzer>
  288. <tokenizer class="solr.StandardTokenizerFactory" />
  289. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
  290. <filter class="solr.LengthFilterFactory" min="4" max="20" />
  291. <filter class="solr.LowerCaseFilterFactory" />
  292. <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
  293. </analyzer>
  294. </fieldType>
  295. <!-- This is an example of using the KeywordTokenizer along
  296. With various TokenFilterFactories to produce a sortable field
  297. that does not include some properties of the source text
  298. -->
  299. <fieldType name="sortString" class="solr.TextField" sortMissingLast="true" omitNorms="true">
  300. <analyzer>
  301. <!-- KeywordTokenizer does no actual tokenizing, so the entire
  302. input string is preserved as a single token
  303. -->
  304. <tokenizer class="solr.KeywordTokenizerFactory"/>
  305. <!-- The LowerCase TokenFilter does what you expect, which can be
  306. when you want your sorting to be case insensitive
  307. -->
  308. <filter class="solr.LowerCaseFilterFactory" />
  309. <!-- The TrimFilter removes any leading or trailing whitespace -->
  310. <filter class="solr.TrimFilterFactory" />
  311. <!-- The PatternReplaceFilter gives you the flexibility to use
  312. Java Regular expression to replace any sequence of characters
  313. matching a pattern with an arbitrary replacement string,
  314. which may include back refrences to portions of the orriginal
  315. string matched by the pattern.
  316. See the Java Regular Expression documentation for more
  317. infomation on pattern and replacement string syntax.
  318. http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
  319. <filter class="solr.PatternReplaceFilterFactory"
  320. pattern="(^\p{Punct}+)" replacement="" replace="all"
  321. />
  322. -->
  323. </analyzer>
  324. </fieldType>
  325. <!-- The "RandomSortField" is not used to store or search any
  326. data. You can declare fields of this type it in your schema
  327. to generate pseudo-random orderings of your docs for sorting
  328. or function purposes. The ordering is generated based on the field
  329. name and the version of the index. As long as the index version
  330. remains unchanged, and the same field name is reused,
  331. the ordering of the docs will be consistent.
  332. If you want different psuedo-random orderings of documents,
  333. for the same version of the index, use a dynamicField and
  334. change the field name in the request.
  335. -->
  336. <fieldType name="rand" class="solr.RandomSortField" indexed="true" />
  337. <!-- Fulltext type for matching words based on how they sound – i.e.,
  338. "phonetic matching".
  339. -->
  340. <fieldType name="phonetic" class="solr.TextField" >
  341. <analyzer>
  342. <tokenizer class="solr.StandardTokenizerFactory"/>
  343. <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
  344. </analyzer>
  345. </fieldType>
  346. <!-- since fields of this type are by default not stored or indexed,
  347. any data added to them will be ignored outright. -->
  348. <fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
  349. <!-- This point type indexes the coordinates as separate fields (subFields)
  350. If subFieldType is defined, it references a type, and a dynamic field
  351. definition is created matching *___<typename>. Alternately, if
  352. subFieldSuffix is defined, that is used to create the subFields.
  353. Example: if subFieldType="double", then the coordinates would be
  354. indexed in fields myloc_0___double,myloc_1___double.
  355. Example: if subFieldSuffix="_d" then the coordinates would be indexed
  356. in fields myloc_0_d,myloc_1_d
  357. The subFields are an implementation detail of the fieldType, and end
  358. users normally should not need to know about them.
  359. -->
  360. <fieldType name="point" class="solr.PointType" dimension="2" subFieldType="tdouble"/>
  361. <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
  362. <fieldType name="location" class="solr.LatLonType" subFieldType="tdouble"/>
  363. <!-- A Geohash is a compact representation of a latitude longitude pair in a single field.
  364. See http://wiki.apache.org/solr/SpatialSearch
  365. -->
  366. <fieldtype name="geohash" class="solr.GeoHashField"/>
  367. <!-- Improved location type which supports advanced functionality like
  368. filtering by polygons or other shapes, indexing shapes, multi-valued
  369. fields, etc.
  370. -->
  371. <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
  372. geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
  373. <!-- Spatial rectangle (bounding box) field. It supports most spatial predicates, and has
  374. special relevancy modes: score=overlapRatio|area|area2D (local-param to the query). DocValues is recommended for
  375. relevancy. -->
  376. <fieldType name="bbox" class="solr.BBoxField"
  377. geo="true" distanceUnits="kilometers" numberType="_bbox_coord" />
  378. <fieldType name="_bbox_coord" class="solr.TrieDoubleField" precisionStep="8" docValues="true" stored="false"/>
  379. </types>
  380. <!-- Following is a dynamic way to include other types, added by other contrib modules -->
  381. <xi:include href="schema_extra_types.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
  382. <xi:fallback></xi:fallback>
  383. </xi:include>
  384. <!-- Valid attributes for fields:
  385. name: mandatory - the name for the field
  386. type: mandatory - the name of a field type from the <types> fieldType
  387. section
  388. indexed: true if this field should be indexed (searchable or sortable)
  389. stored: true if this field should be retrievable
  390. docValues: true if this field should have doc values. Doc values are
  391. useful for faceting, grouping, sorting and function queries. Although not
  392. required, doc values will make the index faster to load, more
  393. NRT-friendly and more memory-efficient. They however come with some
  394. limitations: they are currently only supported by StrField, UUIDField
  395. and all Trie*Fields, and depending on the field type, they might
  396. require the field to be single-valued, be required or have a default
  397. value (check the documentation of the field type you're interested in
  398. for more information)
  399. multiValued: true if this field may contain multiple values per document
  400. omitNorms: (expert) set to true to omit the norms associated with
  401. this field (this disables length normalization and index-time
  402. boosting for the field, and saves some memory). Only full-text
  403. fields or fields that need an index-time boost need norms.
  404. Norms are omitted for primitive (non-analyzed) types by default.
  405. termVectors: [false] set to true to store the term vector for a
  406. given field.
  407. When using MoreLikeThis, fields used for similarity should be
  408. stored for best performance.
  409. termPositions: Store position information with the term vector.
  410. This will increase storage costs.
  411. termOffsets: Store offset information with the term vector. This
  412. will increase storage costs.
  413. required: The field is required. It will throw an error if the
  414. value does not exist
  415. default: a value that should be used if no value is specified
  416. when adding a document.
  417. -->
  418. <fields>
  419. <!-- The document id is usually derived from a site-spcific key (hash) and the
  420. entity type and ID like:
  421. Search Api :
  422. The format used is $document->id = $index_id . '-' . $item_id
  423. Apache Solr Search Integration
  424. The format used is $document->id = $site_hash . '/' . $entity_type . '/' . $entity->id;
  425. -->
  426. <field name="id" type="string" indexed="true" stored="true" required="true" />
  427. <!-- Add Solr Cloud version field as mentioned in
  428. http://wiki.apache.org/solr/SolrCloud#Required_Config
  429. -->
  430. <field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
  431. <!-- Search Api specific fields -->
  432. <!-- item_id contains the entity ID, e.g. a node's nid. -->
  433. <field name="item_id" type="string" indexed="true" stored="true" />
  434. <!-- index_id is the machine name of the search index this entry belongs to. -->
  435. <field name="index_id" type="string" indexed="true" stored="true" />
  436. <!-- copyField commands copy one field to another at the time a document
  437. is added to the index. It's used either to index the same field differently,
  438. or to add multiple fields to the same field for easier/faster searching. -->
  439. <!-- Since sorting by ID is explicitly allowed, store item_id also in a sortable way. -->
  440. <copyField source="item_id" dest="sort_search_api_id" />
  441. <!-- Apache Solr Search Integration specific fields -->
  442. <!-- entity_id is the numeric object ID, e.g. Node ID, File ID -->
  443. <field name="entity_id" type="long" indexed="true" stored="true" />
  444. <!-- entity_type is 'node', 'file', 'user', or some other Drupal object type -->
  445. <field name="entity_type" type="string" indexed="true" stored="true" />
  446. <!-- bundle is a node type, or as appropriate for other entity types -->
  447. <field name="bundle" type="string" indexed="true" stored="true"/>
  448. <field name="bundle_name" type="string" indexed="true" stored="true"/>
  449. <field name="site" type="string" indexed="true" stored="true"/>
  450. <field name="hash" type="string" indexed="true" stored="true"/>
  451. <field name="url" type="string" indexed="true" stored="true"/>
  452. <!-- label is the default field for a human-readable string for this entity (e.g. the title of a node) -->
  453. <field name="label" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true"/>
  454. <!-- The string version of the title is used for sorting -->
  455. <copyField source="label" dest="sort_label"/>
  456. <!-- content is the default field for full text search - dump crap here -->
  457. <field name="content" type="text" indexed="true" stored="true" termVectors="true"/>
  458. <field name="teaser" type="text" indexed="false" stored="true"/>
  459. <field name="path" type="string" indexed="true" stored="true"/>
  460. <field name="path_alias" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true"/>
  461. <!-- These are the fields that correspond to a Drupal node. The beauty of having
  462. Lucene store title, body, type, etc., is that we retrieve them with the search
  463. result set and don't need to go to the database with a node_load. -->
  464. <field name="tid" type="long" indexed="true" stored="true" multiValued="true"/>
  465. <field name="taxonomy_names" type="text" indexed="true" stored="false" termVectors="true" multiValued="true" omitNorms="true"/>
  466. <!-- Copy terms to a single field that contains all taxonomy term names -->
  467. <copyField source="tm_vid_*" dest="taxonomy_names"/>
  468. <!-- Here, default is used to create a "timestamp" field indicating
  469. when each document was indexed.-->
  470. <field name="timestamp" type="tdate" indexed="true" stored="true" default="NOW" multiValued="false"/>
  471. <!-- This field is used to build the spellchecker index -->
  472. <field name="spell" type="textSpell" indexed="true" stored="true" multiValued="true"/>
  473. <!-- copyField commands copy one field to another at the time a document
  474. is added to the index. It's used either to index the same field differently,
  475. or to add multiple fields to the same field for easier/faster searching. -->
  476. <copyField source="label" dest="spell"/>
  477. <copyField source="content" dest="spell"/>
  478. <copyField source="ts_*" dest="spell"/>
  479. <copyField source="tm_*" dest="spell"/>
  480. <!-- Dynamic field definitions. If a field name is not found, dynamicFields
  481. will be used if the name matches any of the patterns.
  482. RESTRICTION: the glob-like pattern in the name attribute must have
  483. a "*" only at the start or the end.
  484. EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
  485. Longer patterns will be matched first. if equal size patterns
  486. both match, the first appearing in the schema will be used. -->
  487. <!-- A set of fields to contain text extracted from HTML tag contents which we
  488. can boost at query time. -->
  489. <dynamicField name="tags_*" type="text" indexed="true" stored="false" omitNorms="true"/>
  490. <!-- For 2 and 3 letter prefix dynamic fields, the 1st letter indicates the data type and
  491. the last letter is 's' for single valued, 'm' for multi-valued -->
  492. <!-- We use long for integer since 64 bit ints are now common in PHP. -->
  493. <dynamicField name="is_*" type="long" indexed="true" stored="true" multiValued="false"/>
  494. <dynamicField name="im_*" type="long" indexed="true" stored="true" multiValued="true"/>
  495. <!-- List of floats can be saved in a regular float field -->
  496. <dynamicField name="fs_*" type="float" indexed="true" stored="true" multiValued="false"/>
  497. <dynamicField name="fm_*" type="float" indexed="true" stored="true" multiValued="true"/>
  498. <!-- List of doubles can be saved in a regular double field -->
  499. <dynamicField name="ps_*" type="double" indexed="true" stored="true" multiValued="false"/>
  500. <dynamicField name="pm_*" type="double" indexed="true" stored="true" multiValued="true"/>
  501. <!-- List of booleans can be saved in a regular boolean field -->
  502. <dynamicField name="bm_*" type="boolean" indexed="true" stored="true" multiValued="true"/>
  503. <dynamicField name="bs_*" type="boolean" indexed="true" stored="true" multiValued="false"/>
  504. <!-- Regular text (without processing) can be stored in a string field-->
  505. <dynamicField name="ss_*" type="string" indexed="true" stored="true" multiValued="false"/>
  506. <dynamicField name="sm_*" type="string" indexed="true" stored="true" multiValued="true"/>
  507. <!-- Normal text fields are for full text - the relevance of a match depends on the length of the text -->
  508. <dynamicField name="ts_*" type="text" indexed="true" stored="true" multiValued="false" termVectors="true"/>
  509. <dynamicField name="tm_*" type="text" indexed="true" stored="true" multiValued="true" termVectors="true"/>
  510. <!-- Unstemmed text fields for full text - the relevance of a match depends on the length of the text -->
  511. <dynamicField name="tus_*" type="text_und" indexed="true" stored="true" multiValued="false" termVectors="true"/>
  512. <dynamicField name="tum_*" type="text_und" indexed="true" stored="true" multiValued="true" termVectors="true"/>
  513. <!-- These text fields omit norms - useful for extracted text like taxonomy_names -->
  514. <dynamicField name="tos_*" type="text" indexed="true" stored="true" multiValued="false" termVectors="true" omitNorms="true"/>
  515. <dynamicField name="tom_*" type="text" indexed="true" stored="true" multiValued="true" termVectors="true" omitNorms="true"/>
  516. <!-- Special-purpose text fields -->
  517. <dynamicField name="tes_*" type="edge_n2_kw_text" indexed="true" stored="true" multiValued="false" omitTermFreqAndPositions="true" />
  518. <dynamicField name="tem_*" type="edge_n2_kw_text" indexed="true" stored="true" multiValued="true" omitTermFreqAndPositions="true" />
  519. <dynamicField name="tws_*" type="text_ws" indexed="true" stored="true" multiValued="false"/>
  520. <dynamicField name="twm_*" type="text_ws" indexed="true" stored="true" multiValued="true"/>
  521. <!-- trie dates are preferred, so give them the 2 letter prefix -->
  522. <dynamicField name="ds_*" type="tdate" indexed="true" stored="true" multiValued="false"/>
  523. <dynamicField name="dm_*" type="tdate" indexed="true" stored="true" multiValued="true"/>
  524. <dynamicField name="its_*" type="tlong" indexed="true" stored="true" multiValued="false"/>
  525. <dynamicField name="itm_*" type="tlong" indexed="true" stored="true" multiValued="true"/>
  526. <dynamicField name="fts_*" type="tfloat" indexed="true" stored="true" multiValued="false"/>
  527. <dynamicField name="ftm_*" type="tfloat" indexed="true" stored="true" multiValued="true"/>
  528. <dynamicField name="pts_*" type="tdouble" indexed="true" stored="true" multiValued="false"/>
  529. <dynamicField name="ptm_*" type="tdouble" indexed="true" stored="true" multiValued="true"/>
  530. <!-- Binary fields can be populated using base64 encoded data. Useful e.g. for embedding
  531. a small image in a search result using the data URI scheme -->
  532. <dynamicField name="xs_*" type="binary" indexed="false" stored="true" multiValued="false"/>
  533. <dynamicField name="xm_*" type="binary" indexed="false" stored="true" multiValued="true"/>
  534. <!-- In rare cases a date rather than tdate is needed for sortMissingLast -->
  535. <dynamicField name="dds_*" type="date" indexed="true" stored="true" multiValued="false"/>
  536. <dynamicField name="ddm_*" type="date" indexed="true" stored="true" multiValued="true"/>
  537. <!-- Sortable fields, good for sortMissingLast support &
  538. We use long for integer since 64 bit ints are now common in PHP. -->
  539. <dynamicField name="iss_*" type="slong" indexed="true" stored="true" multiValued="false"/>
  540. <dynamicField name="ism_*" type="slong" indexed="true" stored="true" multiValued="true"/>
  541. <!-- In rare cases a sfloat rather than tfloat is needed for sortMissingLast -->
  542. <dynamicField name="fss_*" type="sfloat" indexed="true" stored="true" multiValued="false"/>
  543. <dynamicField name="fsm_*" type="sfloat" indexed="true" stored="true" multiValued="true"/>
  544. <dynamicField name="pss_*" type="sdouble" indexed="true" stored="true" multiValued="false"/>
  545. <dynamicField name="psm_*" type="sdouble" indexed="true" stored="true" multiValued="true"/>
  546. <!-- In case a 32 bit int is really needed, we provide these fields. 'h' is mnemonic for 'half word', i.e. 32 bit on 64 arch -->
  547. <dynamicField name="hs_*" type="integer" indexed="true" stored="true" multiValued="false"/>
  548. <dynamicField name="hm_*" type="integer" indexed="true" stored="true" multiValued="true"/>
  549. <dynamicField name="hss_*" type="sint" indexed="true" stored="true" multiValued="false"/>
  550. <dynamicField name="hsm_*" type="sint" indexed="true" stored="true" multiValued="true"/>
  551. <dynamicField name="hts_*" type="tint" indexed="true" stored="true" multiValued="false"/>
  552. <dynamicField name="htm_*" type="tint" indexed="true" stored="true" multiValued="true"/>
  553. <!-- Unindexed string fields that can be used to store values that won't be searchable -->
  554. <dynamicField name="zs_*" type="string" indexed="false" stored="true" multiValued="false"/>
  555. <dynamicField name="zm_*" type="string" indexed="false" stored="true" multiValued="true"/>
  556. <!-- Fields for location searches.
  557. http://wiki.apache.org/solr/SpatialSearch#geodist_-_The_distance_function -->
  558. <dynamicField name="points_*" type="point" indexed="true" stored="true" multiValued="false"/>
  559. <dynamicField name="pointm_*" type="point" indexed="true" stored="true" multiValued="true"/>
  560. <dynamicField name="locs_*" type="location" indexed="true" stored="true" multiValued="false"/>
  561. <dynamicField name="locm_*" type="location" indexed="true" stored="true" multiValued="true"/>
  562. <dynamicField name="geos_*" type="geohash" indexed="true" stored="true" multiValued="false"/>
  563. <dynamicField name="geom_*" type="geohash" indexed="true" stored="true" multiValued="true"/>
  564. <dynamicField name="bboxs_*" type="bbox" indexed="true" stored="true" multiValued="false" />
  565. <dynamicField name="bboxm_*" type="bbox" indexed="true" stored="true" multiValued="true" />
  566. <dynamicField name="rpts_*" type="location_rpt" indexed="true" stored="true" multiValued="false" />
  567. <dynamicField name="rptm_*" type="location_rpt" indexed="true" stored="true" multiValued="true" />
  568. <!-- Special fields for Solr 5 functionality. -->
  569. <dynamicField name="phons_*" type="phonetic" indexed="true" stored="true" multiValued="false" />
  570. <dynamicField name="phonm_*" type="phonetic" indexed="true" stored="true" multiValued="true" />
  571. <!-- External file fields -->
  572. <dynamicField name="eff_*" type="file"/>
  573. <!-- Sortable version of the dynamic string field -->
  574. <dynamicField name="sort_*" type="sortString" indexed="true" stored="false"/>
  575. <copyField source="ss_*" dest="sort_*"/>
  576. <!-- A random sort field -->
  577. <dynamicField name="random_*" type="rand" indexed="true" stored="true"/>
  578. <!-- This field is used to store access information (e.g. node access grants), as opposed to field data -->
  579. <dynamicField name="access_*" type="integer" indexed="true" stored="false" multiValued="true"/>
  580. <!-- The following causes solr to ignore any fields that don't already match an existing
  581. field name or dynamic field, rather than reporting them as an error.
  582. Alternately, change the type="ignored" to some other type e.g. "text" if you want
  583. unknown fields indexed and/or stored by default -->
  584. <dynamicField name="*" type="ignored" multiValued="true" />
  585. </fields>
  586. <!-- Following is a dynamic way to include other fields, added by other contrib modules -->
  587. <xi:include href="schema_extra_fields.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
  588. <xi:fallback></xi:fallback>
  589. </xi:include>
  590. <!-- Field to use to determine and enforce document uniqueness.
  591. Unless this field is marked with required="false", it will be a required field
  592. -->
  593. <uniqueKey>id</uniqueKey>
  594. <!-- Similarity is the scoring routine for each document vs. a query.
  595. A custom Similarity or SimilarityFactory may be specified here, but
  596. the default is fine for most applications.
  597. For more info: http://wiki.apache.org/solr/SchemaXml#Similarity
  598. -->
  599. <!--
  600. <similarity class="com.example.solr.CustomSimilarityFactory">
  601. <str name="paramkey">param value</str>
  602. </similarity>
  603. -->
  604. <!-- DEPRECATED: The defaultSearchField is consulted by various query parsers
  605. when parsing a query string that isn't explicit about the field. Machine
  606. (non-user) generated queries are best made explicit, or they can use the
  607. "df" request parameter which takes precedence over this.
  608. Note: Un-commenting defaultSearchField will be insufficient if your request
  609. handler in solrconfig.xml defines "df", which takes precedence. That would
  610. need to be removed.
  611. <defaultSearchField>content</defaultSearchField> -->
  612. <!-- DEPRECATED: The defaultOperator (AND|OR) is consulted by various query
  613. parsers when parsing a query string to determine if a clause of the query
  614. should be marked as required or optional, assuming the clause isn't already
  615. marked by some operator. The default is OR, which is generally assumed so it
  616. is not a good idea to change it globally here. The "q.op" request parameter
  617. takes precedence over this.
  618. <solrQueryParser defaultOperator="OR"/> -->
  619. </schema>