To return the position of each occurrence of a search term inside a document, set includeLocations to true.

Note: You must have Include Term Vectors enabled or the include_term_vectors property set to true on a field to use includeLocations. For more information about how to enable term vectors, see Child Field Options or Search Index JSON Properties.