glossary.asciidoc 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. [glossary]
  2. [[glossary]]
  3. = Glossary of terms
  4. [glossary]
  5. [[glossary-analysis]] analysis ::
  6. Analysis is the process of converting <<glossary-text,full text>> to
  7. <<glossary-term,terms>>. Depending on which analyzer is used, these phrases:
  8. `FOO BAR`, `Foo-Bar`, `foo,bar` will probably all result in the
  9. terms `foo` and `bar`. These terms are what is actually stored in
  10. the index.
  11. +
  12. A full text query (not a <<glossary-term,term>> query) for `FoO:bAR` will
  13. also be analyzed to the terms `foo`,`bar` and will thus match the
  14. terms stored in the index.
  15. +
  16. It is this process of analysis (both at index time and at search time)
  17. that allows elasticsearch to perform full text queries.
  18. +
  19. Also see <<glossary-text,text>> and <<glossary-term,term>>.
  20. [[glossary-cluster]] cluster ::
  21. A cluster consists of one or more <<glossary-node,nodes>> which share the
  22. same cluster name. Each cluster has a single master node which is
  23. chosen automatically by the cluster and which can be replaced if the
  24. current master node fails.
  25. [[glossary-document]] document ::
  26. A document is a JSON document which is stored in elasticsearch. It is
  27. like a row in a table in a relational database. Each document is
  28. stored in an <<glossary-index,index>> and has a <<glossary-type,type>> and an
  29. <<glossary-id,id>>.
  30. +
  31. A document is a JSON object (also known in other languages as a hash /
  32. hashmap / associative array) which contains zero or more
  33. <<glossary-field,fields>>, or key-value pairs.
  34. +
  35. The original JSON document that is indexed will be stored in the
  36. <<glossary-source_field,`_source` field>>, which is returned by default when
  37. getting or searching for a document.
  38. [[glossary-id]] id ::
  39. The ID of a <<glossary-document,document>> identifies a document. The
  40. `index/type/id` of a document must be unique. If no ID is provided,
  41. then it will be auto-generated. (also see <<glossary-routing,routing>>)
  42. [[glossary-field]] field ::
  43. A <<glossary-document,document>> contains a list of fields, or key-value
  44. pairs. The value can be a simple (scalar) value (eg a string, integer,
  45. date), or a nested structure like an array or an object. A field is
  46. similar to a column in a table in a relational database.
  47. +
  48. The <<glossary-mapping,mapping>> for each field has a field _type_ (not to
  49. be confused with document <<glossary-type,type>>) which indicates the type
  50. of data that can be stored in that field, eg `integer`, `string`,
  51. `object`. The mapping also allows you to define (amongst other things)
  52. how the value for a field should be analyzed.
  53. [[glossary-index]] index ::
  54. An index is like a _table_ in a relational database. It has a
  55. <<glossary-mapping,mapping>> which defines the <<glossary-field,fields>> in the index,
  56. which are grouped by multiple <<glossary-type,type>>.
  57. +
  58. An index is a logical namespace which maps to one or more
  59. <<glossary-primary-shard,primary shards>> and can have zero or more
  60. <<glossary-replica-shard,replica shards>>.
  61. [[glossary-mapping]] mapping ::
  62. A mapping is like a _schema definition_ in a relational database. Each
  63. <<glossary-index,index>> has a mapping, which defines each <<glossary-type,type>>
  64. within the index, plus a number of index-wide settings.
  65. +
  66. A mapping can either be defined explicitly, or it will be generated
  67. automatically when a document is indexed.
  68. [[glossary-node]] node ::
  69. A node is a running instance of elasticsearch which belongs to a
  70. <<glossary-cluster,cluster>>. Multiple nodes can be started on a single
  71. server for testing purposes, but usually you should have one node per
  72. server.
  73. +
  74. At startup, a node will use unicast to discover an existing cluster with
  75. the same cluster name and will try to join that cluster.
  76. [[glossary-primary-shard]] primary shard ::
  77. Each document is stored in a single primary <<glossary-shard,shard>>. When
  78. you index a document, it is indexed first on the primary shard, then
  79. on all <<glossary-replica-shard,replicas>> of the primary shard.
  80. +
  81. By default, an <<glossary-index,index>> has 5 primary shards. You can
  82. specify fewer or more primary shards to scale the number of
  83. <<glossary-document,documents>> that your index can handle.
  84. +
  85. You cannot change the number of primary shards in an index, once the
  86. index is created.
  87. +
  88. See also <<glossary-routing,routing>>
  89. [[glossary-replica-shard]] replica shard ::
  90. Each <<glossary-primary-shard,primary shard>> can have zero or more
  91. replicas. A replica is a copy of the primary shard, and has two
  92. purposes:
  93. +
  94. 1. increase failover: a replica shard can be promoted to a primary
  95. shard if the primary fails
  96. 2. increase performance: get and search requests can be handled by
  97. primary or replica shards.
  98. +
  99. By default, each primary shard has one replica, but the number of
  100. replicas can be changed dynamically on an existing index. A replica
  101. shard will never be started on the same node as its primary shard.
  102. [[glossary-routing]] routing ::
  103. When you index a document, it is stored on a single
  104. <<glossary-primary-shard,primary shard>>. That shard is chosen by hashing
  105. the `routing` value. By default, the `routing` value is derived from
  106. the ID of the document or, if the document has a specified parent
  107. document, from the ID of the parent document (to ensure that child and
  108. parent documents are stored on the same shard).
  109. +
  110. This value can be overridden by specifying a `routing` value at index
  111. time, or a <<mapping-routing-field,routing
  112. field>> in the <<glossary-mapping,mapping>>.
  113. [[glossary-shard]] shard ::
  114. A shard is a single Lucene instance. It is a low-level “worker” unit
  115. which is managed automatically by elasticsearch. An index is a logical
  116. namespace which points to <<glossary-primary-shard,primary>> and
  117. <<glossary-replica-shard,replica>> shards.
  118. +
  119. Other than defining the number of primary and replica shards that an
  120. index should have, you never need to refer to shards directly.
  121. Instead, your code should deal only with an index.
  122. +
  123. Elasticsearch distributes shards amongst all <<glossary-node,nodes>> in the
  124. <<glossary-cluster,cluster>>, and can move shards automatically from one
  125. node to another in the case of node failure, or the addition of new
  126. nodes.
  127. [[glossary-source_field]] source field ::
  128. By default, the JSON document that you index will be stored in the
  129. `_source` field and will be returned by all get and search requests.
  130. This allows you access to the original object directly from search
  131. results, rather than requiring a second step to retrieve the object
  132. from an ID.
  133. [[glossary-term]] term ::
  134. A term is an exact value that is indexed in elasticsearch. The terms
  135. `foo`, `Foo`, `FOO` are NOT equivalent. Terms (i.e. exact values) can
  136. be searched for using _term_ queries. +
  137. See also <<glossary-text,text>> and <<glossary-analysis,analysis>>.
  138. [[glossary-text]] text ::
  139. Text (or full text) is ordinary unstructured text, such as this
  140. paragraph. By default, text will be <<glossary-analysis,analyzed>> into
  141. <<glossary-term,terms>>, which is what is actually stored in the index.
  142. +
  143. Text <<glossary-field,fields>> need to be analyzed at index time in order to
  144. be searchable as full text, and keywords in full text queries must be
  145. analyzed at search time to produce (and search for) the same terms
  146. that were generated at index time.
  147. +
  148. See also <<glossary-term,term>> and <<glossary-analysis,analysis>>.
  149. [[glossary-type]] type ::
  150. A type represents the _type_ of document, e.g. an `email`, a `user`, or a `tweet`.
  151. The search API can filter documents by type.
  152. An <<glossary-index,index>> can contain multiple types, and each type has a
  153. list of <<glossary-field,fields>> that can be specified for
  154. <<glossary-document,documents>> of that type. Fields with the same
  155. name in different types in the same index must have the same <<glossary-mapping,mapping>>
  156. (which defines how each field in the document is indexed and made searchable).