2017-11-13 11 views
0

私はElasticsearch最新バージョン5.6.4を使用しています。私は特殊文字をインデックス化し、フィールドtitle.specialのためにそれらを検索したいと思います。弾性検索:特殊文字を使用しない用語検索

PUT index1 
    { 
    "mappings": { 
      "isContainer:false": { 
      "properties": { 
       "connectorSpecific": { 
       "properties": { 

       "title": { 
       "type": "text", 
       "store": true, 
       "fields": { 
        "special":{ 
        "type": "text", 
        "analyzer": "special", 
        "search_analyzer": "special" 
       } 
       } 
       } 
      } 
      } 
     }, 
     "settings": { 
      "index": { 
      "analysis": { 
       "analyzer": { 

        "special": { 
        "filter": [ 
        "lowercase" 
        ], 
        "tokenizer": "whitespace" 
       } 
       } 

      } 
      } 
      } 
      } 
     } 
     } 

私は長期的なクエリを使用してKibanaに照会し、

GET index1/_search 
{ 
    "query": { 
    "term": { 
     "title.special": { 
     "value": "-unconstrained_net_use_inf_tw" 
     } 
    } 
    } 
} 

何も返しません:以下は私のマッピングです。しかし、私が一致検索をすると、文書は返されます。たとえば。

GET index1/_search 
{ 
    "query": { 
    "match": { 
     "title.special": { 
     "value": "-unconstrained_net_use_inf_tw" 
     } 
    } 
    } 
} 

私のマッピングに何か問題がありますか? *、 - 、+などのような特殊文字に対して用語クエリを作成する方法

答えて