(_update 명령어 사용)
curl -XPOST -H "Content-Type: application/json" http://localhost:9200/classes/class/1/_update?pretty -d '{"doc" : {"unit" : 2}}'
아래처럼 successful이 1 뜨면 성공
curl -XGET http://localhost:9200/classes/class/1
아래처럼 unit이 2로 업데이트 된 걸 확인 가능
unit에 10을 더하는 수식 입력
curl -XPOST -H "Content-Type: application/json" http://localhost:9200/classes/class/1/_update?pretty -d '{"script" : "ctx._source.unit += 5"}'
curl -XGET http://localhost:9200/classes/class/1
결과: 5가 더해져서 7로 업데이트된 것을 확인 가능