Mapping in App search / Search ui

I am trying to build a frontend using React (Search ui) and app search as a backend. So iwas succeful in indexing my documents but i have some questions regarding the mapping. How can we look into the mapping and the parameters of our index. I am asking that because I have a pb in retrieving the infos that i want in the front end. Here's what a json doc looks like:

{"transcript":"<transcript of 30 sec>"
start":"<start time of first transcript>",
"end":"<end time of first transcript>"},

{"transcript":"<transcript of 30 sec>"
start":"<start time of second transcript>",
"end":"<end time of second transcript>"}



So now when i search using my front end, when i look for a word, i can only retrieve the whole transcripts field with all the transcripts. What i want is to only retrieve the transcript containing the word and maybe the surrounding one and not the whole array object. How can i access anc show that ?
Thanks !

Hey Nadir!

I think the concept you're looking for is generically called "highlight", although we call them snippets in App Search. They wont filter your result payload to only include the matching transcript element plus surrounding elements, but they will identify the matching content. You can see how snippets get used in this advanced documention: search-ui/ at master · elastic/search-ui · GitHub. I recommend searching for "snippet" (or even "highlight").

Related, you can access the same snippet functionality over the search API as well: Search API result fields | Elastic App Search Documentation [7.12] | Elastic.

I hope this helps!


Hello thank you for your answer but I already tried and that's not what I want. Is there a way to filter so I can only get the matching transcript and not the whole transcripts field ?