schema.xml 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  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="1"
  165. splitOnCaseChange="1"
  166. preserveOriginal="1"/>
  167. <filter class="solr.LengthFilterFactory" min="1" 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="1"
  185. catenateNumbers="1"
  186. catenateAll="1"
  187. splitOnCaseChange="1"
  188. preserveOriginal="1"/>
  189. <filter class="solr.LengthFilterFactory" min="1" 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="1"
  207. catenateNumbers="1"
  208. catenateAll="1"
  209. splitOnCaseChange="1"
  210. preserveOriginal="1"/>
  211. <filter class="solr.LengthFilterFactory" min="1" 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="1"
  229. splitOnCaseChange="1"/>
  230. <filter class="solr.LengthFilterFactory" min="1" 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="1"
  245. catenateNumbers="1"
  246. catenateAll="1"
  247. splitOnCaseChange="1"/>
  248. <filter class="solr.LengthFilterFactory" min="1" 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="1"
  263. catenateNumbers="1"
  264. catenateAll="1"
  265. splitOnCaseChange="1"/>
  266. <filter class="solr.LengthFilterFactory" min="1" 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. <!-- [MATERIO] Added custom Edge N gram Type with MappingCharFilterFactory to remove accent
  286. see materio_search_api_search_api_data_type_info() in materio_search_api.module
  287. purpose is to get the following feature :
  288. "be" give béton and bettrave
  289. BUT "bé" give only béton and NOT betterave
  290. -->
  291. <fieldType name="edge_n2_kw_mapped_text" class="solr.TextField" omitNorms="true" positionIncrementGap="100">
  292. <analyzer type="index">
  293. <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
  294. <tokenizer class="solr.KeywordTokenizerFactory"/>
  295. <filter class="solr.LowerCaseFilterFactory"/>
  296. <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="25" />
  297. </analyzer>
  298. <analyzer type="query">
  299. <tokenizer class="solr.KeywordTokenizerFactory"/>
  300. <filter class="solr.LowerCaseFilterFactory"/>
  301. </analyzer>
  302. </fieldType>
  303. <!-- Setup simple analysis for spell checking -->
  304. <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100">
  305. <analyzer>
  306. <tokenizer class="solr.StandardTokenizerFactory" />
  307. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
  308. <filter class="solr.LengthFilterFactory" min="4" max="20" />
  309. <filter class="solr.LowerCaseFilterFactory" />
  310. <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
  311. </analyzer>
  312. </fieldType>
  313. <!-- This is an example of using the KeywordTokenizer along
  314. With various TokenFilterFactories to produce a sortable field
  315. that does not include some properties of the source text
  316. -->
  317. <fieldType name="sortString" class="solr.TextField" sortMissingLast="true" omitNorms="true">
  318. <analyzer>
  319. <!-- KeywordTokenizer does no actual tokenizing, so the entire
  320. input string is preserved as a single token
  321. -->
  322. <tokenizer class="solr.KeywordTokenizerFactory"/>
  323. <!-- The LowerCase TokenFilter does what you expect, which can be
  324. when you want your sorting to be case insensitive
  325. -->
  326. <filter class="solr.LowerCaseFilterFactory" />
  327. <!-- The TrimFilter removes any leading or trailing whitespace -->
  328. <filter class="solr.TrimFilterFactory" />
  329. <!-- The PatternReplaceFilter gives you the flexibility to use
  330. Java Regular expression to replace any sequence of characters
  331. matching a pattern with an arbitrary replacement string,
  332. which may include back refrences to portions of the orriginal
  333. string matched by the pattern.
  334. See the Java Regular Expression documentation for more
  335. infomation on pattern and replacement string syntax.
  336. http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
  337. <filter class="solr.PatternReplaceFilterFactory"
  338. pattern="(^\p{Punct}+)" replacement="" replace="all"
  339. />
  340. -->
  341. </analyzer>
  342. </fieldType>
  343. <!-- The "RandomSortField" is not used to store or search any
  344. data. You can declare fields of this type it in your schema
  345. to generate pseudo-random orderings of your docs for sorting
  346. or function purposes. The ordering is generated based on the field
  347. name and the version of the index. As long as the index version
  348. remains unchanged, and the same field name is reused,
  349. the ordering of the docs will be consistent.
  350. If you want different psuedo-random orderings of documents,
  351. for the same version of the index, use a dynamicField and
  352. change the field name in the request.
  353. -->
  354. <fieldType name="rand" class="solr.RandomSortField" indexed="true" />
  355. <!-- Fulltext type for matching words based on how they sound – i.e.,
  356. "phonetic matching".
  357. -->
  358. <fieldType name="phonetic" class="solr.TextField" >
  359. <analyzer>
  360. <tokenizer class="solr.StandardTokenizerFactory"/>
  361. <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
  362. </analyzer>
  363. </fieldType>
  364. <!-- since fields of this type are by default not stored or indexed,
  365. any data added to them will be ignored outright. -->
  366. <fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
  367. <!-- This point type indexes the coordinates as separate fields (subFields)
  368. If subFieldType is defined, it references a type, and a dynamic field
  369. definition is created matching *___<typename>. Alternately, if
  370. subFieldSuffix is defined, that is used to create the subFields.
  371. Example: if subFieldType="double", then the coordinates would be
  372. indexed in fields myloc_0___double,myloc_1___double.
  373. Example: if subFieldSuffix="_d" then the coordinates would be indexed
  374. in fields myloc_0_d,myloc_1_d
  375. The subFields are an implementation detail of the fieldType, and end
  376. users normally should not need to know about them.
  377. -->
  378. <fieldType name="point" class="solr.PointType" dimension="2" subFieldType="tdouble"/>
  379. <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
  380. <fieldType name="location" class="solr.LatLonType" subFieldType="tdouble"/>
  381. <!-- A Geohash is a compact representation of a latitude longitude pair in a single field.
  382. See http://wiki.apache.org/solr/SpatialSearch
  383. -->
  384. <fieldtype name="geohash" class="solr.GeoHashField"/>
  385. <!-- Improved location type which supports advanced functionality like
  386. filtering by polygons or other shapes, indexing shapes, multi-valued
  387. fields, etc.
  388. -->
  389. <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
  390. geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
  391. <!-- Spatial rectangle (bounding box) field. It supports most spatial predicates, and has
  392. special relevancy modes: score=overlapRatio|area|area2D (local-param to the query). DocValues is recommended for
  393. relevancy. -->
  394. <fieldType name="bbox" class="solr.BBoxField"
  395. geo="true" distanceUnits="kilometers" numberType="_bbox_coord" />
  396. <fieldType name="_bbox_coord" class="solr.TrieDoubleField" precisionStep="8" docValues="true" stored="false"/>
  397. </types>
  398. <!-- Following is a dynamic way to include other types, added by other contrib modules -->
  399. <xi:include href="schema_extra_types.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
  400. <xi:fallback></xi:fallback>
  401. </xi:include>
  402. <!-- Valid attributes for fields:
  403. name: mandatory - the name for the field
  404. type: mandatory - the name of a field type from the <types> fieldType
  405. section
  406. indexed: true if this field should be indexed (searchable or sortable)
  407. stored: true if this field should be retrievable
  408. docValues: true if this field should have doc values. Doc values are
  409. useful for faceting, grouping, sorting and function queries. Although not
  410. required, doc values will make the index faster to load, more
  411. NRT-friendly and more memory-efficient. They however come with some
  412. limitations: they are currently only supported by StrField, UUIDField
  413. and all Trie*Fields, and depending on the field type, they might
  414. require the field to be single-valued, be required or have a default
  415. value (check the documentation of the field type you're interested in
  416. for more information)
  417. multiValued: true if this field may contain multiple values per document
  418. omitNorms: (expert) set to true to omit the norms associated with
  419. this field (this disables length normalization and index-time
  420. boosting for the field, and saves some memory). Only full-text
  421. fields or fields that need an index-time boost need norms.
  422. Norms are omitted for primitive (non-analyzed) types by default.
  423. termVectors: [false] set to true to store the term vector for a
  424. given field.
  425. When using MoreLikeThis, fields used for similarity should be
  426. stored for best performance.
  427. termPositions: Store position information with the term vector.
  428. This will increase storage costs.
  429. termOffsets: Store offset information with the term vector. This
  430. will increase storage costs.
  431. required: The field is required. It will throw an error if the
  432. value does not exist
  433. default: a value that should be used if no value is specified
  434. when adding a document.
  435. -->
  436. <fields>
  437. <!-- The document id is usually derived from a site-spcific key (hash) and the
  438. entity type and ID like:
  439. Search Api :
  440. The format used is $document->id = $index_id . '-' . $item_id
  441. Apache Solr Search Integration
  442. The format used is $document->id = $site_hash . '/' . $entity_type . '/' . $entity->id;
  443. -->
  444. <field name="id" type="string" indexed="true" stored="true" required="true" />
  445. <!-- Add Solr Cloud version field as mentioned in
  446. http://wiki.apache.org/solr/SolrCloud#Required_Config
  447. -->
  448. <field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
  449. <!-- Search Api specific fields -->
  450. <!-- item_id contains the entity ID, e.g. a node's nid. -->
  451. <field name="item_id" type="string" indexed="true" stored="true" />
  452. <!-- index_id is the machine name of the search index this entry belongs to. -->
  453. <field name="index_id" type="string" indexed="true" stored="true" />
  454. <!-- copyField commands copy one field to another at the time a document
  455. is added to the index. It's used either to index the same field differently,
  456. or to add multiple fields to the same field for easier/faster searching. -->
  457. <!-- Since sorting by ID is explicitly allowed, store item_id also in a sortable way. -->
  458. <copyField source="item_id" dest="sort_search_api_id" />
  459. <!-- Apache Solr Search Integration specific fields -->
  460. <!-- entity_id is the numeric object ID, e.g. Node ID, File ID -->
  461. <field name="entity_id" type="long" indexed="true" stored="true" />
  462. <!-- entity_type is 'node', 'file', 'user', or some other Drupal object type -->
  463. <field name="entity_type" type="string" indexed="true" stored="true" />
  464. <!-- bundle is a node type, or as appropriate for other entity types -->
  465. <field name="bundle" type="string" indexed="true" stored="true"/>
  466. <field name="bundle_name" type="string" indexed="true" stored="true"/>
  467. <field name="site" type="string" indexed="true" stored="true"/>
  468. <field name="hash" type="string" indexed="true" stored="true"/>
  469. <field name="url" type="string" indexed="true" stored="true"/>
  470. <!-- label is the default field for a human-readable string for this entity (e.g. the title of a node) -->
  471. <field name="label" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true"/>
  472. <!-- The string version of the title is used for sorting -->
  473. <copyField source="label" dest="sort_label"/>
  474. <!-- content is the default field for full text search - dump crap here -->
  475. <field name="content" type="text" indexed="true" stored="true" termVectors="true"/>
  476. <field name="teaser" type="text" indexed="false" stored="true"/>
  477. <field name="path" type="string" indexed="true" stored="true"/>
  478. <field name="path_alias" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true"/>
  479. <!-- These are the fields that correspond to a Drupal node. The beauty of having
  480. Lucene store title, body, type, etc., is that we retrieve them with the search
  481. result set and don't need to go to the database with a node_load. -->
  482. <field name="tid" type="long" indexed="true" stored="true" multiValued="true"/>
  483. <field name="taxonomy_names" type="text" indexed="true" stored="false" termVectors="true" multiValued="true" omitNorms="true"/>
  484. <!-- Copy terms to a single field that contains all taxonomy term names -->
  485. <copyField source="tm_vid_*" dest="taxonomy_names"/>
  486. <!-- Here, default is used to create a "timestamp" field indicating
  487. when each document was indexed.-->
  488. <field name="timestamp" type="tdate" indexed="true" stored="true" default="NOW" multiValued="false"/>
  489. <!-- This field is used to build the spellchecker index -->
  490. <field name="spell" type="textSpell" indexed="true" stored="true" multiValued="true"/>
  491. <!-- copyField commands copy one field to another at the time a document
  492. is added to the index. It's used either to index the same field differently,
  493. or to add multiple fields to the same field for easier/faster searching. -->
  494. <copyField source="label" dest="spell"/>
  495. <copyField source="content" dest="spell"/>
  496. <copyField source="ts_*" dest="spell"/>
  497. <copyField source="tm_*" dest="spell"/>
  498. <!-- Dynamic field definitions. If a field name is not found, dynamicFields
  499. will be used if the name matches any of the patterns.
  500. RESTRICTION: the glob-like pattern in the name attribute must have
  501. a "*" only at the start or the end.
  502. EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
  503. Longer patterns will be matched first. if equal size patterns
  504. both match, the first appearing in the schema will be used. -->
  505. <!-- A set of fields to contain text extracted from HTML tag contents which we
  506. can boost at query time. -->
  507. <dynamicField name="tags_*" type="text" indexed="true" stored="false" omitNorms="true"/>
  508. <!-- For 2 and 3 letter prefix dynamic fields, the 1st letter indicates the data type and
  509. the last letter is 's' for single valued, 'm' for multi-valued -->
  510. <!-- We use long for integer since 64 bit ints are now common in PHP. -->
  511. <dynamicField name="is_*" type="long" indexed="true" stored="true" multiValued="false"/>
  512. <dynamicField name="im_*" type="long" indexed="true" stored="true" multiValued="true"/>
  513. <!-- List of floats can be saved in a regular float field -->
  514. <dynamicField name="fs_*" type="float" indexed="true" stored="true" multiValued="false"/>
  515. <dynamicField name="fm_*" type="float" indexed="true" stored="true" multiValued="true"/>
  516. <!-- List of doubles can be saved in a regular double field -->
  517. <dynamicField name="ps_*" type="double" indexed="true" stored="true" multiValued="false"/>
  518. <dynamicField name="pm_*" type="double" indexed="true" stored="true" multiValued="true"/>
  519. <!-- List of booleans can be saved in a regular boolean field -->
  520. <dynamicField name="bm_*" type="boolean" indexed="true" stored="true" multiValued="true"/>
  521. <dynamicField name="bs_*" type="boolean" indexed="true" stored="true" multiValued="false"/>
  522. <!-- Regular text (without processing) can be stored in a string field-->
  523. <dynamicField name="ss_*" type="string" indexed="true" stored="true" multiValued="false"/>
  524. <dynamicField name="sm_*" type="string" indexed="true" stored="true" multiValued="true"/>
  525. <!-- Normal text fields are for full text - the relevance of a match depends on the length of the text -->
  526. <dynamicField name="ts_*" type="text" indexed="true" stored="true" multiValued="false" termVectors="true"/>
  527. <dynamicField name="tm_*" type="text" indexed="true" stored="true" multiValued="true" termVectors="true"/>
  528. <!-- Unstemmed text fields for full text - the relevance of a match depends on the length of the text -->
  529. <dynamicField name="tus_*" type="text_und" indexed="true" stored="true" multiValued="false" termVectors="true"/>
  530. <dynamicField name="tum_*" type="text_und" indexed="true" stored="true" multiValued="true" termVectors="true"/>
  531. <!-- These text fields omit norms - useful for extracted text like taxonomy_names -->
  532. <dynamicField name="tos_*" type="text" indexed="true" stored="true" multiValued="false" termVectors="true" omitNorms="true"/>
  533. <dynamicField name="tom_*" type="text" indexed="true" stored="true" multiValued="true" termVectors="true" omitNorms="true"/>
  534. <!-- Special-purpose text fields -->
  535. <dynamicField name="tes_*" type="edge_n2_kw_text" indexed="true" stored="true" multiValued="false" omitTermFreqAndPositions="true" />
  536. <dynamicField name="tem_*" type="edge_n2_kw_text" indexed="true" stored="true" multiValued="true" omitTermFreqAndPositions="true" />
  537. <!-- [materio] -->
  538. <dynamicField name="temmap_*" type="edge_n2_kw_mapped_text" indexed="true" stored="false" multiValued="true" omitTermFreqAndPositions="true" />
  539. <dynamicField name="tws_*" type="text_ws" indexed="true" stored="true" multiValued="false"/>
  540. <dynamicField name="twm_*" type="text_ws" indexed="true" stored="true" multiValued="true"/>
  541. <!-- trie dates are preferred, so give them the 2 letter prefix -->
  542. <dynamicField name="ds_*" type="tdate" indexed="true" stored="true" multiValued="false"/>
  543. <dynamicField name="dm_*" type="tdate" indexed="true" stored="true" multiValued="true"/>
  544. <dynamicField name="its_*" type="tlong" indexed="true" stored="true" multiValued="false"/>
  545. <dynamicField name="itm_*" type="tlong" indexed="true" stored="true" multiValued="true"/>
  546. <dynamicField name="fts_*" type="tfloat" indexed="true" stored="true" multiValued="false"/>
  547. <dynamicField name="ftm_*" type="tfloat" indexed="true" stored="true" multiValued="true"/>
  548. <dynamicField name="pts_*" type="tdouble" indexed="true" stored="true" multiValued="false"/>
  549. <dynamicField name="ptm_*" type="tdouble" indexed="true" stored="true" multiValued="true"/>
  550. <!-- Binary fields can be populated using base64 encoded data. Useful e.g. for embedding
  551. a small image in a search result using the data URI scheme -->
  552. <dynamicField name="xs_*" type="binary" indexed="false" stored="true" multiValued="false"/>
  553. <dynamicField name="xm_*" type="binary" indexed="false" stored="true" multiValued="true"/>
  554. <!-- In rare cases a date rather than tdate is needed for sortMissingLast -->
  555. <dynamicField name="dds_*" type="date" indexed="true" stored="true" multiValued="false"/>
  556. <dynamicField name="ddm_*" type="date" indexed="true" stored="true" multiValued="true"/>
  557. <!-- Sortable fields, good for sortMissingLast support &
  558. We use long for integer since 64 bit ints are now common in PHP. -->
  559. <dynamicField name="iss_*" type="slong" indexed="true" stored="true" multiValued="false"/>
  560. <dynamicField name="ism_*" type="slong" indexed="true" stored="true" multiValued="true"/>
  561. <!-- In rare cases a sfloat rather than tfloat is needed for sortMissingLast -->
  562. <dynamicField name="fss_*" type="sfloat" indexed="true" stored="true" multiValued="false"/>
  563. <dynamicField name="fsm_*" type="sfloat" indexed="true" stored="true" multiValued="true"/>
  564. <dynamicField name="pss_*" type="sdouble" indexed="true" stored="true" multiValued="false"/>
  565. <dynamicField name="psm_*" type="sdouble" indexed="true" stored="true" multiValued="true"/>
  566. <!-- 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 -->
  567. <dynamicField name="hs_*" type="integer" indexed="true" stored="true" multiValued="false"/>
  568. <dynamicField name="hm_*" type="integer" indexed="true" stored="true" multiValued="true"/>
  569. <dynamicField name="hss_*" type="sint" indexed="true" stored="true" multiValued="false"/>
  570. <dynamicField name="hsm_*" type="sint" indexed="true" stored="true" multiValued="true"/>
  571. <dynamicField name="hts_*" type="tint" indexed="true" stored="true" multiValued="false"/>
  572. <dynamicField name="htm_*" type="tint" indexed="true" stored="true" multiValued="true"/>
  573. <!-- Unindexed string fields that can be used to store values that won't be searchable -->
  574. <dynamicField name="zs_*" type="string" indexed="false" stored="true" multiValued="false"/>
  575. <dynamicField name="zm_*" type="string" indexed="false" stored="true" multiValued="true"/>
  576. <!-- Fields for location searches.
  577. http://wiki.apache.org/solr/SpatialSearch#geodist_-_The_distance_function -->
  578. <dynamicField name="points_*" type="point" indexed="true" stored="true" multiValued="false"/>
  579. <dynamicField name="pointm_*" type="point" indexed="true" stored="true" multiValued="true"/>
  580. <dynamicField name="locs_*" type="location" indexed="true" stored="true" multiValued="false"/>
  581. <dynamicField name="locm_*" type="location" indexed="true" stored="true" multiValued="true"/>
  582. <dynamicField name="geos_*" type="geohash" indexed="true" stored="true" multiValued="false"/>
  583. <dynamicField name="geom_*" type="geohash" indexed="true" stored="true" multiValued="true"/>
  584. <dynamicField name="bboxs_*" type="bbox" indexed="true" stored="true" multiValued="false" />
  585. <dynamicField name="bboxm_*" type="bbox" indexed="true" stored="true" multiValued="true" />
  586. <dynamicField name="rpts_*" type="location_rpt" indexed="true" stored="true" multiValued="false" />
  587. <dynamicField name="rptm_*" type="location_rpt" indexed="true" stored="true" multiValued="true" />
  588. <!-- Special fields for Solr 5 functionality. -->
  589. <dynamicField name="phons_*" type="phonetic" indexed="true" stored="true" multiValued="false" />
  590. <dynamicField name="phonm_*" type="phonetic" indexed="true" stored="true" multiValued="true" />
  591. <!-- External file fields -->
  592. <dynamicField name="eff_*" type="file"/>
  593. <!-- Sortable version of the dynamic string field -->
  594. <dynamicField name="sort_*" type="sortString" indexed="true" stored="false"/>
  595. <copyField source="ss_*" dest="sort_*"/>
  596. <!-- A random sort field -->
  597. <dynamicField name="random_*" type="rand" indexed="true" stored="true"/>
  598. <!-- This field is used to store access information (e.g. node access grants), as opposed to field data -->
  599. <dynamicField name="access_*" type="integer" indexed="true" stored="false" multiValued="true"/>
  600. <!-- The following causes solr to ignore any fields that don't already match an existing
  601. field name or dynamic field, rather than reporting them as an error.
  602. Alternately, change the type="ignored" to some other type e.g. "text" if you want
  603. unknown fields indexed and/or stored by default -->
  604. <dynamicField name="*" type="ignored" multiValued="true" />
  605. </fields>
  606. <!-- Following is a dynamic way to include other fields, added by other contrib modules -->
  607. <xi:include href="schema_extra_fields.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
  608. <xi:fallback></xi:fallback>
  609. </xi:include>
  610. <!-- Field to use to determine and enforce document uniqueness.
  611. Unless this field is marked with required="false", it will be a required field
  612. -->
  613. <uniqueKey>id</uniqueKey>
  614. <!-- Similarity is the scoring routine for each document vs. a query.
  615. A custom Similarity or SimilarityFactory may be specified here, but
  616. the default is fine for most applications.
  617. For more info: http://wiki.apache.org/solr/SchemaXml#Similarity
  618. -->
  619. <!--
  620. <similarity class="com.example.solr.CustomSimilarityFactory">
  621. <str name="paramkey">param value</str>
  622. </similarity>
  623. -->
  624. <!-- DEPRECATED: The defaultSearchField is consulted by various query parsers
  625. when parsing a query string that isn't explicit about the field. Machine
  626. (non-user) generated queries are best made explicit, or they can use the
  627. "df" request parameter which takes precedence over this.
  628. Note: Un-commenting defaultSearchField will be insufficient if your request
  629. handler in solrconfig.xml defines "df", which takes precedence. That would
  630. need to be removed.
  631. <defaultSearchField>content</defaultSearchField> -->
  632. <!-- DEPRECATED: The defaultOperator (AND|OR) is consulted by various query
  633. parsers when parsing a query string to determine if a clause of the query
  634. should be marked as required or optional, assuming the clause isn't already
  635. marked by some operator. The default is OR, which is generally assumed so it
  636. is not a good idea to change it globally here. The "q.op" request parameter
  637. takes precedence over this.
  638. <solrQueryParser defaultOperator="OR"/> -->
  639. </schema>