types.asciidoc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. [float]
  32. === Multi-fields
  33. It is often useful to index the same field in different ways for different
  34. purposes. For instance, a `string` field could be mapped as
  35. a `text` field for full-text search, and as a `keyword` field for
  36. sorting or aggregations. Alternatively, you could index a text field with
  37. the <<analysis-standard-analyzer,`standard` analyzer>>, the
  38. <<english-analyzer,`english`>> analyzer, and the
  39. <<french-analyzer,`french` analyzer>>.
  40. This is the purpose of _multi-fields_. Most datatypes support multi-fields
  41. via the <<multi-fields>> parameter.
  42. include::types/array.asciidoc[]
  43. include::types/binary.asciidoc[]
  44. include::types/range.asciidoc[]
  45. include::types/boolean.asciidoc[]
  46. include::types/date.asciidoc[]
  47. include::types/geo-point.asciidoc[]
  48. include::types/geo-shape.asciidoc[]
  49. include::types/ip.asciidoc[]
  50. include::types/keyword.asciidoc[]
  51. include::types/nested.asciidoc[]
  52. include::types/numeric.asciidoc[]
  53. include::types/object.asciidoc[]
  54. include::types/text.asciidoc[]
  55. include::types/token-count.asciidoc[]
  56. include::types/percolator.asciidoc[]
  57. include::types/parent-join.asciidoc[]