1
0

types.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. [[mapping-types]]
  2. == Field datatypes
  3. Elasticsearch supports a number of different datatypes for the fields in a
  4. document:
  5. [float]
  6. === Core datatypes
  7. string:: <<text,`text`>> and <<keyword,`keyword`>>
  8. <<number>>:: `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float`
  9. <<date>>:: `date`
  10. <<date_nanos>>:: `date_nanos`
  11. <<boolean>>:: `boolean`
  12. <<binary>>:: `binary`
  13. <<range>>:: `integer_range`, `float_range`, `long_range`, `double_range`, `date_range`
  14. [float]
  15. === Complex datatypes
  16. <<array>>:: Array support does not require a dedicated `type`
  17. <<object>>:: `object` for single JSON objects
  18. <<nested>>:: `nested` for arrays of JSON objects
  19. [float]
  20. === Geo datatypes
  21. <<geo-point>>:: `geo_point` for lat/lon points
  22. <<geo-shape>>:: `geo_shape` for complex shapes like polygons
  23. [float]
  24. === Specialised datatypes
  25. <<ip>>:: `ip` for IPv4 and IPv6 addresses
  26. <<search-suggesters-completion,Completion datatype>>::
  27. `completion` to provide auto-complete suggestions
  28. <<token-count>>:: `token_count` to count the number of tokens in a string
  29. {plugins}/mapper-murmur3.html[`mapper-murmur3`]:: `murmur3` to compute hashes of values at index-time and store them in the index
  30. {plugins}/mapper-annotated-text.html[`mapper-annotated-text`]:: `annotated-text` to index text containing special markup (typically used for identifying named entities)
  31. <<percolator>>:: Accepts queries from the query-dsl
  32. <<parent-join>>:: Defines parent/child relation for documents within the same index
  33. <<alias>>:: Defines an alias to an existing field.
  34. <<rank-feature>>:: Record numeric feature to boost hits at query time.
  35. <<rank-features>>:: Record numeric features to boost hits at query time.
  36. <<dense-vector>>:: Record dense vectors of float values.
  37. <<sparse-vector>>:: Record sparse vectors of float values.
  38. [float]
  39. === Multi-fields
  40. It is often useful to index the same field in different ways for different
  41. purposes. For instance, a `string` field could be mapped as
  42. a `text` field for full-text search, and as a `keyword` field for
  43. sorting or aggregations. Alternatively, you could index a text field with
  44. the <<analysis-standard-analyzer,`standard` analyzer>>, the
  45. <<english-analyzer,`english`>> analyzer, and the
  46. <<french-analyzer,`french` analyzer>>.
  47. This is the purpose of _multi-fields_. Most datatypes support multi-fields
  48. via the <<multi-fields>> parameter.
  49. include::types/alias.asciidoc[]
  50. include::types/array.asciidoc[]
  51. include::types/binary.asciidoc[]
  52. include::types/range.asciidoc[]
  53. include::types/boolean.asciidoc[]
  54. include::types/date.asciidoc[]
  55. include::types/date_nanos.asciidoc[]
  56. include::types/geo-point.asciidoc[]
  57. include::types/geo-shape.asciidoc[]
  58. include::types/ip.asciidoc[]
  59. include::types/keyword.asciidoc[]
  60. include::types/nested.asciidoc[]
  61. include::types/numeric.asciidoc[]
  62. include::types/object.asciidoc[]
  63. include::types/text.asciidoc[]
  64. include::types/token-count.asciidoc[]
  65. include::types/percolator.asciidoc[]
  66. include::types/parent-join.asciidoc[]
  67. include::types/rank-feature.asciidoc[]
  68. include::types/rank-features.asciidoc[]
  69. include::types/dense-vector.asciidoc[]
  70. include::types/sparse-vector.asciidoc[]