migrate_2_0.asciidoc 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  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, delete-by-query). 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. * The `ignore_conflicts` option of the put mappings API has been removed. Conflicts can't be ignored anymore.
  141. * The `binary` field does not support the `compress` and `compress_threshold` options anymore.
  142. ==== Removed type prefix on field names in queries
  143. Types can no longer be specified on fields within queries. Instead, specify type restrictions in the search request.
  144. The following is an example query in 1.x over types `t1` and `t2`:
  145. [source,js]
  146. ---------------
  147. curl -XGET 'localhost:9200/index/_search'
  148. {
  149. "query": {
  150. "bool": {
  151. "should": [
  152. {"match": { "t1.field_only_in_t1": "foo" }},
  153. {"match": { "t2.field_only_in_t2": "bar" }}
  154. ]
  155. }
  156. }
  157. }
  158. ---------------
  159. In 2.0, the query should look like the following:
  160. [source,js]
  161. ---------------
  162. curl -XGET 'localhost:9200/index/t1,t2/_search'
  163. {
  164. "query": {
  165. "bool": {
  166. "should": [
  167. {"match": { "field_only_in_t1": "foo" }},
  168. {"match": { "field_only_in_t2": "bar" }}
  169. ]
  170. }
  171. }
  172. }
  173. ---------------
  174. ==== Removed short name field access
  175. Field names in queries, aggregations, etc. must now use the complete name. Use of the short name
  176. caused ambiguities in field lookups when the same name existed within multiple object mappings.
  177. The following example illustrates the difference between 1.x and 2.0.
  178. Given these mappings:
  179. [source,js]
  180. ---------------
  181. curl -XPUT 'localhost:9200/index'
  182. {
  183. "mappings": {
  184. "type": {
  185. "properties": {
  186. "name": {
  187. "type": "object",
  188. "properties": {
  189. "first": {"type": "string"},
  190. "last": {"type": "string"}
  191. }
  192. }
  193. }
  194. }
  195. }
  196. }
  197. ---------------
  198. The following query was possible in 1.x:
  199. [source,js]
  200. ---------------
  201. curl -XGET 'localhost:9200/index/type/_search'
  202. {
  203. "query": {
  204. "match": { "first": "foo" }
  205. }
  206. }
  207. ---------------
  208. In 2.0, the same query should now be:
  209. [source,js]
  210. ---------------
  211. curl -XGET 'localhost:9200/index/type/_search'
  212. {
  213. "query": {
  214. "match": { "name.first": "foo" }
  215. }
  216. }
  217. ---------------
  218. ==== Meta fields have limited configuration
  219. Meta fields (those beginning with underscore) are fields used by elasticsearch
  220. to provide special features. They now have limited configuration options.
  221. * `_id` configuration can no longer be changed. If you need to sort, use `_uid` instead.
  222. * `_type` configuration can no longer be changed.
  223. * `_index` configuration is limited to enabling the field.
  224. * `_routing` configuration is limited to requiring the field.
  225. * `_boost` has been removed.
  226. * `_field_names` configuration is limited to disabling the field.
  227. * `_size` configuration is limited to enabling the field.
  228. * `_timestamp` configuration is limited to enabling the field, setting format and default value
  229. ==== Meta fields in documents
  230. Meta fields can no longer be specified within a document. They should be specified
  231. via the API. For example, instead of adding a field `_parent` within a document,
  232. use the `parent` url parameter when indexing that document.
  233. ==== Default date format now is `strictDateOptionalTime`
  234. Instead of `dateOptionalTime` the new default date format now is `strictDateOptionalTime`,
  235. which is more strict in parsing dates. This means, that dates now need to have a four digit year,
  236. a two-digit month, day, hour, minute and second. This means, you may need to preprend a part of the date
  237. with a zero to make it conform or switch back to the old `dateOptionalTime` format.
  238. ==== Date format does not support unix timestamps by default
  239. In earlier versions of elasticsearch, every timestamp was always tried to be parsed as
  240. as unix timestamp first. This means, even when specifying a date format like
  241. `dateOptionalTime`, one could supply unix timestamps instead of a ISO8601 formatted
  242. date.
  243. This is not supported anymore. If you want to store unix timestamps, you need to specify
  244. the appropriate formats in the mapping, namely `epoch_second` or `epoch_millis`.
  245. In addition the `numeric_resolution` mapping parameter is ignored. Use the
  246. `epoch_second` and `epoch_millis` date formats instead.
  247. ==== Source field limitations
  248. The `_source` field could previously be disabled dynamically. Since this field
  249. is a critical piece of many features like the Update API, it is no longer
  250. possible to disable.
  251. The options for `compress` and `compress_threshold` have also been removed.
  252. The source field is already compressed. To minimize the storage cost,
  253. set `index.codec: best_compression` in index settings.
  254. ==== Boolean fields
  255. Boolean fields used to have a string fielddata with `F` meaning `false` and `T`
  256. meaning `true`. They have been refactored to use numeric fielddata, with `0`
  257. for `false` and `1` for `true`. As a consequence, the format of the responses of
  258. the following APIs changed when applied to boolean fields: `0`/`1` is returned
  259. instead of `F`/`T`:
  260. - <<search-request-fielddata-fields,fielddata fields>>
  261. - <<search-request-sort,sort values>>
  262. - <<search-aggregations-bucket-terms-aggregation,terms aggregations>>
  263. In addition, terms aggregations use a custom formatter for boolean (like for
  264. dates and ip addresses, which are also backed by numbers) in order to return
  265. the user-friendly representation of boolean fields: `false`/`true`:
  266. [source,js]
  267. ---------------
  268. "buckets": [
  269. {
  270. "key": 0,
  271. "key_as_string": "false",
  272. "doc_count": 42
  273. },
  274. {
  275. "key": 1,
  276. "key_as_string": "true",
  277. "doc_count": 12
  278. }
  279. ]
  280. ---------------
  281. ==== Murmur3 Fields
  282. Fields of type `murmur3` can no longer change `doc_values` or `index` setting.
  283. They are always stored with doc values, and not indexed.
  284. ==== Source field configuration
  285. The `_source` field no longer supports `includes` and `excludes` parameters. When
  286. `_source` is enabled, the entire original source will be stored.
  287. ==== Config based mappings
  288. The ability to specify mappings in configuration files has been removed. To specify
  289. default mappings that apply to multiple indexes, use index templates.
  290. The following settings are no longer valid:
  291. * `index.mapper.default_mapping_location`
  292. * `index.mapper.default_percolator_mapping_location`
  293. === Codecs
  294. It is no longer possible to specify per-field postings and doc values formats
  295. in the mappings. This setting will be ignored on indices created before
  296. elasticsearch 2.0 and will cause mapping parsing to fail on indices created on
  297. or after 2.0. For old indices, this means that new segments will be written
  298. with the default postings and doc values formats of the current codec.
  299. It is still possible to change the whole codec by using the `index.codec`
  300. setting. Please however note that using a non-default codec is discouraged as
  301. it could prevent future versions of Elasticsearch from being able to read the
  302. index.
  303. === Scripting settings
  304. Removed support for `script.disable_dynamic` node setting, replaced by
  305. fine-grained script settings described in the <<enable-dynamic-scripting,scripting docs>>.
  306. The following setting previously used to enable dynamic scripts:
  307. [source,yaml]
  308. ---------------
  309. script.disable_dynamic: false
  310. ---------------
  311. can be replaced with the following two settings in `elasticsearch.yml` that
  312. achieve the same result:
  313. [source,yaml]
  314. ---------------
  315. script.inline: on
  316. script.indexed: on
  317. ---------------
  318. === Script parameters
  319. Deprecated script parameters `id`, `file`, `scriptField`, `script_id`, `script_file`,
  320. `script`, `lang` and `params`. The <<modules-scripting,new script API syntax>> should be used in their place.
  321. The deprecated script parameters have been removed from the Java API so applications using the Java API will
  322. need to be updated.
  323. === Groovy scripts sandbox
  324. The groovy sandbox and related settings have been removed. Groovy is now a non
  325. sandboxed scripting language, without any option to turn the sandbox on.
  326. === Plugins making use of scripts
  327. Plugins that make use of scripts must register their own script context through
  328. `ScriptModule`. Script contexts can be used as part of fine-grained settings to
  329. enable/disable scripts selectively.
  330. === Thrift and memcached transport
  331. The thrift and memcached transport plugins are no longer supported. Instead, use
  332. either the HTTP transport (enabled by default) or the node or transport Java client.
  333. === `search_type=count` deprecation
  334. The `count` search type has been deprecated. All benefits from this search type can
  335. now be achieved by using the `query_then_fetch` search type (which is the
  336. default) and setting `size` to `0`.
  337. === The count api internally uses the search api
  338. The count api is now a shortcut to the search api with `size` set to 0. As a
  339. result, a total failure will result in an exception being returned rather
  340. than a normal response with `count` set to `0` and shard failures.
  341. === JSONP support
  342. JSONP callback support has now been removed. CORS should be used to access Elasticsearch
  343. over AJAX instead:
  344. [source,yaml]
  345. ---------------
  346. http.cors.enabled: true
  347. http.cors.allow-origin: /https?:\/\/localhost(:[0-9]+)?/
  348. ---------------
  349. === CORS allowed origins
  350. The CORS allowed origins setting, `http.cors.allow-origin`, no longer has a default value. Previously, the default value
  351. was `*`, which would allow CORS requests from any origin and is considered insecure. The `http.cors.allow-origin` setting
  352. should be specified with only the origins that should be allowed, like so:
  353. [source,yaml]
  354. ---------------
  355. http.cors.allow-origin: /https?:\/\/localhost(:[0-9]+)?/
  356. ---------------
  357. === Cluster state REST api
  358. The cluster state api doesn't return the `routing_nodes` section anymore when
  359. `routing_table` is requested. The newly introduced `routing_nodes` flag can
  360. be used separately to control whether `routing_nodes` should be returned.
  361. === Query DSL
  362. 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).
  363. 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.
  364. 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.
  365. The `filtered` query is deprecated. Instead you should use a `bool` query with
  366. a `must` clause for the query and a `filter` clause for the filter. For instance
  367. the below query:
  368. [source,js]
  369. ---------------
  370. {
  371. "filtered": {
  372. "query": {
  373. // query
  374. },
  375. "filter": {
  376. // filter
  377. }
  378. }
  379. }
  380. ---------------
  381. can be replaced with
  382. [source,js]
  383. ---------------
  384. {
  385. "bool": {
  386. "must": {
  387. // query
  388. },
  389. "filter": {
  390. // filter
  391. }
  392. }
  393. }
  394. ---------------
  395. and will produce the same scores.
  396. The `fuzzy_like_this` and `fuzzy_like_this_field` queries have been removed.
  397. The `limit` filter is deprecated and becomes a no-op. You can achieve similar
  398. behaviour using the <<search-request-body,terminate_after>> parameter.
  399. `or` and `and` on the one hand and `bool` on the other hand used to have
  400. different performance characteristics depending on the wrapped filters. This is
  401. fixed now, as a consequence the `or` and `and` filters are now deprecated in
  402. favour or `bool`.
  403. The `execution` option of the `terms` filter is now deprecated and ignored if
  404. provided.
  405. The `_cache` and `_cache_key` parameters of filters are deprecated in the REST
  406. layer and removed in the Java API. In case they are specified they will be
  407. ignored. Instead filters are always used as their own cache key and elasticsearch
  408. makes decisions by itself about whether it should cache filters based on how
  409. often they are used.
  410. Java plugins that register custom queries can do so by using the
  411. `IndicesQueriesModule#addQuery(Class<? extends QueryParser>)` method. Other
  412. ways to register custom queries are not supported anymore.
  413. ==== Query/filter merge
  414. Elasticsearch no longer makes a difference between queries and filters in the
  415. DSL; it detects when scores are not needed and automatically optimizes the
  416. query to not compute scores and optionally caches the result.
  417. As a consequence the `query` filter serves no purpose anymore and is deprecated.
  418. === Snapshot and Restore
  419. Locations of the shared file system repositories and the URL repositories with `file:` URLs has to be now registered
  420. using `path.repo` setting. The `path.repo` setting can contain one or more repository locations:
  421. [source,yaml]
  422. ---------------
  423. path.repo: ["/mnt/daily", "/mnt/weekly"]
  424. ---------------
  425. If the repository location is specified as an absolute path it has to start with one of the locations
  426. specified in `path.repo`. If the location is specified as a relative path, it will be resolved against the first
  427. location specified in the `path.repo` setting.
  428. URL repositories with `http:`, `https:`, and `ftp:` URLs has to be whitelisted by specifying allowed URLs in the
  429. `repositories.url.allowed_urls` setting. This setting supports wildcards in the place of host, path, query, and
  430. fragment. For example:
  431. [source,yaml]
  432. -----------------------------------
  433. repositories.url.allowed_urls: ["http://www.example.org/root/*", "https://*.mydomain.com/*?*#*"]
  434. -----------------------------------
  435. The obsolete parameters `expand_wildcards_open` and `expand_wildcards_close` are no longer
  436. supported by the snapshot and restore operations. These parameters have been replaced by
  437. a single `expand_wildcards` parameter. See <<multi-index,the multi-index docs>> for more.
  438. === `_shutdown` API
  439. The `_shutdown` API has been removed without a replacement. Nodes should be managed via operating
  440. systems and the provided start/stop scripts.
  441. === Analyze API
  442. * The Analyze API return 0 as first Token's position instead of 1.
  443. * The `text()` method on `AnalyzeRequest` now returns `String[]` instead of `String`.
  444. === Multiple data.path striping
  445. Previously, if the `data.path` setting listed multiple data paths, then a
  446. shard would be ``striped'' across all paths by writing a whole file to each
  447. path in turn (in accordance with the `index.store.distributor` setting). The
  448. result was that the files from a single segment in a shard could be spread
  449. across multiple disks, and the failure of any one disk could corrupt multiple
  450. shards.
  451. This striping is no longer supported. Instead, different shards may be
  452. allocated to different paths, but all of the files in a single shard will be
  453. written to the same path.
  454. If striping is detected while starting Elasticsearch 2.0.0 or later, all of
  455. the files belonging to the same shard will be migrated to the same path. If
  456. there is not enough disk space to complete this migration, the upgrade will be
  457. cancelled and can only be resumed once enough disk space is made available.
  458. The `index.store.distributor` setting has also been removed.
  459. === Hunspell dictionary configuration
  460. The parameter `indices.analysis.hunspell.dictionary.location` has been removed,
  461. and `<path.conf>/hunspell` is always used.
  462. === Java API Transport API construction
  463. The `TransportClient` construction code has changed, it now uses the builder
  464. pattern. Instead of using:
  465. [source,java]
  466. --------------------------------------------------
  467. Settings settings = Settings.settingsBuilder()
  468. .put("cluster.name", "myClusterName").build();
  469. Client client = new TransportClient(settings);
  470. --------------------------------------------------
  471. Use:
  472. [source,java]
  473. --------------------------------------------------
  474. Settings settings = Settings.settingsBuilder()
  475. .put("cluster.name", "myClusterName").build();
  476. Client client = TransportClient.builder().settings(settings).build();
  477. --------------------------------------------------
  478. === Logging
  479. Log messages are now truncated at 10,000 characters. This can be changed in the
  480. `logging.yml` configuration file.
  481. [float]
  482. === Removed `top_children` query
  483. The `top_children` query has been removed in favour of the `has_child` query. The `top_children` query wasn't always faster
  484. than the `has_child` query and the `top_children` query was often inaccurate. The total hits and any aggregations in the
  485. same search request will likely be off if `top_children` was used.
  486. === Removed file based index templates
  487. Index templates can no longer be configured on disk. Use the `_template` API instead.
  488. [float]
  489. === Removed `id_cache` from stats apis
  490. Removed `id_cache` metric from nodes stats, indices stats and cluster stats apis. This metric has also been removed
  491. from the shards cat, indices cat and nodes cat apis. Parent/child memory is now reported under fielddata, because it
  492. has internally be using fielddata for a while now.
  493. To just see how much parent/child related field data is taking, the `fielddata_fields` option can be used on the stats
  494. apis. Indices stats example:
  495. [source,js]
  496. --------------------------------------------------
  497. curl -XGET "http://localhost:9200/_stats/fielddata?pretty&human&fielddata_fields=_parent"
  498. --------------------------------------------------
  499. Parent/child is using field data for the `_parent` field since version `1.1.0`, but the memory stats for the `_parent`
  500. field were still shown under `id_cache` metric in the stats apis for backwards compatible reasons between 1.x versions.
  501. Before version `1.1.0` the parent/child had its own in-memory data structures for id values in the `_parent` field.
  502. [float]
  503. === Removed `id_cache` from clear cache api
  504. Removed `id_cache` option from the clear cache apis. The `fielddata` option should be used to clear `_parent` field
  505. from fielddata.
  506. [float]
  507. === Highlighting
  508. The default value for the `require_field_match` option is `true` rather than
  509. `false`, meaning that the highlighters will take the fields that were queried
  510. into account by default. That means for instance that highlighting any field
  511. when querying the `_all` field will produce no highlighted snippets by default,
  512. given that the match was on the `_all` field only. Querying the same fields
  513. that need to be highlighted is the cleaner solution to get highlighted snippets
  514. back. Otherwise `require_field_match` option can be set to `false` to ignore
  515. field names completely when highlighting.
  516. The postings highlighter doesn't support the `require_field_match` option
  517. anymore, it will only highlight fields that were queried.
  518. The `match` query with type set to `match_phrase_prefix` is not supported by the
  519. postings highlighter. No highlighted snippets will be returned.
  520. [float]
  521. === Parent/child
  522. Parent/child has been rewritten completely to reduce memory usage and to execute
  523. `has_child` and `has_parent` queries faster and more efficient. The `_parent` field
  524. uses doc values by default. The refactored and improved implementation is only active
  525. for indices created on or after version 2.0.
  526. In order to benefit for all performance and memory improvements we recommend to reindex all
  527. indices that have the `_parent` field created before was upgraded to 2.0.
  528. The following breaks in backwards compatability have been made on indices with the `_parent` field
  529. created on or after clusters with version 2.0:
  530. * The `type` option on the `_parent` field can only point to a parent type that doesn't exist yet,
  531. so this means that an existing type/mapping can no longer become a parent type.
  532. * The `has_child` and `has_parent` queries can no longer be use in alias filters.
  533. === Meta fields returned under the top-level json object
  534. When selecting meta fields such as `_routing` or `_timestamp`, the field values
  535. are now directly put as a top-level property of the json objet, instead of being
  536. put under `fields` like regular stored fields.
  537. [source,sh]
  538. ---------------
  539. curl -XGET 'localhost:9200/test/_search?fields=_timestamp,foo'
  540. ---------------
  541. [source,js]
  542. ---------------
  543. {
  544. [...]
  545. "hits": {
  546. "total": 1,
  547. "max_score": 1,
  548. "hits": [
  549. {
  550. "_index": "test",
  551. "_type": "test",
  552. "_id": "1",
  553. "_score": 1,
  554. "_timestamp": 10000000,
  555. "fields": {
  556. "foo" : [ "bar" ]
  557. }
  558. }
  559. ]
  560. }
  561. }
  562. ---------------
  563. === Settings for resource watcher have been renamed
  564. The setting names for configuring the resource watcher have been renamed
  565. to prevent clashes with the watcher plugin
  566. * `watcher.enabled` is now `resource.reload.enabled`
  567. * `watcher.interval` is now `resource.reload.interval`
  568. * `watcher.interval.low` is now `resource.reload.interval.low`
  569. * `watcher.interval.medium` is now `resource.reload.interval.medium`
  570. * `watcher.interval.high` is now `resource.reload.interval.high`
  571. === Percolator stats
  572. Changed the `percolate.getTime` stat (total time spent on percolating) to `percolate.time` state.
  573. === Plugin Manager for official plugins
  574. Some of the elasticsearch official plugins have been moved to elasticsearch repository and will be released at the
  575. same time as elasticsearch itself, using the same version number.
  576. In that case, the plugin manager can now use a simpler form to identify an official plugin. Instead of:
  577. [source,sh]
  578. ---------------
  579. bin/plugin install elasticsearch/plugin_name/version
  580. ---------------
  581. You can use:
  582. [source,sh]
  583. ---------------
  584. bin/plugin install plugin_name
  585. ---------------
  586. The plugin manager will recognize this form and will be able to download the right version for your elasticsearch
  587. version.
  588. For older versions of elasticsearch, you still have to use the older form.
  589. For the record, official plugins which can use this new simplified form are:
  590. * elasticsearch-analysis-icu
  591. * elasticsearch-analysis-kuromoji
  592. * elasticsearch-analysis-phonetic
  593. * elasticsearch-analysis-smartcn
  594. * elasticsearch-analysis-stempel
  595. * elasticsearch-cloud-aws
  596. * elasticsearch-cloud-azure
  597. * elasticsearch-cloud-gce
  598. * elasticsearch-delete-by-query
  599. * elasticsearch-lang-javascript
  600. * elasticsearch-lang-python
  601. === Aliases
  602. Fields used in alias filters no longer have to exist in the mapping upon alias creation time. Alias filters are now
  603. parsed at request time and then the fields in filters are resolved from the mapping, whereas before alias filters were
  604. parsed at alias creation time and the parsed form was kept around in memory.