Term Vectors within search API

I have a scenario where I need to return the position of a word in the field (same as Term Vectors position) within the search results of a keyword.

I have couple of questions:

  1. Term Vectors API would only work on an ID/Multi ID. Instead, can we achieve this using Search API as well?
  2. Is there a way to leverage Term Vectors by ID to return only matching keyword terms but not every term of a field?

Example use-case to achieve:
Searching for a keyword car in an index using _search API should return all the documents which match the keyword car along with positions of only car term in set of fields.

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