2.X/8. Breaking Changes

v2.0-05. CRUD and routing changes

drscg 2017. 10. 15. 17:56

Explicit custom routingedit

Custom routing values can no longer be extracted from the document body, but must be specified explicitly as part of the query string, or in the metadata line in the bulk API. See Type meta-fields for an example.

사용자 정의 routing value는 더 이상 document body에서 추출할 수 없다. query string의 일부 또는 bulk API에서 metadata line에 명시적으로 지정하해야 한다. Type meta-fields에서 예제를 볼 수 있다.

Routing hash functionedit

The default hash function that is used for routing has been changed from djb2 to murmur3. This change should be transparent unless you relied on very specific properties of djb2. This will help ensure a better balance of the document counts between shards.

routing을 위해 사용되는 기본적인 hash function은 djb2 에서 murmur3 로 변경되었다. 이 변경은 djb2에 매우 독특한 djb2 의 특성에 의존적이지 않다면, 알기 쉬울 것이다. 이것은 shard 사이의 document 수의 더 나은 균형을 제공한다.

In addition, the following routing-related node settings have been deprecated:

추가로, 다음의 routing 관련 node 설정이 deprecate 되었다.

cluster.routing.operation.hash.type

This was an undocumented setting that allowed to configure which hash function to use for routing. murmur3 is now enforced on new indices.

routing에 어떤 hash function을 사용할 것인가를 설정할 수 있는 undocumented 설정이었다. 이제 새로운 indices에는 murmur3 가 강제로 적용된다.

cluster.routing.operation.use_type

This was an undocumented setting that allowed to take the _type of the document into account when computing its shard (default: false). false is now enforced on new indices.

document의 shard를 계산할 때, document의 _type 을 고려하도록 하는 undocumented 설정(default: false)이었다. 이제 새로운 indices에는 false 가 무조건 적용된다.

Delete API with custom routingedit

The delete API used to be broadcast to all shards in the index which meant that, when using custom routing, the routing parameter was optional. Now, the delete request is forwarded only to the shard holding the document. If you are using custom routing then you should specify the routingvalue when deleting a document, just as is already required for the indexcreate, and update APIs.

사용자 정의 routing을 사용할 경우, delete API가 index의 모든 shard로 전달되는 것은 routing 매개변수가 선택적이라는 것을 의미한다. 이제 delete request는 document를 가지고 있는 shard에게만 전달된다. 사용자 정의 routing을 사용하려면, document를 삭제하는 경우, 기존의 indexcreateupdate API와 마찬가지로, routing value를 명시해야 한다.

To make sure that you never forget a routing value, make routing required with the following mapping:

routing value를 빠뜨리지 않도록, 아래 mapping처럼, routing을 필수 값으로 만들 수 있다.

PUT my_index
{
  "mappings": {
    "my_type": {
      "_routing": {
        "required": true
      }
    }
  }
}

All stored meta-fields returned by defaultedit

Previously, meta-fields like _routing_timestamp, etc would only be included in a GET request if specifically requested with the fields parameter. Now, all meta-fields which have stored values will be returned by default. Additionally, they are now returned at the top level (along with _index_type, and _id) instead of in the fields element.

이전 버전에서, _routing_timestamp 등과 같은 meta-fields는 fields 매개변수로 특별히 요청하는 경우에만, GET request에 포함되었다. 이제, 저장되어 있는 모든 meta-fields 값은 기본적으로 return된다. 추가로, 이들 값은 fields 요소 대신, _index_type_id 와 함께 top level에서 return 된다.

For instance, the following request:

예를 들어, 다음 request는

GET /my_index/my_type/1

might return:

{
  "_index":     "my_index",
  "_type":      "my_type",
  "_id":        "1",
  "_timestamp": 10000000, 
  "_source": {
    "foo" : [ "bar" ]
  }
}

The _timestamp is returned by default, and at the top level.

Async replicationedit

The replication parameter has been removed from all CRUD operations (indexcreateupdatedeletebulk) as it interfered with the synced flush feature. These operations are now synchronous only and a request will only return once the changes have been replicated to all active shards in the shard group.

replication parameter는 synced flush 기능에 방해가 되는, 모든 CURD(indexcreateupdatedeletebulk)에서 제거되었다. 이들 연산은 이제 동기적으로만 동작하고, request는 해당 변경이 shard group의 모든 active shard에 replicate될 경우에만 return 된다.

Instead, use more client processes to send more requests in parallel.

대신에, 더 많은 request를 보내기 위해, 병렬로 더 많은 client process를 사용하자.

Documents must be specified without a type wrapperedit

Previously, the document body could be wrapped in another object with the name of the type:

이전 버전에서, document body는 type 의 name을 가진 또 다른 object로 감쌀 수 있었다.

PUT my_index/my_type/1
{
  "my_type": { 
    "text": "quick brown fox"
  }
}

이 my_type 은 document 자체의 일부가 아니다. 단지 document type을 나타낸다.

This feature was deprecated before but could be reenabled with the mapping.allow_type_wrapperindex setting. This setting is no longer supported. The above document should be indexed as follows:

이 기능은 이전에 deprecate되었으나, index 설정에서 mapping.allow_type_wrapper 로 다시 활성화시킬 수 있었다. 이 설정은 더 이상 지원되지 않는다. 위의 document는 다음과 같이 index된다.

PUT my_index/my_type/1
{
  "text": "quick brown fox"
}

Term Vectors APIedit

Usage of /_termvector is deprecated in favor of /_termvectors.

/_termvector 의 사용은 /_termvectors 를 위하여 deprecate되었다.


'2.X > 8. Breaking Changes' 카테고리의 다른 글

v2.0-03. Multiple path.data striping  (0) 2017.10.15
v2.0-04. Mapping changes  (0) 2017.10.15
v2.0-06. Query DSL changes  (0) 2017.10.14
v2.0-07. Search changes  (0) 2017.10.14
v2.0-08. Aggregation changes  (0) 2017.10.14