# Highlighting a numeric field from results fetched from custom "\_all" fields

**URL:** <https://discuss.elastic.co/t/highlighting-a-numeric-field-from-results-fetched-from-custom-all-fields/170509>\
**Category:** Elasticsearch\
**Created:** [March 1, 2019, 1:54pm UTC](https://discuss.elastic.co/t/highlighting-a-numeric-field-from-results-fetched-from-custom-all-fields/170509 "2019-03-01T13:54:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chintzs](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@chintzs](https://discuss.elastic.co/u/chintzs)\
**Post date:** [March 1, 2019, 1:54pm UTC](https://discuss.elastic.co/t/highlighting-a-numeric-field-from-results-fetched-from-custom-all-fields/170509/1 "2019-03-01T13:54:17Z")

</div>

Hi,

I am new to Elasticsearch. We have certain data in different data-types that we want to index and retrieve. We are using custom "\_all" fields as explained in the below link

[Custom "\_all" fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-all-field.html#custom-all-fields)

Following is our code

> ```
> PUT myindex
> {
> "mappings": {
> "mytype": {
> "properties": {
> "first_name": {
> "type": "text",
> "copy_to": "contact_details" 
> },
> "mobile_number": {
> "type": "long",
> "copy_to": "contact_details" 
> },
> "contact_details": {
> "type": "text"
> }
> }
> }
> }
> }
> 
> PUT myindex/mytype/1
> {
> "first_name": "John",
> "mobile_number": 9988776655
> }
> 
> GET myindex/_search
> {
> "query": {
> "multi_match": {
> "query": "9988776655",
> "fields": [
> "contact_details"
> ],
> "fuzziness": "auto"
> }
> },
> "highlight": {
> "require_field_match": false,
> "pre_tags": [
> "<tag1>"
> ],
> "post_tags": [
> "</tag1>"
> ],
> "fields": {
> "first_name": {},
> "mobile_number": {}
> }
> }
> }
> 
> ```

Using the above query we are able to fetch results but are not able to highlight the original field value as explained in the following link

[Highlighting Original Fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-all-field.html#all-highlight-fields)

Need to know if we are doing anything wrong or is there a bug

Please note that we have to use the Custom "\_all" field as it is important to our requirement. Also, the datatype of the fields cannot be changed.

Thanks a lot

---

<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:** [March 29, 2019, 1:54pm UTC](https://discuss.elastic.co/t/highlighting-a-numeric-field-from-results-fetched-from-custom-all-fields/170509/2 "2019-03-29T13:54:19Z")

</div>

Closed on March 29, 2019, 1:54pm UTC

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