2016-06-29 3 views
-1

저는 Elasticsearch에 처음 소개되었으므로 초보적인 것을 놓친다면 사과드립니다. 색인에서 문서 내의 필드를 업데이트하려고합니다.Elasticsearch [1.5.2] update_by_query가 예상대로 작동하지 않습니다.

POST test_index/_update_by_query 
{ 
    "query": { 
    "match": { 
     "label": { 
     "query": " checked", 
     "type": "phrase" 
     } 
    } 
    }, 
    "script": "ctx._source.status = 'ok'" 
} 

문서를 찾는 것처럼 보이지만 업데이트되지 않습니다. 권장 여기에 놀라운

내가 https://github.com/yakaz/elasticsearch-action-updatebyquery에서 플러그인을 설치 한
{ 
    "ok": true, 
    "took": 7531, 
    "total": 230954, 
    "updated": 0, 
    "indices": [ 
     { 
     "test_index": {} 
     } 
    ] 
} 

에서 출력됩니다. 어떤 도움이라도 대단히 감사 할 것입니다. 미리 감사드립니다 -

+0

elasticsearch 매핑을 게시 할 수 있습니까? –

+0

[동적 스크립팅 사용] (https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html#enable-dynamic-scripting)도 수행 했습니까? – Val

+0

@AkshayBijawe elasticsearch 매핑이 무슨 뜻인지 모르겠다. GET/test_index/_mappings의 출력입니까? – unam

답변

0

마지막으로 무슨 일이 일어나고 있는지 알아 냈습니다. .yml에 다른 행을 추가하여이 작업을 수행해야했습니다. 구성 파일에 추가 한 변경 사항은 다음과 같습니다.

script.inline: true 
script.indexed: true 
script.disable_dynamic: false 

3 번째 줄을 추가하면 차이가 있습니다. 도움이되는 의견에 감사드립니다.