# Elasticsearch Highlighting on fields of data type integer, double ,long, float

**URL:** <https://discuss.elastic.co/t/elasticsearch-highlighting-on-fields-of-data-type-integer-double-long-float/159480>\
**Category:** Elasticsearch\
**Created:** [December 5, 2018, 7:59am UTC](https://discuss.elastic.co/t/elasticsearch-highlighting-on-fields-of-data-type-integer-double-long-float/159480 "2018-12-05T07:59:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikesh/32/86579_2.png) [@Nikesh](https://discuss.elastic.co/u/Nikesh)\
**Post date:** [December 5, 2018, 7:59am UTC](https://discuss.elastic.co/t/elasticsearch-highlighting-on-fields-of-data-type-integer-double-long-float/159480/1 "2018-12-05T07:59:25Z")

</div>

Hi all,  
I have indexed a field as both double and keyword. Searching is working fine but i have issues with highlighting. As i see, highlighting is not happening over datatypes other than text fields.  
My mapping file is:

```
{
    "sorting": {
        "mappings": {
            "_doc": {
                "properties": {
                    "VALUE": {
                        "type": "double",
                        "fields": {
                            "keyword": {
                                "type": "keyword",
                                "ignore_above": 256
                            }
                        }
                    }
                }
            }
        }
    }
}

```

My search query is

```
{
	"query": {
    "bool": {"should": [

{
          "query_string": {
            "query":"\"230\"",
            "fields":[],
            "boost":"50"
					}
			}, {
          "multi_match": {
            "query":"230",
            "type":"phrase",
            "boost":"10",
            "slop":"2",
            "fields":[]
}},{
        	
          "multi_match": {
           "query":"230",
    			     "fields":[]
}}
] 
}
}, "highlight": {
        "type" : "unified",
        "fields": {
            "*": {}
        }
    }
}

```

and the results are

```
"hits": [
            {
                "_index": "sorting",
                "_type": "_doc",
                "_id": "2",
                "_score": 61,
                "_source": {
                    "VALUE": "230"
                },
                "highlight": {
                    "VALUE.keyword": [
                        "<em>230</em>"
                    ]
                }
            },
            {
                "_index": "sorting",
                "_type": "_doc",
                "_id": "1",
                "_score": 61,
                "_source": {
                    "VALUE": 230
                },
                "highlight": {
                    "VALUE.keyword": [
                        "<em>230</em>"
                    ]
                }
            }
        ]

```

Why is highlight not happening over Value and happening over value.keyword.  
I wish to know why highlighting is not happening ovr fields of data type integer, double etc.

---

<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:** [January 2, 2019, 7:59am UTC](https://discuss.elastic.co/t/elasticsearch-highlighting-on-fields-of-data-type-integer-double-long-float/159480/2 "2019-01-02T07:59:32Z")

</div>

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