Hi, elastic team.
I'm working on percolator index with match_phrase query and keep_words_filter.
I found that match_phrase query is not working properly with keep_words_filter.
I've tried both match_phrase query and simple_query_string with "", but both don't work properly.
Both worked as match query with operator 'or'.
Without keep_words_filter, both works properly.
Is there any way to fix it?
Thanks in advance.
MAPPING
{
"hana_percolator_keep_words" : {
"mappings" : {
"properties" : {
"frm_nm" : {
"type" : "keyword"
},
"query" : {
"type" : "percolator"
},
"text" : {
"type" : "text",
"analyzer" : "platform_eng_standard_analyzer"
}
}
}
}
}
DOC QUERY
{
"query": {
"percolate": {
"field": "query",
"document": {
"frm_nm": "CONTRACT",
"text": "CONTRACT NO"
}
}
}
}
PERCOLATOR QUERY RESULT
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 7,
"relation" : "eq"
},
"max_score" : 0.26152915,
"hits" : [
{
"_index" : "hana_percolator_keep_words",
"_type" : "_doc",
"_id" : "5e6wgHcBtnnJlJS9tZKJ",
"_score" : 0.26152915,
"_source" : {
"query" : {
"bool" : {
"filter" : {
"terms" : {
"frm_nm" : [
"CONTRACT",
"None"
]
}
},
"must" : [
{
"match_phrase" : {
"text" : "CONTRACT NO"
}
}
]
}
}
},
"fields" : {
"_percolator_document_slot" : [
0
]
}
},
{
"_index" : "hana_percolator_keep_words",
"_type" : "_doc",
"_id" : "I-6wgHcBtnnJlJS9tZOJ",
"_score" : 0.13076457,
"_source" : {
"query" : {
"bool" : {
"filter" : {
"terms" : {
"frm_nm" : [
"계약서(CONTRACT)",
"None"
]
}
},
"must" : [
{
"match_phrase" : {
"text" : "CONT NO"
}
}
]
}
}
},
"fields" : {
"_percolator_document_slot" : [
0
]
}
},
{
"_index" : "hana_percolator_keep_words",
"_type" : "_doc",
"_id" : "I-6wgHcBtnnJlJS9tpky",
"_score" : 0.13076457,
"_source" : {
"query" : {
"bool" : {
"filter" : {
"terms" : {
"frm_nm" : [
"CONTRACT",
"None"
]
}
},
"must" : [
{
"match_phrase" : {
"text" : "NO"
}
}
]
}
}
},
"fields" : {
"_percolator_document_slot" : [
0
]
}
},
{
"_index" : "hana_percolator_keep_words",
"_type" : "_doc",
"_id" : "p-6wgHcBtnnJlJS9tpyV",
"_score" : 0.13076457,
"_source" : {
"query" : {
"bool" : {
"filter" : {
"terms" : {
"frm_nm" : [
"CONTRACT",
"None"
]
}
},
"must" : [
{
"match_phrase" : {
"text" : "BOX NO"
}
}
]
}
}
},
"fields" : {
"_percolator_document_slot" : [
0
]
}
},
{
"_index" : "hana_percolator_keep_words",
"_type" : "_doc",
"_id" : "qu6wgHcBtnnJlJS9t6Nb",
"_score" : 0.13076457,
"_source" : {
"query" : {
"bool" : {
"filter" : {
"terms" : {
"frm_nm" : [
"CONTRACT",
"None"
]
}
},
"must" : [
{
"match_phrase" : {
"text" : "ROLL NO"
}
}
]
}
}
},
"fields" : {
"_percolator_document_slot" : [
0
]
}
},
{
"_index" : "hana_percolator_keep_words",
"_type" : "_doc",
"_id" : "6O6wgHcBtnnJlJS9uKkk",
"_score" : 0.13076457,
"_source" : {
"query" : {
"bool" : {
"filter" : {
"terms" : {
"frm_nm" : [
"CONTRACT",
"None"
]
}
},
"must" : [
{
"match_phrase" : {
"text" : "LOT NO"
}
}
]
}
}
},
"fields" : {
"_percolator_document_slot" : [
0
]
}
},
{
"_index" : "hana_percolator_keep_words",
"_type" : "_doc",
"_id" : "o-6wgHcBtnnJlJS9ubND",
"_score" : 0.13076457,
"_source" : {
"query" : {
"bool" : {
"filter" : {
"terms" : {
"frm_nm" : [
"CONTRACT",
"None"
]
}
},
"must" : [
{
"match_phrase" : {
"text" : "P.O NO"
}
}
]
}
}
},
"fields" : {
"_percolator_document_slot" : [
0
]
}
}
]
}
}