types.asciidoc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. <<boolean>>:: `boolean`
  11. <<binary>>:: `binary`
  12. <<range>>:: `integer_range`, `float_range`, `long_range`, `double_range`, `date_range`
  13. [float]
  14. === Complex datatypes
  15. <<array>>:: Array support does not require a dedicated `type`
  16. <<object>>:: `object` for single JSON objects
  17. <<nested>>:: `nested` for arrays of JSON objects
  18. [float]
  19. === Geo datatypes
  20. <<geo-point>>:: `geo_point` for lat/lon points
  21. <<geo-shape>>:: `geo_shape` for complex shapes like polygons
  22. [float]
  23. === Specialised datatypes
  24. <<ip>>:: `ip` for IPv4 and IPv6 addresses
  25. <<search-suggesters-completion,Completion datatype>>::
  26. `completion` to provide auto-complete suggestions
  27. <<token-count>>:: `token_count` to count the number of tokens in a string
  28. {plugins}/mapper-murmur3.html[`mapper-murmur3`]:: `murmur3` to compute hashes of values at index-time and store them in the index
  29. <<percolator>>:: Accepts queries from the query-dsl
  30. <<parent-join>>:: Defines parent/child relation for documents within the same index
  31. <<feature>>:: Record numeric features to boost hits at query time.
  32. <<feature-vector>>:: Record numeric feature vectors to boost hits at query time.
  33. [float]
  34. === Multi-fields
  35. It is often useful to index the same field in different ways for different
  36. purposes. For instance, a `string` field could be mapped as
  37. a `text` field for full-text search, and as a `keyword` field for
  38. sorting or aggregations. Alternatively, you could index a text field with
  39. the <<analysis-standard-analyzer,`standard` analyzer>>, the
  40. <<english-analyzer,`english`>> analyzer, and the
  41. <<french-analyzer,`french` analyzer>>.
  42. This is the purpose of _multi-fields_. Most datatypes support multi-fields
  43. via the <<multi-fields>> parameter.
  44. include::types/array.asciidoc[]
  45. include::types/binary.asciidoc[]
  46. include::types/range.asciidoc[]
  47. include::types/boolean.asciidoc[]
  48. include::types/date.asciidoc[]
  49. include::types/geo-point.asciidoc[]
  50. include::types/geo-shape.asciidoc[]
  51. include::types/ip.asciidoc[]
  52. include::types/keyword.asciidoc[]
  53. include::types/nested.asciidoc[]
  54. include::types/numeric.asciidoc[]
  55. include::types/object.asciidoc[]
  56. include::types/text.asciidoc[]
  57. include::types/token-count.asciidoc[]
  58. include::types/percolator.asciidoc[]
  59. include::types/parent-join.asciidoc[]
  60. include::types/feature.asciidoc[]
  61. include::types/feature-vector.asciidoc[]