# Fvh highlighter problem with inverted proximity search

**URL:** <https://discuss.elastic.co/t/fvh-highlighter-problem-with-inverted-proximity-search/285916>\
**Category:** Elasticsearch\
**Created:** [October 5, 2021, 12:31pm UTC](https://discuss.elastic.co/t/fvh-highlighter-problem-with-inverted-proximity-search/285916 "2021-10-05T12:31:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wonder\_Garance](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wonder_garance/32/91180_2.png) [@Wonder\_Garance](https://discuss.elastic.co/u/Wonder_Garance)\
**Post date:** [October 5, 2021, 12:31pm UTC](https://discuss.elastic.co/t/fvh-highlighter-problem-with-inverted-proximity-search/285916/1 "2021-10-05T12:31:11Z")

</div>

Hi, I use Elasticsearch 7.9.3, I configured 2 text fileds, one of them is for exact search.  
Mapping:

```auto
    "text_html": {
      "type": "text",
      "term_vector": "with_positions_offsets",
      "store": true,
      "analyzer": "text_minimal",
      "search_analyzer": "search_text_minimal",
      "fields": {
        "exact": {
          "type": "text",
          "term_vector": "with_positions_offsets",
          "analyzer": "text_exact"
        }
      }
    }

```

When I run the query with query\_string and with a proximity, no highlighting in the result list.

```auto
{
  "highlight": {
    "fields": {
      "text": {
        "number_of_fragments": 0,
        "matched_fields": [
          "text_html",
          "text_html.exact"
        ],
        "type": "fvh"
      }
    }
  },
  "_source": ["text_html"],
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "query": "\"term1 term2 term3\"~10",
            "fields": ["text_html"],
            "default_operator": "and",
            "auto_generate_synonyms_phrase_query": false
          }
        }
      ]
    }
  }
}

```

In the original document, theses terms are presented as:  
**term3 term1 term2**  
When I put term3 term1 term2 in the query, I get the highlighting with terms.

How to solve the hightlighting problem with fvh? Is it corrected in a newer version?

I find a similar question:

> [@Fvh highlighter does not work with inverted proxemity search](https://discuss.elastic.co/t/fvh-highlighter-does-not-work-with-inverted-proxemity-search/170916):
>
> Hi there, I have this setup: Mapping: "CEDANT": { "type": "text", "analyzer":"ire\_regular", "fields": { "exact":{ "type": "text", "analyzer": "ire\_exact", "term\_vector":"with\_positions\_offsets", "index\_options" : "offsets" } } } Query template: "highlight": { "order": "score", "number\_of\_fragments": 0, "type": "plain", "fragmenter": "span", "fields": { "CEDANT": { "matched\_fields": ["CEDANT"] }, "CEDA…

But in my case I should use **fvh** to highliter several fields in the same text.

---

<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:** [November 2, 2021, 12:31pm UTC](https://discuss.elastic.co/t/fvh-highlighter-problem-with-inverted-proximity-search/285916/2 "2021-11-02T12:31:43Z")

</div>

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