Skip to content

ss49919201/es-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

セットアップ

Elasticsearchのみ

./init.sh
./clean.sh

Elasticsearch + Kibana

https://qiita.com/nobutaka/items/6308ea3bfd0aa0c58fdb

docker-compose up -d

クエリ

※6系以降 Content-Type 必須

ヘルスチェック

curl 'http://localhost:9200/_cluster/health?pretty=true'

マッピングの作成

  • PUT or POST
  • https://{エンドポイント}/{index名}
  • mapping.json

マッピングの確認

  • GET
  • https://{エンドポイント}/{index名}/{type名}/_mapping

サンプルデータ

  • PUT or POST
  • https://{エンドポイント}/{index名}/{type名}
  • sample_doc.json
curl -H "Content-Type: application/json" -XPOST localhost:9200/index/type --data-binary @sample_doc_2.json

自動マッピングの禁止

  • PUT or POST
  • https://{エンドポイント}/{index名}/_mapping
  • dynamic_strict.json

検索

  • GET or POST
  • https://{エンドポイント}/{検索対象index名}/_search
  • https://{エンドポイント}/{検索対象index名,検索対象index名}/_search
  • https://{エンドポイント}/{検索対象index名*}/_search
  • https://{エンドポイント}/_search
  • query.json
curl -H "Content-Type: application/json" -XGET localhost:9200/index/_search -d @match_all.json
curl -H "Content-Type: application/json" -XGET localhost:9200/index/_search -d @random_score.json

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published