본문 바로가기

Program

ElasticSearch 쿼리

반응형

여러행 동시 업데이트

 

MySQL

 

UPDATE index SET 필드명A="변경값" WHERE 필드명A="기존값"

 

ElasticSearch

 

http://IP:9200/index/type/_update_by_query
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "필드명A": "기존값"
          }
        }
      ]
    }
  },
  "script": {
    "source": "ctx._source['필드명A'] = '변경값'"
  }
}

 

반응형

'Program' 카테고리의 다른 글

Python MySQL 사용법  (0) 2020.11.23
CentOS Python 3.6 설치  (0) 2018.09.03
CentOS7에 ElasticSearch 설치하기  (0) 2018.06.05
CentOS 기본명령어  (0) 2018.06.05
CentOS7 Service 만들기  (0) 2018.05.11