1. test 이름을 가진 인덱스 조회하기
curl -XGET localhost:9200/test

2. 전체 인덱스 조회하기
curl -XGET localhost:9200/_cat/indices?v

3. test 이름을 가진 인덱스 생성하기
curl -XPUT localhost:9200/test?pretty

4. test 인덱스 조회하기
curl -XGET localhost:9200/test?pretty

5. test 인덱스의 1번 id에 "name: "kim", "age": 10 도큐먼트 입력해보기
curl -XPOST localhost:9200/test/info/1?pretty -H 'Content-Type: application/json' -d '
{
"name": "kim",
"age": 10
}
'

6. test 인덱스의 1번 id 조회해보기
curl -XGET localhost:9200/test/info/1?pretty

7. test인덱스의 1번 id의 _source만 출력해보기
curl -XGET 'localhost:9200/test/info/1?pretty&filter_path=_source'

8. test 인덱스의 1번 id에서 _source 안의 name 조회하기
curl -XGET 'localhost:9200/test/info/1?pretty&filter_path=_source.name'

9. test 인덱스의 1번 id에서 _source 안의 age 조회하기
curl -XGET 'localhost:9200/test/info/1?pretty&filter_path=_source.age'

10. test 인덱스의 2번 id에 "name": "park", "age": 20 입력해보기
curl -XPOST localhost:9200/test/info/2?pretty -H 'Content-Type: application/json' -d '
{
"name": "park",
"age": 20
}
'

11. test 인덱스 조회해보기
curl -XGET localhost:9200/test?pretty


12. test 인덱스의 도큐먼트 조회해보기
curl -XGET localhost:9200/test/_search?pretty


13. test 인덱스의 2번 id의 도큐먼트에서 "name": "lee", "age": 30 으로 수정해보기
curl -XPOST localhost:9200/test/info/2?pretty -H 'Content-Type: application/json' -d '
{
"name": "lee"
"age": 30
}
'

14. test 인덱스의 도큐먼트 조회해보기
curl -XGET localhost:9200/test/_search?pretty


15. 인덱스 전체 조회하기
curl -XGET localhost:9200/_cat/indices?v

16. test 인덱스 삭제하기
curl -XDELETE localhost:9200/test?pretty

17. 인덱스 전체 조회해보기
curl -XGET localhost:9200/_cat/indices?v

'Database > ElasticSearch' 카테고리의 다른 글
[elasticsearch] 엘라스틱서치 예제 및 문법 공부 5 (1) | 2021.06.11 |
---|---|
[elasticsearch] 엘라스틱서치 예제 및 문법 공부 4 (0) | 2021.06.09 |
[elasticsearch] 엘라스틱서치 예제 및 문법 공부 2 (0) | 2021.06.09 |
[elasticsearch] 엘라스틱서치 예제 및 문법 공부 1 (0) | 2021.06.08 |
[elasticsearch] 엘라스틱서치 실행하기 (0) | 2021.06.08 |
1. test 이름을 가진 인덱스 조회하기
curl -XGET localhost:9200/test

2. 전체 인덱스 조회하기
curl -XGET localhost:9200/_cat/indices?v

3. test 이름을 가진 인덱스 생성하기
curl -XPUT localhost:9200/test?pretty

4. test 인덱스 조회하기
curl -XGET localhost:9200/test?pretty

5. test 인덱스의 1번 id에 "name: "kim", "age": 10 도큐먼트 입력해보기
curl -XPOST localhost:9200/test/info/1?pretty -H 'Content-Type: application/json' -d '
{
"name": "kim",
"age": 10
}
'

6. test 인덱스의 1번 id 조회해보기
curl -XGET localhost:9200/test/info/1?pretty

7. test인덱스의 1번 id의 _source만 출력해보기
curl -XGET 'localhost:9200/test/info/1?pretty&filter_path=_source'

8. test 인덱스의 1번 id에서 _source 안의 name 조회하기
curl -XGET 'localhost:9200/test/info/1?pretty&filter_path=_source.name'

9. test 인덱스의 1번 id에서 _source 안의 age 조회하기
curl -XGET 'localhost:9200/test/info/1?pretty&filter_path=_source.age'

10. test 인덱스의 2번 id에 "name": "park", "age": 20 입력해보기
curl -XPOST localhost:9200/test/info/2?pretty -H 'Content-Type: application/json' -d '
{
"name": "park",
"age": 20
}
'

11. test 인덱스 조회해보기
curl -XGET localhost:9200/test?pretty


12. test 인덱스의 도큐먼트 조회해보기
curl -XGET localhost:9200/test/_search?pretty


13. test 인덱스의 2번 id의 도큐먼트에서 "name": "lee", "age": 30 으로 수정해보기
curl -XPOST localhost:9200/test/info/2?pretty -H 'Content-Type: application/json' -d '
{
"name": "lee"
"age": 30
}
'

14. test 인덱스의 도큐먼트 조회해보기
curl -XGET localhost:9200/test/_search?pretty


15. 인덱스 전체 조회하기
curl -XGET localhost:9200/_cat/indices?v

16. test 인덱스 삭제하기
curl -XDELETE localhost:9200/test?pretty

17. 인덱스 전체 조회해보기
curl -XGET localhost:9200/_cat/indices?v

'Database > ElasticSearch' 카테고리의 다른 글
[elasticsearch] 엘라스틱서치 예제 및 문법 공부 5 (1) | 2021.06.11 |
---|---|
[elasticsearch] 엘라스틱서치 예제 및 문법 공부 4 (0) | 2021.06.09 |
[elasticsearch] 엘라스틱서치 예제 및 문법 공부 2 (0) | 2021.06.09 |
[elasticsearch] 엘라스틱서치 예제 및 문법 공부 1 (0) | 2021.06.08 |
[elasticsearch] 엘라스틱서치 실행하기 (0) | 2021.06.08 |