I have a document, for example:
{
"text": "Index Down Jones",
"title": "Index Down Jones"
}
And my mapping for text and title the same:
"mappings": {
"properties": {
"text": {
"type": "text",
"analyzer": "my_analyzer",
"term_vector": "with_positions_offsets",
"fields": {
"exact": {
"type": "text",
"term_vector": "with_positions_offsets",
"analyzer": "default"
},
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
My query:
{
"query": {
"bool": {
"should": [
{
"intervals": {
"text": {
"all_of": {
"intervals": [
{
"match": {
"query": "Down"}
},
{
"match": {
"analyzer": "default",
"max_gaps": 0,
"query": "Jones",
"use_field": "text.exact"
}
}
],
"max_gaps": 0,
"ordered": False}
}
}
},
{
"intervals": {
"title": {
"all_of": {
"intervals": [
{
"match": {
"query": "Down"}
},
{
"match": {
"analyzer": "default",
"max_gaps": 0,
"query": "Jones",
"use_field": "title.exact"
}
}
],
"max_gaps": 0,
"ordered": False
}
}
}
}
]
}
},
"highlight": {
"number_of_fragments": 0,
"post_tags": ["</em>"],
"pre_tags": ["<em>"]},
"fields": {
"text": {
"matched_fields": ["text", "text.exact"],
"type": "fvh"
},
"title": {
"matched_fields": ["title", "title.exact"],
"type": "fvh"
}
}
}
Why fast vector highlight doesn't highlight when I use intervals query?
By the way, when I use unified highlighter elasticsearch highlights fields separately:
"highlight": {
"text.exact": ["Index Down <em>Jones</em>"],
"title.exact": ["Index Down <em>Jones</em>"],
"text": ["Index <em>Down</em> Jones"],
"title": ["Index <em>Down</em> Jones"]
}
Any thoughts about how to merge fields title and title.exact in one field title when I do highlight, for text field too?