Giter Club home page Giter Club logo

elasticsearch-jaso-analyzer's Introduction

Korean Jaso Analyzer for elasticsearch 2.3.x

ES Plugin change

*https://github.com/imotov/elasticsearch-native-script-example

changed

  • ES 1.7x -> 2.3

install

$ gradle build buildPluginZip
자동완성용 한글 자소분석기입니다. elasticsearch 2.3.x 에서 테스트 되었습니다
설치
bin/plugin --url http://nonstop.pe.kr/elasticsearch/elasticsearch-jaso-analyzer-1.0.2.zip --install jaso-analyzer
삭제 (필요시)
bin/plugin --remove jaso-analyzer
인덱스 삭제 (필요시)
curl -XDELETE 'http://localhost:9200/jaso'
Korean Jaso Analyer 설정 및 인덱스 생성 (기본 자소검색용)
curl -XPUT localhost:9200/jaso/ -d '{
  "settings": {
    "index": {
      "analysis": {
        "filter": {
          "suggest_filter": {
            "type": "edge_ngram",
            "min_gram": 1,
            "max_gram": 50
          }
        },
        "analyzer": {
          "suggest_search_analyzer": {
            "type": "custom",
            "tokenizer": "jaso_tokenizer"
          },
          "suggest_index_analyzer": {
            "type": "custom",
            "tokenizer": "jaso_tokenizer",
            "filter": [
              "suggest_filter"
            ]
          }
        }
      }
    }
  }
}'
Korean Jaso Analyer 설정 및 인덱스 생성 (한,영오타 및 초성토큰 추출이 필요할 때..)
curl -XPUT localhost:9200/jaso/ -d '{
  "settings": {
    "index": {
      "analysis": {
        "filter": {
          "suggest_filter": {
            "type": "edge_ngram",
            "min_gram": 1,
            "max_gram": 50
          }
        },
        "tokenizer": {
          "jaso_search_tokenizer": {
            "type": "jaso_tokenizer",
            "mistype": true,
            "chosung": false
          },
          "jaso_index_tokenizer": {
            "type": "jaso_tokenizer",
            "mistype": true,
            "chosung": true
          }
        },
        "analyzer": {
          "suggest_search_analyzer": {
            "type": "custom",
            "tokenizer": "jaso_search_tokenizer"
          },
          "suggest_index_analyzer": {
            "type": "custom",
            "tokenizer": "jaso_index_tokenizer",
            "filter": [
              "suggest_filter"
            ]
          }
        }
      }
    }
  }
}'
인덱스 맵핑
curl -XPUT 'http://localhost:9200/jaso/_mapping/test' -d '{
  "properties": {
    "name": {
      "type": "string",
      "store": true,
      "index_analyzer": "suggest_index_analyzer",
      "search_analyzer": "suggest_search_analyzer"
    }
  }
}'
인덱스타임 분석기 테스트
curl -XGET 'localhost:9200/jaso/_analyze?analyzer=suggest_index_analyzer&pretty' -d '최일규 Hello'

쿼리타임 분석기 테스트
curl -XGET 'localhost:9200/jaso/_analyze?analyzer=suggest_search_analyzer&pretty' -d '최일규 Hello'
문서생성
curl -XPOST http://localhost:9200/jaso/test/ -d '{
    "name":"최일규 Hello"
}'

curl -XPOST http://localhost:9200/jaso/test/ -d '{
    "name":"초아"
}'
문서검색
curl -XPOST 'http://localhost:9200/jaso/test/_search?pretty' -d '{
    "query" : {
        "match" : { "name" : "초" }
    }
}'

curl -XPOST 'http://localhost:9200/jaso/test/_search?pretty' -d '{
    "query" : {
        "match" : { "name" : "ㅊㅇㄱ" }
    }
}'

elasticsearch-jaso-analyzer's People

Contributors

limhs25 avatar netcrazy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.