2017-03-02 89 views
0

查询索引的类型与查询字符串匹配任何财产匹配查询某个字段

{ 
    "size": 2, 
    "_source":["awardeeName"], 
    "query": { 
     "query_string" : { 
       "query": "health" 
      } 
    } 
    }   
} 

这将返回两个记录

[ 
{ 
    "_index": "docm-es", 
    "_type": "document", 
    "_id": "9d8c832d-f22f-463e-9102-4aefcaff88fa", 
    "_score": 0.74211, 
    "_source": { 
     "awardeeName": "State of Hawaii Department of Health" 
    } 
}, 
{ 
    "_index": "docm-es", 
    "_type": "document", 
    "_id": "79963a60-8e9e-45ac-b7f8-6dc99f6b0621", 
    "_score": 0.6427368, 
    "_source": { 
     "awardeeName": "New York State Department of Health" 
    } 
} 
] 

无论是记录显示,财产awardeename包含文字健康。 查询与比赛现场awardeeName文本健康搜索,

{ 
    "size": 2, 
    "_source":["awardeeName"], 
    "query": { 
     "match" : { 
       "awardeeName": "health" 
      } 
    } 
    }   
} 

这不返回任何命中,什么是错的,在此查询,请指点。

回答

0

你能加入您使用的是此领域

+0

我看到映射的映射更新的问题,awardeeName字段没有分析,我学会了应该被索引全文搜索 – user884424

相关问题