본문 바로가기

IT

[Elasticsearch] Elasticsearch In Action - 6 유사도 검색 6.1 일래스틱서치에서 점수를 계산하는 방법 #elasticsearch에서의 기본 점수 계산법은 TF-IDF를 기본으로 한다.이는 TF(Term Frequency - 텀의 빈도)의 제곱근 X IDF(Inverse Document Frequency - 텀에 대한 역 문서 빈도의 제곱)X norm(정규화 지수 : 단어의 길이에 반비례) * boost 이다. (p.243) 6.2 다른 점수 방법 #BM25 : 유사도 모듈을 반영 {"mappings" : {"get-together" : {"properties" : {"title" : "string","similarity" : "BM25"}}}} 6.3 부스팅 #색인 혹은 재색인시에 boost를 줄 수 있는데, 질의 시점에 부스팅을 사용하는걸 추천한다.(이유는 .. 더보기
[Elasticsearch] Analyzer #한글 형태소분석기- http://github.com/chanil1218/elasticsearch-analysis-korean- bin/plugin url https://dl-web.dropbox.com/spa/grpekzky9x5y6mc/elastic-analysis-korean/public/elasticsearch-analysis-korean-1.3.0.zip -install analysis-korean#은전한잎- http://bakyeono.net/post/2016-06-03-start-elasticsearch.html- bin/plugin install org.bitbucket.eunjeon/elasticsearch-analysis-seunjeon/2.3.3.0 더보기
[Elasticsearch] download url wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.2.tar.gz curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.1.tar.gz 더보기
[Elasticsearch] Monitoring Rest Api 1. 전체  cluster health 체크  http://localhost:9200/_cluster/health?pretty     status : green,yellow,red     active_primary_shards : primary shard 수     active_shards : primary + replica     initializing_shards : restart후 disk에서 읽은 shards 수     unassigned_shards : cluster노드에 수가 적든 무슨원인으로 아직 할당 못한 shard     number_of_pending_tasks : 아직 수행못한 변경  http://localhost:9200/_cluster/health?pretty&level=indic.. 더보기
[Elasticsearch] Elasticsearch In Action - 5 5.3 분석 API로 텍스트 분석하기 #settings #analyzer #tokenizer #mapping curl -XPOST 'localhost:9200/myindex?pretty' -d '{ "settings" : {"number_of_shards" : 2,"number_of_replicas" : 1,"index" : {"analysis" : {"analyzer" : {"myCustomAnalyzer" : {"type" : "custom","tokenizer" : "myCustomTokenizer","filter" : ["myCustomFilter1", "myCustomFilter2"],"char_filter" : ["myCustomCharFilter"]}},"tokenizer" : {"myCus.. 더보기
[Elasticsearch] Elasticsearch In Action - 3,4 3.3 배열과 다중 필드 3.3.1 배열 curl -XPUT 'localhost:9200/blog/posts/1' -d ' {"tags" : ["first", "initial"]}'# 배열 필드는 mapping에서 정의하지 않아도 된다. (알아서 해준다) 3.3.2 다중 필드 curl -XPUT 'localhost:9200/blog/_mapping/posts' -d '{"posts" : {"properties" : {"tags" : {"type" : "string","index" : "analyzed","filed" : {"verbatim" : {"type" : "string","index" : "not_analyzed"}}}}}}'# 문자열을 위한 다중 필드: 한 번은 analyzed, 다은 한 번은 .. 더보기
[config 설정] ##### elasticsearch.yml ##### cluster.name: 클러스터명node.name: 노드명 path.conf: 설정 파일 경로 (default: config/)path.data: 데이터 파일 경로 (default: data/path.work: 임시 작업 파일 경로path.logs: 로그 파일 경로 (default: logs/)path.plugins: 플러그인이 설치되는 경로 bootstrap.mlockall: 자바 가상머신이 엘라스틱서치가 사용하지 않는 메모리를 swap 하는것을 방지시킬 수 있다. (true/false)- true 권장- 시스템 전체 메모리의 50%가 넘지 않도록 하는것이 안정적이다. network.bind_host: 엘라스틱서치 서버의 내부 IP주소network.. 더보기
[ElasticSearch-1 start stop] ===== 시작과 종료 ===== - 시작 sh - echo 'bin/elasticsearch -d -p es.pid' > start.sh - 종료 sh - echo 'kill `cat es.pid`' > shutdown.sh 더보기
쉘 스크립트 문법 여기에 하나씩 계속 업데이트 해 나갈 예정입니다. ====== IF ~ ELSE IF ======if [ "$node" == "abc" ]; thenavg_1=$avgelif [ "$node" == "def" ]; thenavg_2=$avgelif [ "$node" == "ghi" ]; thenavg_3=$avgfi 더보기
javascript에서 파라미터 받기 === 호출 === === 스크립트 ===var scripts = document.getElementsByTagName('script');var myScript = scripts[ scripts.length - 1 ];var queryString = myScript.src.replace(/^[^\?]+\??/,'');var params = parseQuery( queryString ); alert(params['from']);alert(params['type']); function parseQuery ( query ) { var Params = new Object (); if ( ! query ) return Params; // return empty object var Pairs = query.spli.. 더보기