| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
- catalina log
- git
- 배열스트링
- MySQL
- Spring Boot
- log4j2
- between 날짜
- oracle
- log4j profile
- Spring
- ORACLE CLOUD
- 라즈베리파이
- between date
- template
- github
- python 개발환경
- hikaricp
- intellij
- Spring Security
- bitbucket
- oracle between
- ubuntu
- Linux
- hikari
- STS
- datasource
- springboot
- Gradle
- mybatis
- Java
- Today
- Total
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
- catalina log
- git
- 배열스트링
- MySQL
- Spring Boot
- log4j2
- between 날짜
- oracle
- log4j profile
- Spring
- ORACLE CLOUD
- 라즈베리파이
- between date
- template
- github
- python 개발환경
- hikaricp
- intellij
- Spring Security
- bitbucket
- oracle between
- ubuntu
- Linux
- hikari
- STS
- datasource
- springboot
- Gradle
- mybatis
- Java
- Today
- Total
파워노트
Elasticsearch 사용법 본문
##### index 생성
curl -XPUT 'localhost:9200/customer?pretty'
#index 생성 및 id document 생성
curl -XPOST 'localhost:9200/customer2/info/1?pretty' -H 'Content-Type: application/json' -d '{
"name": "victolee"
}'
# id 가 없는 경우 임의의 id 생성
curl -XPOST 'localhost:9200/customer2/info?pretty' -H 'Content-Type: application/json' -d '{
"name": "victolee2"
}'
# File생성이후 File load하여 document 생성.
vi data.json
{
"name": "victory",
"address": "경기도",
"phone": "010-123-1234",
"reg_date": "2019-03-31"
}
curl -XPOST 'localhost:9200/customer2/info/2?pretty' -H 'Content-Type: application/json' -d data.json
##### Document 조회
# index로 조회
curl -XGET 'localhost:9200/customer2/_search?pretty'
# type으로 조회
curl -XGET 'localhost:9200/customer2/info/_search?pretty'
# id으로 조회
curl -XGET 'localhost:9200/customer2/info/1?pretty'
# 모든 Document 조회 (_all)
curl -XGET 'localhost:9200/_all/_search?pretty'
# 조건조회
curl -XGET 'localhost:9200/customer2/info/1?pretty&filter_path=_source'
curl -XGET 'localhost:9200/customer2/info/1?pretty&filter_path=_source.name'
###### Update
curl -XPUT 'localhost:9200/customer2/info/1?pretty' -H 'Content-Type: application/json' -d '{
"name": "victolee_update"
}'
###### 삭제
# id로 document 삭제
curl -XDELETE 'localhost:9200/customer2/info/1?pretty'
# index 삭제
curl -XDELETE 'localhost:9200/customer2?pretty'
참고 URL : victorydntmd.tistory.com/312
'ElasticSearch' 카테고리의 다른 글
| bootstrap checks failed vm.max_map_count 관련 (0) | 2020.11.27 |
|---|---|
| logstash 기본 사용 (0) | 2020.11.26 |
| ElasticSearch index Mapping (0) | 2020.11.10 |
| ElasticSearch max_result_window 설정 (0) | 2020.11.10 |