2017-10-23 3 views
0

delete_by_query를 통해 ES에서 많은 수의 문서를 삭제하려고합니다. 하지만 다음과 같은 오류가 표시됩니다.쿼리로 레코드를 삭제할 때 ElasticSearch 오류가 발생했습니다.

쿼리

POST indexName/typeName/_delete_by_query 
{ 
    "size": 100000, 
    "query": { 
    "bool": { 
     "must": [ 
     { 
      "range": { 
      "CREATED_TIME": { 
       "gte": 0, 
       "lte": 1507316563000 
      } 
      } 
     } 
     ] 
    } 
    } 
} 

결과

{ 
    "took": 50489, 
    "timed_out": false, 
    "total": 100000, 
    "deleted": 0, 
    "batches": 1, 
    "version_conflicts": 1000, 
    "noops": 0, 
    "retries": { 
    "bulk": 0, 
    "search": 0 
    }, 
    "throttled_millis": 0, 
    "requests_per_second": -1, 
    "throttled_until_millis": 0, 
    "failures": [ 
    { 
     "index": "indexName", 
     "type": "typeName", 
     "id": "HVBLdzwnImXdVbq", 
     "cause": { 
     "type": "version_conflict_engine_exception", 
     "reason": "[typeName][HVBLdzwnImXdVbq]: version conflict, current version [2] is different than the one provided [1]", 
     "index_uuid": "YPJcVQZqQKqnuhbC9R7qHA", 
     "shard": "1", 
     "index": "indexName" 
     }, 
     "status": 409 
    },.... 

답변

1

this article을 읽어 보시기 바랍니다. 이 버전 충돌을 오히려 계산하려는 경우

:

당신은 버전 충돌을 무시하도록 URL를 설정하거나 버전 충돌을 무시하도록 쿼리을 설정함으로써이 문제를 처리하는 두 가지 방법이 요청이 중단되도록 유도 한 다음 URL에 conflicts=proceed을 설정하거나 요청 본문에 "conflicts": "proceed"을 설정하십시오.