Are these two syntaxes not equivalent?
- first
GET doc_data/_search
{
"query": {
"match": {
"title": {
"query": "农村信用银行",
"minimum_should_match": 2
}
}
}
}
- second:
GET doc_data/_search
{
"query": {
"bool": {
"should": [
{ "term": { "title":{"value": "农村信用"}}},
{ "term": { "title":{"value": "银行"}}},
{ "term": { "title":{"value": "农信银"}}}
],
"minimum_should_match": 3
}
},
"_source": ["title"]
}
But, I can get the hits by using the second, and the first result is empty .
And, cause I hava a synonym.txt with one line: "农村信用银行, 农信银",
so analyze "农村信用银行", I got three tokens, like this:
GET doc_data/_analyze
{
"field": "title",
"text": "农村信用银行"
}
{
"tokens" : [
{
"token" : "农村信用",
"start_offset" : 0,
"end_offset" : 4,
"type" : "CN_WORD",
"position" : 0
},
{
"token" : "农信银",
"start_offset" : 0,
"end_offset" : 6,
"type" : "SYNONYM",
"position" : 0,
"positionLength" : 2
},
{
"token" : "银行",
"start_offset" : 4,
"end_offset" : 6,
"type" : "CN_WORD",
"position" : 1
}
]
}
So, why I can get results with second, but empty with first?
PS: What exactly does "minimum_should_match" mean when I use "multi_match"?
Thank you for any reply.