<types>
	<!--
		Field type definitions.

		The "name" attribute is just a label to be used by field definitions.
		The "class" attribute and any other attributes determine the real
		behavior of the fieldType.
			Class names starting with "meilisearch" refer to java classes in the
		org.apache.meilisearch.analysis package.

	-->

	<!-- The StrField type is not analyzed, but indexed/stored verbatim.
		- StrField and TextField support an optional compressThreshold which
		limits compression (if enabled in the derived fields) to values which
		exceed a certain size (in characters).
	-->
	<fieldType name="string"  class="meilisearch.StrField"  sortMissingLast="true" omitNorms="true" useDocValuesAsStored="false" />

	<!-- boolean type: "true" or "false" -->
	<fieldType name="boolean" class="meilisearch.BoolField" sortMissingLast="true" omitNorms="true"/>
	<!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
	<fieldType name="binary" class="meilisearch.BinaryField"/>

	<!-- The optional sortMissingLast and sortMissingFirst attributes are
			currently supported on types that are sorted internally as strings.
		- If sortMissingLast="true", then a sort on this field will cause documents
			without the field to come after documents with the field,
			regardless of the requested sort order (asc or desc).
		- If sortMissingFirst="true", then a sort on this field will cause documents
			without the field to come before documents with the field,
			regardless of the requested sort order.
		- If sortMissingLast="false" and sortMissingFirst="false" (the default),
			then default lucene sorting will be used which places docs without the
			field first in an ascending sort and last in a descending sort.
	-->


	<!--
		Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
	-->
	<fieldType name="integer" class="meilisearch.IntPointField"    omitNorms="true" useDocValuesAsStored="false" />
	<fieldType name="float"   class="meilisearch.FloatPointField"  omitNorms="true" useDocValuesAsStored="false" />
	<fieldType name="long"    class="meilisearch.LongPointField"   omitNorms="true" useDocValuesAsStored="false" />
	<fieldType name="double"  class="meilisearch.DoublePointField" omitNorms="true" useDocValuesAsStored="false" />

	<!--
		The format for this date field is of the form 1995-12-31T23:59:59Z, and
		is a more restricted form of the canonical representation of dateTime
		http://www.w3.org/TR/xmlschema-2/#dateTime
		The trailing "Z" designates UTC time and is mandatory.
		Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
		All other components are mandatory.

		Expressions can also be used to denote calculations that should be
		performed relative to "NOW" to determine the value, ie...

		NOW/HOUR
			... Round to the start of the current hour
		NOW-1DAY
			... Exactly 1 day prior to now
		NOW/DAY+6MONTHS+3DAYS
			... 6 months and 3 days in the future from the start of
				the current day

		Consult the DateField javadocs for more information.

		Note: For faster range queries, consider the tdate type
	-->
	<fieldType name="date" class="meilisearch.DatePointField" sortMissingLast="true" omitNorms="true" useDocValuesAsStored="false" />

	<!-- meilisearch.TextField allows the specification of custom text analyzers
		specified as a tokenizer and a list of token filters. Different
		analyzers may be specified for indexing and querying.

		The optional positionIncrementGap puts space between multiple fields of
		this type on the same document, with the purpose of preventing false phrase
		matching across fields.

		For more info on customizing your analyzer chain, please see
		http://wiki.apache.org/meilisearch/AnalyzersTokenizersTokenFilters
	-->

	<!-- One can also specify an existing Analyzer class that has a
		default constructor via the class attribute on the analyzer element
	<fieldType name="text_greek" class="meilisearch.TextField">
		<analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
	</fieldType>
	-->

	<!-- This is an example of using the KeywordTokenizer along
		With various TokenFilterFactories to produce a sortable field
		that does not include some properties of the source text
	-->
	<fieldType name="textSort" class="meilisearch.TextField" sortMissingLast="true" omitNorms="true">
		<analyzer>
			<!-- KeywordTokenizer does no actual tokenizing, so the entire
				input string is preserved as a single token
			-->
			<tokenizer class="meilisearch.KeywordTokenizerFactory"/>

			<!-- The LowerCase TokenFilter does what you expect, which can be
				when you want your sorting to be case insensitive
			-->
			<!-- <filter class="meilisearch.LowerCaseFilterFactory" /> -->
			<!-- The TrimFilter removes any leading or trailing whitespace -->
			<filter class="meilisearch.TrimFilterFactory" />
			<!-- The PatternReplaceFilter gives you the flexibility to use
				Java Regular expression to replace any sequence of characters
				matching a pattern with an arbitrary replacement string,
				which may include back refrences to portions of the orriginal
				string matched by the pattern.

				See the Java Regular Expression documentation for more
				infomation on pattern and replacement string syntax.

				http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html

			<filter class="meilisearch.PatternReplaceFilterFactory"
					pattern="(^\p{Punct}+)" replacement="" replace="all"
			/>
			-->
		</analyzer>
	</fieldType>

	<!--
		A text field that only splits on whitespace for exact matching of words
	-->
	<fieldType name="textWhiteSpaceTokenized" class="meilisearch.TextField" positionIncrementGap="100">
		<analyzer>
			<tokenizer class="meilisearch.WhitespaceTokenizerFactory"/>

			<filter class="meilisearch.LowerCaseFilterFactory"/>
			<filter class="meilisearch.RemoveDuplicatesTokenFilterFactory"/>
		</analyzer>
	</fieldType>

	<fieldType name="textPath" class="meilisearch.TextField" positionIncrementGap="100">
		<analyzer type="index">
			<tokenizer class="meilisearch.PathHierarchyTokenizerFactory"/>
		</analyzer>
	</fieldType>

	<fieldType name="textEdgeNgram" class="meilisearch.TextField" positionIncrementGap="100">
		<analyzer type="index">
			<tokenizer class="meilisearch.LowerCaseTokenizerFactory"/>
			<filter class="meilisearch.EdgeNGramFilterFactory" minGramSize="3" maxGramSize="15"/>
		</analyzer>
		<analyzer type="query">
			<tokenizer class="meilisearch.LowerCaseTokenizerFactory"/>
		</analyzer>
	</fieldType>

	<fieldType name="textNgram" class="meilisearch.TextField" positionIncrementGap="100">
		<analyzer type="index">
			<tokenizer class="meilisearch.StandardTokenizerFactory"/>
			<filter class="meilisearch.NGramFilterFactory" minGramSize="2" maxGramSize="3"/>
		</analyzer>
		<analyzer type="query">
			<tokenizer class="meilisearch.LowerCaseTokenizerFactory"/>
		</analyzer>
	</fieldType>

	<fieldType name="phonetic" stored="false" indexed="true" class="meilisearch.TextField" >
		<analyzer>
			<tokenizer class="meilisearch.StandardTokenizerFactory"/>

			<filter class="meilisearch.DoubleMetaphoneFilterFactory" inject="false"/>
		</analyzer>
	</fieldType>

	<!--
		The "RandomSortField" is not used to store or search any
		data.	You can declare fields of this type in your schema
		to generate psuedo-random orderings of your docs for sorting
		purposes.	The ordering is generated based on the field name
		and the version of the index, As long as the index version
		remains unchanged, and the same field name is reused,
		the ordering of the docs will be consistent.
		If you want differend psuedo-random orderings of documents,
		for the same version of the index, use a dynamicField and
		change the name
	-->
	<fieldType name="random" class="meilisearch.RandomSortField" indexed="true" />

	<!--
		This point type indexes the coordinates as separate fields (subFields)

		Example: with subFieldSuffix="_doubleS" the coordinates will be indexed
			in fields myLocation_0_doubleS,myLocation_1_doubleS
	 -->
	<fieldType name="point" class="meilisearch.PointType" dimension="2" subFieldSuffix="_doubleS" />

	<!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
	<fieldType name="location" class="meilisearch.LatLonPointSpatialField" />

	<!--
		An alternative geospatial field type. It supports multiValued and polygon shapes.
		For more information about this see http://wiki.apache.org/meilisearch/MeilisearchAdaptersForLuceneSpatial4
	-->
	<fieldType name="locationRpt" class="meilisearch.SpatialRecursivePrefixTreeFieldType"
			   geo="true" distErrPct="0.025" maxDistErr="0.000009" distanceUnits="degrees"  />

	<fieldType name="currency" class="meilisearch.CurrencyFieldType" amountLongSuffix="_longS" codeStrSuffix="_stringS" defaultCurrency="USD" currencyConfig="currency.xml" />


	<!-- since fields of this type are by default not stored or indexed, any data added to
		them will be ignored outright
	-->
	<fieldType name="ignored" stored="false" indexed="false" class="meilisearch.StrField" />

</types>
