본문 바로가기

Elasticsearch3

python 자주 사용하는 elasticsearch query 모음 (1) 준비 # es 라이브러리 연결 import elasticsearch # es 서버 연결 es = elasticsearch.Elasticsearch("localhost:9200") search / 조건부 값 찾기 (여러개, 단일은 get) # index와 doctype 이름은 company # 'username':advertiser_name 일치하는 값 모두 찾기. body = { "query": { "query_string": { "default_field": "username", "query": advertiser_name } } } t = es.search(index='complete', doc_type='complete', id=store_id, body=body) update_by_query / .. 2020. 1. 20.
Elasticsearch 7.x버전 내보내기(export), 가져오기(import) 그리고 503 search_phase_execution_exception 에러 해결 하는 방법. elasticsearch 스냅샷 내보내기 & 가져오기 우선 버전 일치 해주는걸 권장. 그래서 우선 내보내는 곳(서버) elasticsearch 버전확인 CURL -XGET 'localhost:9200' os ubuntu 18.x / mac kibana-alpha2 7.0.0 서버 elasticsearch, alpha2 { "name" : "mrdoochiel.cafe24.com", "cluster_name" : "elasticsearch", "cluster_uuid" : "NbgIm8b4SA2G0ziZx8qFIQ", "version" : { "number" : "7.0.0-alpha2", "build_flavor" : "default", "build_type" : "deb", "build_hash" : .. 2019. 9. 9.
[python/elasitcsearch] 파이썬 elasticsearch(일래스틱서치) 라이브러리 사용하기 # python elasticsearch 설치 - 설치 및 사용 요약 1. pip로 elasticsearch 설치 - 터미널 창에 다음 명령어를 입력후 실행하면, 간단하게 설치 완료됨. [$ pip install elasticsearch ] 또는[$ pip3 install elasticsearch ] 2. import import elasticsearch from elasticsearch import helpers 3. 사용 준비 및 확인 es_client = elasticsearch.Elasticsearch(“localhost:9200”) print (es_client.info()) 4. insert es_client.index(index='test_index', doc_type=folder, body.. 2019. 1. 9.