2017-11-13 42 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" 
       } 
       } 

      } 
      } 
      } 
      } 
     } 
     } 

나는 용어 ​​쿼리를 사용 키바에 쿼리

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" 
     } 
    } 
    } 
} 

내 매핑에 어떤 문제가 있습니까? *, -, + 등의 특수 문자에 대한 검색어 생성 방법

답변