1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Elastic Search入門

Posted at
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:{}}}}
mapping
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?