Index
- 作成
curl -X PUT localhost:9200/index - 表示
curl localhost:9200/index - 削除
curl -X DELETE localhost:9200/index
DocData
- 追加
- curl -X POST localhost:9200/index/_doc/ -H "Content-Type: application/json" -d data
- id指定
- curl -X POST localhost:9200/index/_doc/id -H "Content-Type: application/json" -d data
- 表示
- curl localhost:9200/index/_doc/id
- curl localhost:9200/index/_search
- 修正
- curl -X POST localhost:9200/index/_doc/id -H "Content-Type: application/json" -d data
- curl -X POST localhost:9200/index/_doc/ -H "Content-Type: application/json" -d "{¥"doc¥":{filedname:value}}"
- 削除
- curl localhost:9200/index/_doc/id
検索
- curl localhost:9200/index/_search?q=filed:value
- curl localhost:9200/index/_search -H "Conten-Type: application/json" -d {query:{match:{filed:name}}}
- curl localhost:9200/index/_search -H "Conten-Type: application/json" -d {query:{match_all:{},from:0,size:10}}
- curl localhost:9200/index/_search -H "Conten-Type: application/json" -d {query:{match_all:{},from:0,size:10},_source:[filed:name],sort:{filed:{order:asc/desc}}}
複数条件検索
- and {query:{bool:{must:[{match:{filed:name}}]}}}
- or {query:bool:{should:[{match:{filed:name},{match:{filed:name}}}]}}
完全一致
- {query:{match_phrase:{filed:name}}}
higtlight
- {query:{match_phrase:{filed:name}},highlight:{fileds:{filed:{}}}}