I am testing query for index that has documents.
{
"query": {
"bool": {
"should": [
{
"match": {
"title": "test.docx"
}
},
{
"match": {
"content": "test.docx"
}
}
]
}
},
"_source": ["title", "content"],
"highlight": {
"fields": {
"content": {}
}
}
}
Query is to search keyword in title and content.
But, when keyword is matched only title of document, highlight is empty.
In this case, I want to get summary of content in search result.
for example of summary, front of 100 characters in content field.
I think that simple way is add mapping 'summary' field.
But Is there other way in query? not to add field.