glossary.asciidoc 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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 5 primary shards. You can
  89. specify fewer or more primary shards to scale the number of
  90. <<glossary-document,documents>> that your index can handle.
  91. +
  92. You cannot change the number of primary shards in an index, once the
  93. index is created.
  94. +
  95. See also <<glossary-routing,routing>>
  96. [[glossary-query]] query ::
  97. A query is the basic component of a search. A search can be defined by one or more queries
  98. which can be mixed and matched in endless combinations. While <<glossary-filter,filters>> are
  99. queries that only determine if a document matches, those queries that also calculate how well
  100. the document matches are known as "scoring queries". Those queries assign it a score, which is
  101. later used to sort matched documents. Scoring queries take more resources than <<glossary-filter,non scoring queries>>
  102. and their query results are not cacheable. As a general rule, use query clauses for full-text
  103. search or for any condition that requires scoring, and use filters for everything else.
  104. [[glossary-replica-shard]] replica shard ::
  105. Each <<glossary-primary-shard,primary shard>> can have zero or more
  106. replicas. A replica is a copy of the primary shard, and has two
  107. purposes:
  108. +
  109. 1. increase failover: a replica shard can be promoted to a primary
  110. shard if the primary fails
  111. 2. increase performance: get and search requests can be handled by
  112. primary or replica shards.
  113. +
  114. By default, each primary shard has one replica, but the number of
  115. replicas can be changed dynamically on an existing index. A replica
  116. shard will never be started on the same node as its primary shard.
  117. [[glossary-routing]] routing ::
  118. When you index a document, it is stored on a single
  119. <<glossary-primary-shard,primary shard>>. That shard is chosen by hashing
  120. the `routing` value. By default, the `routing` value is derived from
  121. the ID of the document or, if the document has a specified parent
  122. document, from the ID of the parent document (to ensure that child and
  123. parent documents are stored on the same shard).
  124. +
  125. This value can be overridden by specifying a `routing` value at index
  126. time, or a <<mapping-routing-field,routing
  127. field>> in the <<glossary-mapping,mapping>>.
  128. [[glossary-shard]] shard ::
  129. A shard is a single Lucene instance. It is a low-level “worker” unit
  130. which is managed automatically by Elasticsearch. An index is a logical
  131. namespace which points to <<glossary-primary-shard,primary>> and
  132. <<glossary-replica-shard,replica>> shards.
  133. +
  134. Other than defining the number of primary and replica shards that an
  135. index should have, you never need to refer to shards directly.
  136. Instead, your code should deal only with an index.
  137. +
  138. Elasticsearch distributes shards amongst all <<glossary-node,nodes>> in the
  139. <<glossary-cluster,cluster>>, and can move shards automatically from one
  140. node to another in the case of node failure, or the addition of new
  141. nodes.
  142. [[glossary-source_field]] source field ::
  143. By default, the JSON document that you index will be stored in the
  144. `_source` field and will be returned by all get and search requests.
  145. This allows you access to the original object directly from search
  146. results, rather than requiring a second step to retrieve the object
  147. from an ID.
  148. [[glossary-term]] term ::
  149. A term is an exact value that is indexed in Elasticsearch. The terms
  150. `foo`, `Foo`, `FOO` are NOT equivalent. Terms (i.e. exact values) can
  151. be searched for using _term_ queries.
  152. +
  153. See also <<glossary-text,text>> and <<glossary-analysis,analysis>>.
  154. [[glossary-text]] text ::
  155. Text (or full text) is ordinary unstructured text, such as this
  156. paragraph. By default, text will be <<glossary-analysis,analyzed>> into
  157. <<glossary-term,terms>>, which is what is actually stored in the index.
  158. +
  159. Text <<glossary-field,fields>> need to be analyzed at index time in order to
  160. be searchable as full text, and keywords in full text queries must be
  161. analyzed at search time to produce (and search for) the same terms
  162. that were generated at index time.
  163. +
  164. See also <<glossary-term,term>> and <<glossary-analysis,analysis>>.
  165. [[glossary-type]] type ::
  166. A type used to represent the _type_ of document, e.g. an `email`, a `user`, or a `tweet`.
  167. Types are deprecated and are in the process of being removed. See <<removal-of-types>>.