# Does interval query work with Fast Vector Highlight?

**URL:** <https://discuss.elastic.co/t/does-interval-query-work-with-fast-vector-highlight/257262>\
**Category:** Elasticsearch\
**Created:** [December 1, 2020, 6:26pm UTC](https://discuss.elastic.co/t/does-interval-query-work-with-fast-vector-highlight/257262 "2020-12-01T18:26:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeusfsx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeusfsx/32/59433_2.png) [@zeusfsx](https://discuss.elastic.co/u/zeusfsx)\
**Post date:** [December 1, 2020, 6:26pm UTC](https://discuss.elastic.co/t/does-interval-query-work-with-fast-vector-highlight/257262/1 "2020-12-01T18:26:03Z")

</div>

I have a document, for example:

```auto
{
    "text": "Index Down Jones",
    "title": "Index Down Jones"
}

```

And my mapping for text and title the same:

```auto
  "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:

```auto
{
    "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:

```auto
"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?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 29, 2020, 6:26pm UTC](https://discuss.elastic.co/t/does-interval-query-work-with-fast-vector-highlight/257262/2 "2020-12-29T18:26:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
