0
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 Cloud の使い方

Last updated at Posted at 2022-03-29

Elastic Cloud に次のようなデータがある時の使用例です。
このデータは、デジタル庁の都道府県別接種回数詳細(NDJSON) をJSON に変換して取り込んだものです。
elastic01.png

query01.json
{
  "query": "F",
  "page": {"size": 2}
}

curl

go_curl.sh
HOST="https://mar29-project.ent.asia-northeast1.gcp.cloud.es.io"
KEY="search-******"
NAME_ENGINE="vaccine-mar29"
#
URL=$HOST"/api/as/v1/engines/"$NAME_ENGINE"/search"
#
curl -X POST $URL \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer '$KEY \
        -d@query01.json

Httpie

HOST="https://mar29-project.ent.asia-northeast1.gcp.cloud.es.io"
KEY="search-*****"
NAME_ENGINE="vaccine-mar29"
#
URL=$HOST'/api/as/v1/engines/'$NAME_ENGINE'/search'
#
http POST $URL 'Authorization: Bearer '$KEY < query01.json

Query の例

query04.json
{
  "query": 'age: "-64"',
  "page": {"size": 5}
}
0
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
0
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?