types.asciidoc 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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>>:: `string`
  8. <<number>>:: `long`, `integer`, `short`, `byte`, `double`, `float`
  9. <<date>>:: `date`
  10. <<boolean>>:: `boolean`
  11. <<binary>>:: `binary`
  12. [float]
  13. === Complex datatypes
  14. <<array>>:: Array support does not require a dedicated `type`
  15. <<object>>:: `object` for single JSON objects
  16. <<nested>>:: `nested` for arrays of JSON objects
  17. [float]
  18. === Geo dataypes
  19. <<geo-point>>:: `geo_point` for lat/lon points
  20. <<geo-shape>>:: `geo_shape` for complex shapes like polygons
  21. [float]
  22. === Specialised datatypes
  23. <<ip>>:: `ip` for IPv4 addresses
  24. <<search-suggesters-completion,Completion datatype>>::
  25. `completion` to provide auto-complete suggestions
  26. <<token-count>>:: `token_count` to count the number of tokens in a string
  27. {plugins}/mapper-size.html[`mapper-murmur3`]:: `murmur3` to compute hashes of values at index-time and store them in the index
  28. Attachment datatype::
  29. See the {plugins}/mapper-attachments.html[`mapper-attachments`] plugin
  30. which supports indexing `attachments` like Microsoft Office formats, Open
  31. Document formats, ePub, HTML, etc. into an `attachment` datatype.
  32. [float]
  33. === Multi-fields
  34. It is often useful to index the same field in different ways for different
  35. purposes. For instance, a `string` field could be <<mapping-index,indexed>> as
  36. an `analyzed` field for full-text search, and as a `not_analyzed` field for
  37. sorting or aggregations. Alternatively, you could index a string field with
  38. the <<analysis-standard-analyzer,`standard` analyzer>>, the
  39. <<english-analyzer,`english`>> analyzer, and the
  40. <<french-analyzer,`french` analyzer>>.
  41. This is the purpose of _multi-fields_. Most datatypes support multi-fields
  42. via the <<multi-fields>> parameter.
  43. include::types/array.asciidoc[]
  44. include::types/binary.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/nested.asciidoc[]
  51. include::types/numeric.asciidoc[]
  52. include::types/object.asciidoc[]
  53. include::types/string.asciidoc[]
  54. include::types/token-count.asciidoc[]