른록노트

[Elasticsearch] Array필드에 push하는방법 본문

DB/[Elasticsearch]

[Elasticsearch] Array필드에 push하는방법

른록 2017. 9. 12. 10:07

script를 사용해서 add해주는 방법

{

  "script": "if (ctx._source.USER_ID== null) {ctx._source.USER_ID= new ArrayList();}ctx._source.USER_ID.add(\"hohoho\")",

  "params": {

  }

}




참고사이트

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html

https://discuss.elastic.co/t/how-to-update-a-object-within-array-in-elastic-search/20115/9


https://github.com/elastic/elasticsearch/issues/21026

반응형
Comments