Hello,
I want to find which term matched on documents that results of query. I tried to using "highlight" but it does responsed with poor results.(I need more digging time to with them)
I want to know alternative way to find which term matched on document result.
Below example my codes, After request , I expect that getting ["Protein-A","Protein-C"] or ["Protein-A"] or ["Protein-C"] matched from document result.
GET papers/_search
{
"query": {
"bool": {
"should": [
{
"terms": {
"title": [
"Genetic",
"Phenotype",
"Crispher"
]
}
},
{
"terms": {
"main_content": [
"Protien-A",
"Protein-B",
"Protien-C"
]
}
}
]
}
},
"highlight": {
"type": "unified",
"fields": {
"main_content": {
"boundary_scanner": "word",
"fragment_size": 20,
"number_of_fragments": 10,
"pre_tags": [
"<em>"
],
"post_tags": [
"</em>"
]
}
}
}
}