POST /movie_index/_delete_by_query { "query": { "match_all": {} } }
#批量添加两个document POST /movie_index/movie/_bulk {"index":{"_id":66}} {"id":300,"name":"incident red sea","doubanScore":5.0,"actorList":[{"id":4,"name":"zhang cuishan"}]} {"index":{"_id":88}} {"id":300,"name":"incident red sea","doubanScore":5.0,"actorList":[{"id":4,"name":"zhang cuishan"}]}
POST /movie_index/movie/_bulk {"update":{"_id":"66"}} {"doc": { "name": "wudangshanshang" } } {"delete":{"_id":"88"}}
#------------------查询操作-------------------- #查询出当前索引中的全部数据 GET /movie_index/_search
GET /movie_index/_search?q=_id:66
#查询全部 GET /movie_index/_search { "query": { "match_all": {} } }
#根据电影的名称进行查询 GET /movie_index/_search { "query": { "match": { "name": "operation red sea" } } }
GET /movie_index
#按分词进行查询 GET /movie_index/_search { "query": { "match": { "actorList.name": "zhang han yu" } } }
#按短语查询 相当于like GET /movie_index/_search { "query": { "match_phrase": { "actorList.name": "zhang han yu" } } }
#不分词 通过精准匹配进行查询 term精准匹配 GET /movie_index/_search { "query": { "term": { "actorList.name.keyword":"zhang han yu" } } }