# Field name resolution for highlighting

**URL:** <https://discuss.elastic.co/t/field-name-resolution-for-highlighting/46222>\
**Category:** Elasticsearch\
**Created:** [April 4, 2016, 10:04am UTC](https://discuss.elastic.co/t/field-name-resolution-for-highlighting/46222 "2016-04-04T10:04:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsarkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bsarkar/32/42967_2.png) [@bsarkar](https://discuss.elastic.co/u/bsarkar)\
**Post date:** [April 4, 2016, 10:04am UTC](https://discuss.elastic.co/t/field-name-resolution-for-highlighting/46222/1 "2016-04-04T10:04:58Z")

</div>

I want to highlight multiple fields. Field names have a pattern so I use wildcards. I want to apply one set of settings for all fields foo\* but override some settings for fields foobar\*. Is there a way to achieve this?

The code below works and fields foobar\* are not fragmented.

```
"highlight": {
	"fields": {
		"foo*": {
			"number_of_fragments": 1,
			"fragment_size": 20
		},
		"foobar*": {
			"number_of_fragments": 0
		}
	}
}

```

But for the code below, fields foobar\* are not fragmented too.

```
"highlight": {
	"fields": {
		"foo*": {
			"number_of_fragments": 0			
		},
		"foobar*": {
			"number_of_fragments": 1,
                        "fragment_size": 20
		}
	}
}

```

I'm not sure how settings are overridden in these cases. Of course, as per JSON spec, ordering of fields is immaterial. Should I assume that overriding of this kind is not supported? But if it is supported, I would want to know.

---

<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:** [July 5, 2017, 11:02pm UTC](https://discuss.elastic.co/t/field-name-resolution-for-highlighting/46222/2 "2017-07-05T23:02:38Z")

</div>

Closed on July 5, 2017, 11:02pm UTC


