migrate_2_0.asciidoc 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. [[breaking-changes-2.0]]
  2. == Breaking changes in 2.0
  3. This section discusses the changes that you need to be aware of when migrating
  4. your application to Elasticsearch 2.0.
  5. === Networking
  6. Elasticsearch now binds to the loopback interface by default (usually 127.0.0.1
  7. or ::1), the setting `network.host` can be specified to change this behavior.
  8. === Rivers removal
  9. Elasticsearch does not support rivers anymore. While we had first planned to
  10. keep them around to ease migration, keeping support for rivers proved to be
  11. challenging as it conflicted with other important changes that we wanted to
  12. bring to 2.0 like synchronous dynamic mappings updates, so we eventually
  13. decided to remove them entirely. See
  14. https://www.elastic.co/blog/deprecating_rivers for more background about why
  15. we are moving away from rivers.
  16. === Indices API
  17. The <<alias-retrieving, get alias api>> will, by default produce an error response
  18. if a requested index does not exist. This change brings the defaults for this API in
  19. line with the other Indices APIs. The <<multi-index>> options can be used on a request
  20. to change this behavior
  21. `GetIndexRequest.features()` now returns an array of Feature Enums instead of an array of String values.
  22. The following deprecated methods have been removed:
  23. * `GetIndexRequest.addFeatures(String[])` - Please use `GetIndexRequest.addFeatures(Feature[])` instead
  24. * `GetIndexRequest.features(String[])` - Please use `GetIndexRequest.features(Feature[])` instead
  25. * `GetIndexRequestBuilder.addFeatures(String[])` - Please use `GetIndexRequestBuilder.addFeatures(Feature[])` instead
  26. * `GetIndexRequestBuilder.setFeatures(String[])` - Please use `GetIndexRequestBuilder.setFeatures(Feature[])` instead
  27. === Partial fields
  28. Partial fields were deprecated since 1.0.0beta1 in favor of <<search-request-source-filtering,source filtering>>.
  29. === More Like This
  30. The More Like This API and the More Like This Field query have been removed in
  31. favor of the <<query-dsl-mlt-query, More Like This Query>>.
  32. The parameter `percent_terms_to_match` has been removed in favor of
  33. `minimum_should_match`.
  34. === Routing
  35. The default hash function that is used for routing has been changed from djb2 to
  36. murmur3. This change should be transparent unless you relied on very specific
  37. properties of djb2. This will help ensure a better balance of the document counts
  38. between shards.
  39. In addition, the following node settings related to routing have been deprecated:
  40. [horizontal]
  41. `cluster.routing.operation.hash.type`::
  42. This was an undocumented setting that allowed to configure which hash function
  43. to use for routing. `murmur3` is now enforced on new indices.
  44. `cluster.routing.operation.use_type`::
  45. This was an undocumented setting that allowed to take the `_type` of the
  46. document into account when computing its shard (default: `false`). `false` is
  47. now enforced on new indices.
  48. === Async replication
  49. The `replication` parameter has been removed from all CRUD operations (index,
  50. update, delete, bulk). These operations are now synchronous
  51. only, and a request will only return once the changes have been replicated to
  52. all active shards in the shard group.
  53. === Store
  54. The `memory` / `ram` store (`index.store.type`) option was removed in Elasticsearch 2.0.
  55. === Term Vectors API
  56. Usage of `/_termvector` is deprecated, and replaced in favor of `/_termvectors`.
  57. === Script fields
  58. Script fields in 1.x were only returned as a single value. So even if the return
  59. value of a script used to be list, it would be returned as an array containing
  60. a single value that is a list too, such as:
  61. [source,js]
  62. ---------------
  63. "fields": {
  64. "my_field": [
  65. [
  66. "v1",
  67. "v2"
  68. ]
  69. ]
  70. }
  71. ---------------
  72. In elasticsearch 2.x, scripts that return a list of values are considered as
  73. multivalued fields. So the same example would return the following response,
  74. with values in a single array.
  75. [source,js]
  76. ---------------
  77. "fields": {
  78. "my_field": [
  79. "v1",
  80. "v2"
  81. ]
  82. }
  83. ---------------
  84. === Main API
  85. Previously, calling `GET /` was giving back the http status code within the json response
  86. in addition to the actual HTTP status code. We removed `status` field in json response.
  87. === Java API
  88. `org.elasticsearch.index.queries.FilterBuilders` has been removed as part of the merge of
  89. queries and filters. These filters are now available in `QueryBuilders` with the same name.
  90. All methods that used to accept a `FilterBuilder` now accept a `QueryBuilder` instead.
  91. In addition some query builders have been removed or renamed:
  92. * `commonTerms(...)` renamed with `commonTermsQuery(...)`
  93. * `queryString(...)` renamed with `queryStringQuery(...)`
  94. * `simpleQueryString(...)` renamed with `simpleQueryStringQuery(...)`
  95. * `textPhrase(...)` removed
  96. * `textPhrasePrefix(...)` removed
  97. * `textPhrasePrefixQuery(...)` removed
  98. * `filtered(...)` removed. Use `filteredQuery(...)` instead.
  99. * `inQuery(...)` removed.
  100. === Aggregations
  101. The `date_histogram` aggregation now returns a `Histogram` object in the response, and the `DateHistogram` class has been removed. Similarly
  102. the `date_range`, `ipv4_range`, and `geo_distance` aggregations all return a `Range` object in the response, and the `IPV4Range`, `DateRange`,
  103. and `GeoDistance` classes have been removed. The motivation for this is to have a single response API for the Range and Histogram aggregations
  104. regardless of the type of data being queried. To support this some changes were made in the `MultiBucketAggregation` interface which applies
  105. to all bucket aggregations:
  106. * The `getKey()` method now returns `Object` instead of `String`. The actual object type returned depends on the type of aggregation requested
  107. (e.g. the `date_histogram` will return a `DateTime` object for this method whereas a `histogram` will return a `Number`).
  108. * A `getKeyAsString()` method has been added to return the String representation of the key.
  109. * All other `getKeyAsX()` methods have been removed.
  110. * The `getBucketAsKey(String)` methods have been removed on all aggregations except the `filters` and `terms` aggregations.
  111. The `histogram` and the `date_histogram` aggregation now support a simplified `offset` option that replaces the previous `pre_offset` and
  112. `post_offset` rounding options. Instead of having to specify two separate offset shifts of the underlying buckets, the `offset` option
  113. moves the bucket boundaries in positive or negative direction depending on its argument.
  114. The `date_histogram` options for `pre_zone` and `post_zone` are replaced by the `time_zone` option. The behavior of `time_zone` is
  115. equivalent to the former `pre_zone` option. Setting `time_zone` to a value like "+01:00" now will lead to the bucket calculations
  116. being applied in the specified time zone but In addition to this, also the `pre_zone_adjust_large_interval` is removed because we
  117. now always return dates and bucket keys in UTC.
  118. Both the `histogram` and `date_histogram` aggregations now have a default `min_doc_count` of `0` instead of `1` previously.
  119. `include`/`exclude` filtering on the `terms` aggregation now uses the same syntax as regexp queries instead of the Java syntax. While simple
  120. regexps should still work, more complex ones might need some rewriting. Also, the `flags` parameter is not supported anymore.
  121. === Terms filter lookup caching
  122. The terms filter lookup mechanism does not support the `cache` option anymore
  123. and relies on the filesystem cache instead. If the lookup index is not too
  124. large, it is recommended to make it replicated to all nodes by setting
  125. `index.auto_expand_replicas: 0-all` in order to remove the network overhead as
  126. well.
  127. === Delete by query
  128. The meaning of the `_shards` headers in the delete by query response has changed. Before version 2.0 the `total`,
  129. `successful` and `failed` fields in the header are based on the number of primary shards. The failures on replica
  130. shards aren't being kept track of. From version 2.0 the stats in the `_shards` header are based on all shards
  131. of an index. The http status code is left unchanged and is only based on failures that occurred while executing on
  132. primary shards.
  133. === Delete api with missing routing when required
  134. Delete api requires a routing value when deleting a document belonging to a type that has routing set to required in its
  135. mapping, whereas previous elasticsearch versions would trigger a broadcast delete on all shards belonging to the index.
  136. A `RoutingMissingException` is now thrown instead.
  137. === Mappings
  138. * The setting `index.mapping.allow_type_wrapper` has been removed. Documents should always be sent without the type as the root element.
  139. * The delete mappings API has been removed. Mapping types can no longer be deleted.
  140. * Mapping type names can no longer start with dots.
  141. * The `ignore_conflicts` option of the put mappings API has been removed. Conflicts can't be ignored anymore.
  142. * The `binary` field does not support the `compress` and `compress_threshold` options anymore.
  143. ==== Removed type prefix on field names in queries
  144. Types can no longer be specified on fields within queries. Instead, specify type restrictions in the search request.
  145. The following is an example query in 1.x over types `t1` and `t2`:
  146. [source,js]
  147. ---------------
  148. curl -XGET 'localhost:9200/index/_search'
  149. {
  150. "query": {
  151. "bool": {
  152. "should": [
  153. {"match": { "t1.field_only_in_t1": "foo" }},
  154. {"match": { "t2.field_only_in_t2": "bar" }}
  155. ]
  156. }
  157. }
  158. }
  159. ---------------
  160. In 2.0, the query should look like the following:
  161. [source,js]
  162. ---------------
  163. curl -XGET 'localhost:9200/index/t1,t2/_search'
  164. {
  165. "query": {
  166. "bool": {
  167. "should": [
  168. {"match": { "field_only_in_t1": "foo" }},
  169. {"match": { "field_only_in_t2": "bar" }}
  170. ]
  171. }
  172. }
  173. }
  174. ---------------
  175. ==== Removed short name field access
  176. Field names in queries, aggregations, etc. must now use the complete name. Use of the short name
  177. caused ambiguities in field lookups when the same name existed within multiple object mappings.
  178. The following example illustrates the difference between 1.x and 2.0.
  179. Given these mappings:
  180. [source,js]
  181. ---------------
  182. curl -XPUT 'localhost:9200/index'
  183. {
  184. "mappings": {
  185. "type": {
  186. "properties": {
  187. "name": {
  188. "type": "object",
  189. "properties": {
  190. "first": {"type": "string"},
  191. "last": {"type": "string"}
  192. }
  193. }
  194. }
  195. }
  196. }
  197. }
  198. ---------------
  199. The following query was possible in 1.x:
  200. [source,js]
  201. ---------------
  202. curl -XGET 'localhost:9200/index/type/_search'
  203. {
  204. "query": {
  205. "match": { "first": "foo" }
  206. }
  207. }
  208. ---------------
  209. In 2.0, the same query should now be:
  210. [source,js]
  211. ---------------
  212. curl -XGET 'localhost:9200/index/type/_search'
  213. {
  214. "query": {
  215. "match": { "name.first": "foo" }
  216. }
  217. }
  218. ---------------
  219. ==== Removed support for `.` in field name mappings
  220. Prior to Elasticsearch 2.0, a field could be defined to have a `.` in its name.
  221. Mappings like the one below have been deprecated for some time and they will be
  222. blocked in Elasticsearch 2.0.
  223. [source,js]
  224. ---------------
  225. curl -XPUT 'localhost:9200/index'
  226. {
  227. "mappings": {
  228. "type": {
  229. "properties": {
  230. "name.first": {
  231. "type": "string"
  232. }
  233. }
  234. }
  235. }
  236. }
  237. ---------------
  238. ==== Meta fields have limited configuration
  239. Meta fields (those beginning with underscore) are fields used by elasticsearch
  240. to provide special features. They now have limited configuration options.
  241. * `_id` configuration can no longer be changed. If you need to sort, use `_uid` instead.
  242. * `_type` configuration can no longer be changed.
  243. * `_index` configuration can no longer be changed.
  244. * `_routing` configuration is limited to requiring the field.
  245. * `_boost` has been removed.
  246. * `_field_names` configuration is limited to disabling the field.
  247. * `_size` configuration is limited to enabling the field.
  248. * `_timestamp` configuration is limited to enabling the field, setting format and default value
  249. ==== Meta fields in documents
  250. Meta fields can no longer be specified within a document. They should be specified
  251. via the API. For example, instead of adding a field `_parent` within a document,
  252. use the `parent` url parameter when indexing that document.
  253. ==== Default date format now is `strictDateOptionalTime`
  254. Instead of `dateOptionalTime` the new default date format now is `strictDateOptionalTime`,
  255. which is more strict in parsing dates. This means, that dates now need to have a four digit year,
  256. a two-digit month, day, hour, minute and second. This means, you may need to preprend a part of the date
  257. with a zero to make it conform or switch back to the old `dateOptionalTime` format.
  258. ==== Date format does not support unix timestamps by default
  259. In earlier versions of elasticsearch, every timestamp was always tried to be parsed as
  260. as unix timestamp first. This means, even when specifying a date format like
  261. `dateOptionalTime`, one could supply unix timestamps instead of a ISO8601 formatted
  262. date.
  263. This is not supported anymore. If you want to store unix timestamps, you need to specify
  264. the appropriate formats in the mapping, namely `epoch_second` or `epoch_millis`.
  265. In addition the `numeric_resolution` mapping parameter is ignored. Use the
  266. `epoch_second` and `epoch_millis` date formats instead.
  267. ==== Source field limitations
  268. The `_source` field could previously be disabled dynamically. Since this field
  269. is a critical piece of many features like the Update API, it is no longer
  270. possible to disable.
  271. The options for `compress` and `compress_threshold` have also been removed.
  272. The source field is already compressed. To minimize the storage cost,
  273. set `index.codec: best_compression` in index settings.
  274. ==== Boolean fields
  275. Boolean fields used to have a string fielddata with `F` meaning `false` and `T`
  276. meaning `true`. They have been refactored to use numeric fielddata, with `0`
  277. for `false` and `1` for `true`. As a consequence, the format of the responses of
  278. the following APIs changed when applied to boolean fields: `0`/`1` is returned
  279. instead of `F`/`T`:
  280. - <<search-request-fielddata-fields,fielddata fields>>
  281. - <<search-request-sort,sort values>>
  282. - <<search-aggregations-bucket-terms-aggregation,terms aggregations>>
  283. In addition, terms aggregations use a custom formatter for boolean (like for
  284. dates and ip addresses, which are also backed by numbers) in order to return
  285. the user-friendly representation of boolean fields: `false`/`true`:
  286. [source,js]
  287. ---------------
  288. "buckets": [
  289. {
  290. "key": 0,
  291. "key_as_string": "false",
  292. "doc_count": 42
  293. },
  294. {
  295. "key": 1,
  296. "key_as_string": "true",
  297. "doc_count": 12
  298. }
  299. ]
  300. ---------------
  301. ==== Murmur3 Fields
  302. Fields of type `murmur3` can no longer change `doc_values` or `index` setting.
  303. They are always stored with doc values, and not indexed.
  304. ==== Source field configuration
  305. The `_source` field no longer supports `includes` and `excludes` parameters. When
  306. `_source` is enabled, the entire original source will be stored.
  307. ==== Config based mappings
  308. The ability to specify mappings in configuration files has been removed. To specify
  309. default mappings that apply to multiple indexes, use index templates.
  310. The following settings are no longer valid:
  311. * `index.mapper.default_mapping_location`
  312. * `index.mapper.default_percolator_mapping_location`
  313. === Codecs
  314. It is no longer possible to specify per-field postings and doc values formats
  315. in the mappings. This setting will be ignored on indices created before
  316. elasticsearch 2.0 and will cause mapping parsing to fail on indices created on
  317. or after 2.0. For old indices, this means that new segments will be written
  318. with the default postings and doc values formats of the current codec.
  319. It is still possible to change the whole codec by using the `index.codec`
  320. setting. Please however note that using a non-default codec is discouraged as
  321. it could prevent future versions of Elasticsearch from being able to read the
  322. index.
  323. === Scripting settings
  324. Removed support for `script.disable_dynamic` node setting, replaced by
  325. fine-grained script settings described in the <<enable-dynamic-scripting,scripting docs>>.
  326. The following setting previously used to enable dynamic scripts:
  327. [source,yaml]
  328. ---------------
  329. script.disable_dynamic: false
  330. ---------------
  331. can be replaced with the following two settings in `elasticsearch.yml` that
  332. achieve the same result:
  333. [source,yaml]
  334. ---------------
  335. script.inline: on
  336. script.indexed: on
  337. ---------------
  338. === Script parameters
  339. Deprecated script parameters `id`, `file`, `scriptField`, `script_id`, `script_file`,
  340. `script`, `lang` and `params`. The <<modules-scripting,new script API syntax>> should be used in their place.
  341. The deprecated script parameters have been removed from the Java API so applications using the Java API will
  342. need to be updated.
  343. === Groovy scripts sandbox
  344. The groovy sandbox and related settings have been removed. Groovy is now a non
  345. sandboxed scripting language, without any option to turn the sandbox on.
  346. === Plugins making use of scripts
  347. Plugins that make use of scripts must register their own script context through
  348. `ScriptModule`. Script contexts can be used as part of fine-grained settings to
  349. enable/disable scripts selectively.
  350. === Thrift and memcached transport
  351. The thrift and memcached transport plugins are no longer supported. Instead, use
  352. either the HTTP transport (enabled by default) or the node or transport Java client.
  353. === `search_type=count` deprecation
  354. The `count` search type has been deprecated. All benefits from this search type can
  355. now be achieved by using the `query_then_fetch` search type (which is the
  356. default) and setting `size` to `0`.
  357. === The count api internally uses the search api
  358. The count api is now a shortcut to the search api with `size` set to 0. As a
  359. result, a total failure will result in an exception being returned rather
  360. than a normal response with `count` set to `0` and shard failures.
  361. === JSONP support
  362. JSONP callback support has now been removed. CORS should be used to access Elasticsearch
  363. over AJAX instead:
  364. [source,yaml]
  365. ---------------
  366. http.cors.enabled: true
  367. http.cors.allow-origin: /https?:\/\/localhost(:[0-9]+)?/
  368. ---------------
  369. === CORS allowed origins
  370. The CORS allowed origins setting, `http.cors.allow-origin`, no longer has a default value. Previously, the default value
  371. was `*`, which would allow CORS requests from any origin and is considered insecure. The `http.cors.allow-origin` setting
  372. should be specified with only the origins that should be allowed, like so:
  373. [source,yaml]
  374. ---------------
  375. http.cors.allow-origin: /https?:\/\/localhost(:[0-9]+)?/
  376. ---------------
  377. === Cluster state REST api
  378. The cluster state api doesn't return the `routing_nodes` section anymore when
  379. `routing_table` is requested. The newly introduced `routing_nodes` flag can
  380. be used separately to control whether `routing_nodes` should be returned.
  381. === Query DSL
  382. Change to ranking behaviour: single-term queries on numeric fields now score in the same way as string fields (use of IDF, norms if enabled).
  383. Previously, term queries on numeric fields were deliberately prevented from using the usual Lucene scoring logic and this behaviour was undocumented and, to some, unexpected.
  384. If the introduction of scoring to numeric fields is undesirable for your query clauses the fix is simple: wrap them in a `constant_score` or use a `filter` expression instead.
  385. The `filtered` query is deprecated. Instead you should use a `bool` query with
  386. a `must` clause for the query and a `filter` clause for the filter. For instance
  387. the below query:
  388. [source,js]
  389. ---------------
  390. {
  391. "filtered": {
  392. "query": {
  393. // query
  394. },
  395. "filter": {
  396. // filter
  397. }
  398. }
  399. }
  400. ---------------
  401. can be replaced with
  402. [source,js]
  403. ---------------
  404. {
  405. "bool": {
  406. "must": {
  407. // query
  408. },
  409. "filter": {
  410. // filter
  411. }
  412. }
  413. }
  414. ---------------
  415. and will produce the same scores.
  416. The `fuzzy_like_this` and `fuzzy_like_this_field` queries have been removed.
  417. The `limit` filter is deprecated and becomes a no-op. You can achieve similar
  418. behaviour using the <<search-request-body,terminate_after>> parameter.
  419. `or` and `and` on the one hand and `bool` on the other hand used to have
  420. different performance characteristics depending on the wrapped filters. This is
  421. fixed now, as a consequence the `or` and `and` filters are now deprecated in
  422. favour or `bool`.
  423. The `execution` option of the `terms` filter is now deprecated and ignored if
  424. provided.
  425. The `_cache` and `_cache_key` parameters of filters are deprecated in the REST
  426. layer and removed in the Java API. In case they are specified they will be
  427. ignored. Instead filters are always used as their own cache key and elasticsearch
  428. makes decisions by itself about whether it should cache filters based on how
  429. often they are used.
  430. Java plugins that register custom queries can do so by using the
  431. `IndicesQueriesModule#addQuery(Class<? extends QueryParser>)` method. Other
  432. ways to register custom queries are not supported anymore.
  433. ==== Query/filter merge
  434. Elasticsearch no longer makes a difference between queries and filters in the
  435. DSL; it detects when scores are not needed and automatically optimizes the
  436. query to not compute scores and optionally caches the result.
  437. As a consequence the `query` filter serves no purpose anymore and is deprecated.
  438. === Timezone for date field
  439. Specifying the `time_zone` parameter on queries or aggregations of `date` type fields
  440. must now be either an ISO 8601 UTC offset, or a timezone id. For example, the value
  441. `+1:00` must now be `+01:00`.
  442. === Snapshot and Restore
  443. Locations of the shared file system repositories and the URL repositories with `file:` URLs has to be now registered
  444. using `path.repo` setting. The `path.repo` setting can contain one or more repository locations:
  445. [source,yaml]
  446. ---------------
  447. path.repo: ["/mnt/daily", "/mnt/weekly"]
  448. ---------------
  449. If the repository location is specified as an absolute path it has to start with one of the locations
  450. specified in `path.repo`. If the location is specified as a relative path, it will be resolved against the first
  451. location specified in the `path.repo` setting.
  452. URL repositories with `http:`, `https:`, and `ftp:` URLs has to be whitelisted by specifying allowed URLs in the
  453. `repositories.url.allowed_urls` setting. This setting supports wildcards in the place of host, path, query, and
  454. fragment. For example:
  455. [source,yaml]
  456. -----------------------------------
  457. repositories.url.allowed_urls: ["http://www.example.org/root/*", "https://*.mydomain.com/*?*#*"]
  458. -----------------------------------
  459. The obsolete parameters `expand_wildcards_open` and `expand_wildcards_close` are no longer
  460. supported by the snapshot and restore operations. These parameters have been replaced by
  461. a single `expand_wildcards` parameter. See <<multi-index,the multi-index docs>> for more.
  462. === `_shutdown` API
  463. The `_shutdown` API has been removed without a replacement. Nodes should be managed via operating
  464. systems and the provided start/stop scripts.
  465. === Analyze API
  466. * The Analyze API return 0 as first Token's position instead of 1.
  467. * The `text()` method on `AnalyzeRequest` now returns `String[]` instead of `String`.
  468. === Multiple data.path striping
  469. Previously, if the `data.path` setting listed multiple data paths, then a
  470. shard would be ``striped'' across all paths by writing a whole file to each
  471. path in turn (in accordance with the `index.store.distributor` setting). The
  472. result was that the files from a single segment in a shard could be spread
  473. across multiple disks, and the failure of any one disk could corrupt multiple
  474. shards.
  475. This striping is no longer supported. Instead, different shards may be
  476. allocated to different paths, but all of the files in a single shard will be
  477. written to the same path.
  478. If striping is detected while starting Elasticsearch 2.0.0 or later, all of
  479. the files belonging to the same shard will be migrated to the same path. If
  480. there is not enough disk space to complete this migration, the upgrade will be
  481. cancelled and can only be resumed once enough disk space is made available.
  482. The `index.store.distributor` setting has also been removed.
  483. === Hunspell dictionary configuration
  484. The parameter `indices.analysis.hunspell.dictionary.location` has been removed,
  485. and `<path.conf>/hunspell` is always used.
  486. === Java API Transport API construction
  487. The `TransportClient` construction code has changed, it now uses the builder
  488. pattern. Instead of using:
  489. [source,java]
  490. --------------------------------------------------
  491. Settings settings = Settings.settingsBuilder()
  492. .put("cluster.name", "myClusterName").build();
  493. Client client = new TransportClient(settings);
  494. --------------------------------------------------
  495. Use:
  496. [source,java]
  497. --------------------------------------------------
  498. Settings settings = Settings.settingsBuilder()
  499. .put("cluster.name", "myClusterName").build();
  500. Client client = TransportClient.builder().settings(settings).build();
  501. --------------------------------------------------
  502. === Logging
  503. Log messages are now truncated at 10,000 characters. This can be changed in the
  504. `logging.yml` configuration file.
  505. [float]
  506. === Removed `top_children` query
  507. The `top_children` query has been removed in favour of the `has_child` query. The `top_children` query wasn't always faster
  508. than the `has_child` query and the `top_children` query was often inaccurate. The total hits and any aggregations in the
  509. same search request will likely be off if `top_children` was used.
  510. === Removed file based index templates
  511. Index templates can no longer be configured on disk. Use the `_template` API instead.
  512. [float]
  513. === Removed `id_cache` from stats apis
  514. Removed `id_cache` metric from nodes stats, indices stats and cluster stats apis. This metric has also been removed
  515. from the shards cat, indices cat and nodes cat apis. Parent/child memory is now reported under fielddata, because it
  516. has internally be using fielddata for a while now.
  517. To just see how much parent/child related field data is taking, the `fielddata_fields` option can be used on the stats
  518. apis. Indices stats example:
  519. [source,js]
  520. --------------------------------------------------
  521. curl -XGET "http://localhost:9200/_stats/fielddata?pretty&human&fielddata_fields=_parent"
  522. --------------------------------------------------
  523. Parent/child is using field data for the `_parent` field since version `1.1.0`, but the memory stats for the `_parent`
  524. field were still shown under `id_cache` metric in the stats apis for backwards compatible reasons between 1.x versions.
  525. Before version `1.1.0` the parent/child had its own in-memory data structures for id values in the `_parent` field.
  526. [float]
  527. === Removed `id_cache` from clear cache api
  528. Removed `id_cache` option from the clear cache apis. The `fielddata` option should be used to clear `_parent` field
  529. from fielddata.
  530. [float]
  531. === Highlighting
  532. The default value for the `require_field_match` option is `true` rather than
  533. `false`, meaning that the highlighters will take the fields that were queried
  534. into account by default. That means for instance that highlighting any field
  535. when querying the `_all` field will produce no highlighted snippets by default,
  536. given that the match was on the `_all` field only. Querying the same fields
  537. that need to be highlighted is the cleaner solution to get highlighted snippets
  538. back. Otherwise `require_field_match` option can be set to `false` to ignore
  539. field names completely when highlighting.
  540. The postings highlighter doesn't support the `require_field_match` option
  541. anymore, it will only highlight fields that were queried.
  542. The `match` query with type set to `match_phrase_prefix` is not supported by the
  543. postings highlighter. No highlighted snippets will be returned.
  544. [float]
  545. === Parent/child
  546. Parent/child has been rewritten completely to reduce memory usage and to execute
  547. `has_child` and `has_parent` queries faster and more efficient. The `_parent` field
  548. uses doc values by default. The refactored and improved implementation is only active
  549. for indices created on or after version 2.0.
  550. In order to benefit for all performance and memory improvements we recommend to reindex all
  551. indices that have the `_parent` field created before was upgraded to 2.0.
  552. The following breaks in backwards compatability have been made on indices with the `_parent` field
  553. created on or after clusters with version 2.0:
  554. * The `type` option on the `_parent` field can only point to a parent type that doesn't exist yet,
  555. so this means that an existing type/mapping can no longer become a parent type.
  556. * The `has_child` and `has_parent` queries can no longer be use in alias filters.
  557. === Meta fields returned under the top-level json object
  558. When selecting meta fields such as `_routing` or `_timestamp`, the field values
  559. are now directly put as a top-level property of the json objet, instead of being
  560. put under `fields` like regular stored fields.
  561. [source,sh]
  562. ---------------
  563. curl -XGET 'localhost:9200/test/_search?fields=_timestamp,foo'
  564. ---------------
  565. [source,js]
  566. ---------------
  567. {
  568. [...]
  569. "hits": {
  570. "total": 1,
  571. "max_score": 1,
  572. "hits": [
  573. {
  574. "_index": "test",
  575. "_type": "test",
  576. "_id": "1",
  577. "_score": 1,
  578. "_timestamp": 10000000,
  579. "fields": {
  580. "foo" : [ "bar" ]
  581. }
  582. }
  583. ]
  584. }
  585. }
  586. ---------------
  587. === Settings for resource watcher have been renamed
  588. The setting names for configuring the resource watcher have been renamed
  589. to prevent clashes with the watcher plugin
  590. * `watcher.enabled` is now `resource.reload.enabled`
  591. * `watcher.interval` is now `resource.reload.interval`
  592. * `watcher.interval.low` is now `resource.reload.interval.low`
  593. * `watcher.interval.medium` is now `resource.reload.interval.medium`
  594. * `watcher.interval.high` is now `resource.reload.interval.high`
  595. === Percolator stats
  596. Changed the `percolate.getTime` stat (total time spent on percolating) to `percolate.time` state.
  597. === Plugin Manager for official plugins
  598. Some of the elasticsearch official plugins have been moved to elasticsearch repository and will be released at the
  599. same time as elasticsearch itself, using the same version number.
  600. In that case, the plugin manager can now use a simpler form to identify an official plugin. Instead of:
  601. [source,sh]
  602. ---------------
  603. bin/plugin install elasticsearch/plugin_name/version
  604. ---------------
  605. You can use:
  606. [source,sh]
  607. ---------------
  608. bin/plugin install plugin_name
  609. ---------------
  610. The plugin manager will recognize this form and will be able to download the right version for your elasticsearch
  611. version.
  612. For older versions of elasticsearch, you still have to use the older form.
  613. For the record, official plugins which can use this new simplified form are:
  614. * elasticsearch-analysis-icu
  615. * elasticsearch-analysis-kuromoji
  616. * elasticsearch-analysis-phonetic
  617. * elasticsearch-analysis-smartcn
  618. * elasticsearch-analysis-stempel
  619. * elasticsearch-cloud-aws
  620. * elasticsearch-cloud-azure
  621. * elasticsearch-cloud-gce
  622. * elasticsearch-delete-by-query
  623. * elasticsearch-lang-javascript
  624. * elasticsearch-lang-python
  625. === `/bin/elasticsearch` version needs `-V` parameter
  626. Due to switching to elasticsearchs internal command line parsing
  627. infrastructure for the pluginmanager and the elasticsearch start up
  628. script, the `-v` parameter now stands for `--verbose`, where as `-V` or
  629. `--version` can be used to show the Elasticsearch version and exit.
  630. === `/bin/elasticsearch` dynamic parameters must come after static ones
  631. If you are setting configuration options like cluster name or node name via
  632. the commandline, you have to ensure, that the static options like pid file
  633. path or daemonizing always come first, like this
  634. ```
  635. /bin/elasticsearch -d -p /tmp/foo.pid --http.cors.enabled=true --http.cors.allow-origin='*'
  636. ```
  637. For a list of those static parameters, run `/bin/elasticsearch -h`
  638. === Aliases
  639. Fields used in alias filters no longer have to exist in the mapping upon alias creation time. Alias filters are now
  640. parsed at request time and then the fields in filters are resolved from the mapping, whereas before alias filters were
  641. parsed at alias creation time and the parsed form was kept around in memory.
  642. === _analyze API
  643. The `prefer_local` has been removed from the _analyze api. The _analyze api is a light operation and the caller shouldn't
  644. be concerned about whether it executes on the node that receives the request or another node.