Force_true parameter in highlight clause does not retrieve the fields properly

Hi everyone,

I set the following _source and highlight clauses in my search body:

       "pre_tags":["\u003cspan class  \"highlight\"\u003e"],

According to, I understood that, setting :force_source = true in the field highlight, if it occurs a matching on that field, it would be retrieved in the _source clause.

However, this does not happen with my search. The returned _source clause was:

			"_index": "index_name",
			"_type": "type_name",
			"_id": "3288191",
			"_score": 1897.5596,
			"_source": {
				"field_1": "201700000030",
				"field_2": {
					"id": 3,
					"desc": "foo"
			"highlight": {
				"field_3": ["something <span class=\"highlight\">search term</span>"],
				"field_4": [": another <span class=\"highlight\">search term</span> <span class=\"highlight\">search term</span>", ": foo bar - <span class=\"highlight\">search term</span>]

Did I miss something or the "force_source" in this feature has nothing to with the _source clause?
If that's the case, how can I achieve this solution: retrieving a field in the _source clause only if there is a matching highlight on it?



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