glossary.asciidoc 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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/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-filter]] filter ::
  54. A filter is a non-scoring <<glossary-query,query>>, meaning that it does not score documents.
  55. It is only concerned about answering the question - "Does this document match?".
  56. The answer is always a simple, binary yes or no. This kind of query is said to be made
  57. in a <<query-filter-context,filter context>>,
  58. hence it is called a filter. Filters are simple checks for set inclusion or exclusion.
  59. In most cases, the goal of filtering is to reduce the number of documents that have to be examined.
  60. [[glossary-index]] index ::
  61. An index is like a _table_ in a relational database. It has a
  62. <<glossary-mapping,mapping>> which contains a <<glossary-type,type>>,
  63. which contains the <<glossary-field,fields>> in the index.
  64. +
  65. An index is a logical namespace which maps to one or more
  66. <<glossary-primary-shard,primary shards>> and can have zero or more
  67. <<glossary-replica-shard,replica shards>>.
  68. [[glossary-mapping]] mapping ::
  69. A mapping is like a _schema definition_ in a relational database. Each
  70. <<glossary-index,index>> has a mapping, which defines a <<glossary-type,type>>,
  71. plus a number of index-wide settings.
  72. +
  73. A mapping can either be defined explicitly, or it will be generated
  74. automatically when a document is indexed.
  75. [[glossary-node]] node ::
  76. A node is a running instance of Elasticsearch which belongs to a
  77. <<glossary-cluster,cluster>>. Multiple nodes can be started on a single
  78. server for testing purposes, but usually you should have one node per
  79. server.
  80. +
  81. At startup, a node will use unicast to discover an existing cluster with
  82. the same cluster name and will try to join that cluster.
  83. [[glossary-primary-shard]] primary shard ::
  84. Each document is stored in a single primary <<glossary-shard,shard>>. When
  85. you index a document, it is indexed first on the primary shard, then
  86. on all <<glossary-replica-shard,replicas>> of the primary shard.
  87. +
  88. By default, an <<glossary-index,index>> has one primary shard. You can specify
  89. more primary shards to scale the number of <<glossary-document,documents>>
  90. that your index can handle.
  91. +
  92. You cannot change the number of primary shards in an index, once the index is
  93. index is created. However, an index can be split into a new index using the
  94. <<indices-split-index, split API>>.
  95. +
  96. See also <<glossary-routing,routing>>
  97. [[glossary-query]] query ::
  98. A query is the basic component of a search. A search can be defined by one or more queries
  99. which can be mixed and matched in endless combinations. While <<glossary-filter,filters>> are
  100. queries that only determine if a document matches, those queries that also calculate how well
  101. the document matches are known as "scoring queries". Those queries assign it a score, which is
  102. later used to sort matched documents. Scoring queries take more resources than <<glossary-filter,non scoring queries>>
  103. and their query results are not cacheable. As a general rule, use query clauses for full-text
  104. search or for any condition that requires scoring, and use filters for everything else.
  105. [[glossary-replica-shard]] replica shard ::
  106. Each <<glossary-primary-shard,primary shard>> can have zero or more
  107. replicas. A replica is a copy of the primary shard, and has two
  108. purposes:
  109. +
  110. 1. increase failover: a replica shard can be promoted to a primary
  111. shard if the primary fails
  112. 2. increase performance: get and search requests can be handled by
  113. primary or replica shards.
  114. +
  115. By default, each primary shard has one replica, but the number of
  116. replicas can be changed dynamically on an existing index. A replica
  117. shard will never be started on the same node as its primary shard.
  118. [[glossary-routing]] routing ::
  119. When you index a document, it is stored on a single
  120. <<glossary-primary-shard,primary shard>>. That shard is chosen by hashing
  121. the `routing` value. By default, the `routing` value is derived from
  122. the ID of the document or, if the document has a specified parent
  123. document, from the ID of the parent document (to ensure that child and
  124. parent documents are stored on the same shard).
  125. +
  126. This value can be overridden by specifying a `routing` value at index
  127. time, or a <<mapping-routing-field,routing
  128. field>> in the <<glossary-mapping,mapping>>.
  129. [[glossary-shard]] shard ::
  130. A shard is a single Lucene instance. It is a low-level “worker” unit
  131. which is managed automatically by Elasticsearch. An index is a logical
  132. namespace which points to <<glossary-primary-shard,primary>> and
  133. <<glossary-replica-shard,replica>> shards.
  134. +
  135. Other than defining the number of primary and replica shards that an
  136. index should have, you never need to refer to shards directly.
  137. Instead, your code should deal only with an index.
  138. +
  139. Elasticsearch distributes shards amongst all <<glossary-node,nodes>> in the
  140. <<glossary-cluster,cluster>>, and can move shards automatically from one
  141. node to another in the case of node failure, or the addition of new
  142. nodes.
  143. [[glossary-source_field]] source field ::
  144. By default, the JSON document that you index will be stored in the
  145. `_source` field and will be returned by all get and search requests.
  146. This allows you access to the original object directly from search
  147. results, rather than requiring a second step to retrieve the object
  148. from an ID.
  149. [[glossary-term]] term ::
  150. A term is an exact value that is indexed in Elasticsearch. The terms
  151. `foo`, `Foo`, `FOO` are NOT equivalent. Terms (i.e. exact values) can
  152. be searched for using _term_ queries.
  153. +
  154. See also <<glossary-text,text>> and <<glossary-analysis,analysis>>.
  155. [[glossary-text]] text ::
  156. Text (or full text) is ordinary unstructured text, such as this
  157. paragraph. By default, text will be <<glossary-analysis,analyzed>> into
  158. <<glossary-term,terms>>, which is what is actually stored in the index.
  159. +
  160. Text <<glossary-field,fields>> need to be analyzed at index time in order to
  161. be searchable as full text, and keywords in full text queries must be
  162. analyzed at search time to produce (and search for) the same terms
  163. that were generated at index time.
  164. +
  165. See also <<glossary-term,term>> and <<glossary-analysis,analysis>>.
  166. [[glossary-type]] type ::
  167. A type used to represent the _type_ of document, e.g. an `email`, a `user`, or a `tweet`.
  168. Types are deprecated and are in the process of being removed. See <<removal-of-types>>.