2012-11-26 3 views
1

내가 아주 간단한 무언가에 건초 더미의 기본 설정을 변경하기 위해 노력하고있어 직접 지정하는 경우 작업 :Elasticsearch 분석기는 인덱스 설정에서 무시 만 쿼리

'settings': { 
    "analyzer": "spanish" 
} 

같습니다 바로 인덱스 다시 작성 후 :

$ curl -XGET 'http://localhost:9200/haystack/_settings?pretty=true' 
{ 
    "haystack" : { 
    "settings" : { 
     "index.analyzer" : "spanish", 
     "index.number_of_shards" : "5", 
     "index.number_of_replicas" : "1", 
     "index.version.created" : "191199" 
    } 
    } 

그러나 일부 중지 단어로 테스트 할 때 예상대로 작동하지 않으므로 "esto"및 "que"를 필터링하고 영어 중지 단어에서 "is"및 "a"를 필터링해야합니다.

$ curl -XGET 'localhost:9200/haystack/_analyze?text=esto+is+a+test+que&pretty=true' 
{ 
    "tokens" : [ { 
    "token" : "esto", 
    "start_offset" : 0, 
    "end_offset" : 4, 
    "type" : "<ALPHANUM>", 
    "position" : 1 
    }, { 
    "token" : "test", 
    "start_offset" : 10, 
    "end_offset" : 14, 
    "type" : "<ALPHANUM>", 
    "position" : 4 
    }, { 
    "token" : "que", 
    "start_offset" : 15, 
    "end_offset" : 18, 
    "type" : "<ALPHANUM>", 
    "position" : 5 
    } ] 

만 나는 그것이 작동하는 쿼리 분석기를 지정할 때 :

$ curl -XGET 'localhost:9200/haystack/_analyze?text=esto+is+a+test+que&analyzer=spanish&pretty=true' 
{ 
    "tokens" : [ { 
    "token" : "is", 
    "start_offset" : 5, 
    "end_offset" : 7, 
    "type" : "<ALPHANUM>", 
    "position" : 2 
    }, { 
    "token" : "test", 
    "start_offset" : 10, 
    "end_offset" : 14, 
    "type" : "<ALPHANUM>", 
    "position" : 4 
    } ] 

내가 잘못 뭐하는 거지의 어떤 생각?

감사합니다.

답변

1

"settings": { 
    "index.analysis.analyzer.default.type" : "spanish" 
} 
1

해야 그리고 그것은 그냥은 "건초 더미"지수 적용 : 자신의 제안에 대한 imotov하는

{ 
    "haystack" : { 
    "settings" : { 
     "index.analysis.analyzer.default.type" : "spanish", 
    } 
} 

감사합니다.