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