"mappings": {"test": {
"properties": {
"WEIBOID": {
"type": "keyword"
},
"LENGTH": {
"type": "integer"
},
"KEYWORD": {
"type": "keyword"
},
"USERRIGHT": {
"type": "integer"
},
"AUTHOR": {
"type": "keyword"
},
"PUBDATE": {
"format": "yyyy-MM-dd HH:mm:ss",
"type": "date"
},
"ABSTRACT": {
"type": "keyword"
},
"URL": {
"type": "keyword"
},
"COMMENTCOUNT": {
"type": "integer"
},
"HEADICONURL": {
"type": "keyword"
},
"STATUS": {
"type": "integer"
},
"WEIBOHOME": {
"type": "keyword"
},
"FEELINGINDEX": {
"type": "float"
},
"FINDDATE": {
"format": "yyyy-MM-dd HH:mm:ss",
"type": "date"
},
"COPYCOUNT": {
"type": "integer"
},
"CONTENT": {
"analyzer": "ik_smart",
"type": "text"
},
"ID": {
"type": "keyword"
},
"DOCTYPE": {
"type": "keyword"
},
"SYS_VSM": {
"type": "keyword"
},
"REMARK": {
"type": "integer"
},
"TYPE": {
"type": "keyword"
},
"WEBWEIGHT": {
"type": "integer"
},
"MSGID": {
"type": "keyword"
},
"IP": {
"type": "ip"
},
"DIGEST": {
"type": "keyword"
},
"CACHE": {
"index": false,
"type": "text"
},
"SOURCETYPE": {
"type": "keyword"
},
"REGION": {
"type": "keyword"
},
"SOURCE": {
"type": "keyword"
},
"RELRES": {
"type": "integer"
},
"TITLE": {
"analyzer": "ik_smart",
"type": "text"
},
"ACCESSORIES": {
"type": "keyword"
},
"HITCOUNT": {
"type": "integer"
},
"URLID": {
"type": "keyword"
},
"WEBSITE": {
"type": "keyword"
}
}
}
dsl
{
"query": {
"bool": {
"must": [{
"query_string": {
"query": "+ 标准 + (国新办||2018)",
"fields": ["TITLE"],
"type": "phrase"
}
}, {
"terms": {
"SOURCETYPE": [2]
}
}, {
"range": {
"PUBDATE": {
"gt": "2019-01-01 00:00:00",
"lt": "2019-03-01 00:00:00"
}
}
}]
}
},
"_source": {
"includes": ["TITLE"]
},
"size": 100,
"from": 0,
"sort": [{
"_score": "desc"
}]
}
结果如下图。。。标准两字匹配到了 为啥标准+国新办这种数据没匹配到呢???
"properties": {
"WEIBOID": {
"type": "keyword"
},
"LENGTH": {
"type": "integer"
},
"KEYWORD": {
"type": "keyword"
},
"USERRIGHT": {
"type": "integer"
},
"AUTHOR": {
"type": "keyword"
},
"PUBDATE": {
"format": "yyyy-MM-dd HH:mm:ss",
"type": "date"
},
"ABSTRACT": {
"type": "keyword"
},
"URL": {
"type": "keyword"
},
"COMMENTCOUNT": {
"type": "integer"
},
"HEADICONURL": {
"type": "keyword"
},
"STATUS": {
"type": "integer"
},
"WEIBOHOME": {
"type": "keyword"
},
"FEELINGINDEX": {
"type": "float"
},
"FINDDATE": {
"format": "yyyy-MM-dd HH:mm:ss",
"type": "date"
},
"COPYCOUNT": {
"type": "integer"
},
"CONTENT": {
"analyzer": "ik_smart",
"type": "text"
},
"ID": {
"type": "keyword"
},
"DOCTYPE": {
"type": "keyword"
},
"SYS_VSM": {
"type": "keyword"
},
"REMARK": {
"type": "integer"
},
"TYPE": {
"type": "keyword"
},
"WEBWEIGHT": {
"type": "integer"
},
"MSGID": {
"type": "keyword"
},
"IP": {
"type": "ip"
},
"DIGEST": {
"type": "keyword"
},
"CACHE": {
"index": false,
"type": "text"
},
"SOURCETYPE": {
"type": "keyword"
},
"REGION": {
"type": "keyword"
},
"SOURCE": {
"type": "keyword"
},
"RELRES": {
"type": "integer"
},
"TITLE": {
"analyzer": "ik_smart",
"type": "text"
},
"ACCESSORIES": {
"type": "keyword"
},
"HITCOUNT": {
"type": "integer"
},
"URLID": {
"type": "keyword"
},
"WEBSITE": {
"type": "keyword"
}
}
}
dsl
{
"query": {
"bool": {
"must": [{
"query_string": {
"query": "+ 标准 + (国新办||2018)",
"fields": ["TITLE"],
"type": "phrase"
}
}, {
"terms": {
"SOURCETYPE": [2]
}
}, {
"range": {
"PUBDATE": {
"gt": "2019-01-01 00:00:00",
"lt": "2019-03-01 00:00:00"
}
}
}]
}
},
"_source": {
"includes": ["TITLE"]
},
"size": 100,
"from": 0,
"sort": [{
"_score": "desc"
}]
}
结果如下图。。。标准两字匹配到了 为啥标准+国新办这种数据没匹配到呢???
1 个回复
rochy - rochy_he
赞同来自: