I am upgrading ES from v2.3.3 to v5.6.2. Given below is the code written using api in v2.3.3-
SearchRequestBuilder searchBuilder = getSearchRequestBuilder().setQuery(query).setPostFilter(filterBuilder).setFetchSource(null, new String{"file.content"}).addHighlightedField("file.content");
In the v5.6.2 the addHighlightedField (java.lang.String) has been removed and this functionality is now being provided by field(java.lang.String) method of HighlightBuilder.
How can I replace addHighlightedField() method with the new field() method and what are the changes that I will have to make? Please help.