2017-01-11 10 views
0

私はElasticSearch 5.1を使用しているためにトークンフィルタを止める有効にして、私は文書がcustomアナライザでそれを使用する方法について説明しdisabled by default あるstandardアナライザのStop Token Filterを有効にしたいが、私はどのように知っていただきたいと思いますそれが既に含まれているので、それを可能にする。標準アナライザ

答えて

1

あなたは、curlコマンド(taken from docs here)でそれを行う方法以下の例を参照してください、標準アナライザを設定する必要があります。

curl -XPUT 'localhost:9200/my_index?pretty' -d' 
{ 
    "settings": { 
    "analysis": { 
     "analyzer": { 
     "std_english": { 
      "type":  "standard", 
      "stopwords": "_english_" 
     } 
     } 
    } 
    }, 
    "mappings": { 
    "my_type": { 
     "properties": { 
     "my_text": { 
      "type":  "text", 
      "analyzer": "standard", 
      "fields": { 
      "english": { 
       "type":  "text", 
       "analyzer": "std_english" 
      } 
      } 
     } 
     } 
    } 
    } 
}' 
curl -XPOST 'localhost:9200/my_index/_analyze?pretty' -d' 
{ 
    "field": "my_text", 
    "text": "The old brown cow" 
}' 
curl -XPOST 'localhost:9200/my_index/_analyze?pretty' -d' 
{ 
    "field": "my_text.english", 
    "text": "The old brown cow" 
}' 
+0

[OK]をので、基本的に、私は新しいアナライザを作成する必要があります。 – alkis