Text datatype【官网】

来源:互联网 发布:vc6.0 mfc编程入门 编辑:程序博客网 时间:2024/06/05 02:37

官网速度太慢,留了下次用。

Text datatypeedit

A field to index full-text values, such as the body of an email or thedescription of a product. These fields areanalyzed, that is they are passed through ananalyzer to convert the string into a list of individual termsbefore being indexed. The analysis process allows Elasticsearch to search forindividual wordswithin each full text field. Text fields are notused for sorting and seldom used for aggregations (although thesignificant terms aggregationis a notable exception).

If you need to index structured content such as email addresses, hostnames, statuscodes, or tags, it is likely that you should rather use akeyword field.

Below is an example of a mapping for a text field:

PUT my_index{  "mappings": {    "my_type": {      "properties": {        "full_name": {          "type":  "text"        }      }    }  }}
Copy as cURLView in Console 

Sometimes it is useful to have both a full text (text) and a keyword(keyword) version of the same field: one for full text search and theother for aggregations and sorting. This can be achieved withmulti-fields.

Parameters for text fieldsedit

The following parameters are accepted by text fields:

analyzer

The analyzer which should be used for analyzed string fields, both at index-time and at search-time (unless overridden by thesearch_analyzer). Defaults to the default index analyzer, or thestandard analyzer.

boost

Mapping field-level query time boosting. Accepts a floating point number, defaults to1.0.

eager_global_ordinals

Should global ordinals be loaded eagerly on refresh? Accepts true or false (default). Enabling this is a good idea on fields that are frequently used for (significant) terms aggregations.

fielddata

Can the field use in-memory fielddata for sorting, aggregations, or scripting? Acceptstrue or false (default).

fielddata_frequency_filter

Expert settings which allow to decide which values to load in memory when fielddata is enabled. By default all values are loaded.

fields

Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.

include_in_all

Whether or not the field value should be included in the _all field? Accepts true orfalse. Defaults to false ifindex is set to no, or if a parentobject field sets include_in_all tofalse. Otherwise defaults to true.

index

Should the field be searchable? Accepts true (default) orfalse.

index_options

What information should be stored in the index, for search and highlighting purposes. Defaults topositions.

norms

Whether field-length should be taken into account when scoring queries. Acceptstrue (default) or false.

position_increment_gap

The number of fake term position which should be inserted between each element of an array of strings. Defaults to theposition_increment_gap configured on the analyzer which defaults to100. 100 was chosen because it prevents phrase queries with reasonably large slops (less than 100) from matching terms across field values.

store

Whether the field value should be stored and retrievable separately from the _source field. Accepts true orfalse (default).

search_analyzer

The analyzer that should be used at search time on analyzed fields. Defaults to the analyzer setting.

search_quote_analyzer

The analyzer that should be used at search time when a phrase is encountered. Defaults to thesearch_analyzer setting.

similarity

Which scoring algorithm or similarity should be used. Defaults toclassic, which uses TF/IDF.

term_vector

Whether term vectors should be stored for an analyzed field. Defaults to no.

Note

Indexes imported from 2.x do not support text. Instead they willattempt to downgradetext into string. This allows you to merge modernmappings with legacy mappings. Long lived indexes will have to be recreatedbefore upgrading to 6.x but mapping downgrade gives you the opportunity to dothe recreation on your own schedule.


0 0
原创粉丝点击