I have created a percolate index with custom analyzer and with that custom analyzer I am passing synonyms.
Let's say,
Synonyms,
A => A, X
B => B, X
C => C, X
And my percolate queries also has all different query for each
query
q1 => "(A)"
q2 => "(B)"
q3 => "(C)"
But when I am searching for document using percolate index,
It is returning me all those query.
For example,
GET sample_index/_search
{
"query": {
"percolate": {
"field": "query",
"document": {
"content": "A"
}
}
}
}
Result:
"hits": {
"total": 5,
"max_score": 0.46029136,
"hits": [
{
"_index": "sample_index",
"_type": "doc",
"_id": "X-A",
"_score": 0.46029136,
"_source": {
"query": {
"query_string": {
"query": "A"
}
}
},
"fields": {
"_percolator_document_slot": [
0
]
}
},
{
"_index": "sample_index",
"_type": "doc",
"_id": "X-B",
"_score": 0.36165747,
"_source": {
"query": {
"query_string": {
"query": "B"
}
}
},
"fields": {
"_percolator_document_slot": [
0
]
}
},
{
"_index": "sample_index",
"_type": "doc",
"_id": "X-C",
"_score": 0.36165747,
"_source": {
"query": {
"query_string": {
"query": "C"
}
}
},
"fields": {
"_percolator_document_slot": [
0
]
}
}
}