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.

Elasticsearch: Httpie でアクセス

Last updated at Posted at 2022-03-21

こちらのサンプルのクライアントを curl から Httpie に変えてみました。
Elasticsearch へのデータ投入

データを投入

go_insert.sh
http PUT http://localhost:9200/blog/_doc/t001 < in01.json
http PUT http://localhost:9200/blog/_doc/t002 < in02.json
http PUT http://localhost:9200/blog/_doc/t003 < in03.json
in01.json
{
	"name": "山本太郎",
	"title": "My Name Is Yamamoto",
	"content": "I love dog",
	"tags": ["red", "green", "blue"]
}
in02.json
{
	"name": "田中康夫",
	"title": "My Name Is Tanaka",
	"content": "I love cat",
	"tags": ["Earth", "Moon", "Mars"]
}
in03.json
{
	"name": "渡辺五郎",
	"title": "My Name Is Watanabe",
	"content": "I love fish",
	"tags": ["apple", "orange", "banana"]
}

データ数のカウント

http http://localhost:9200/blog/_count?q=*

検索

http http://localhost:9200/blog/_search?q=title:yamamoto
http http://localhost:9200/blog/_search?q=tags:apple,moon

削除

http DELETE http://localhost:9200/blog
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?