How the Elastic search results shows the cloudfront / CDN links contained in the body of a content

Hi Good morning all. I am new to elasticsearch looking for some help please. I have a webhook from "Contentful" cms connecting to an endpoint within cloud.elastic.co . Assume that I create a content which contains a media file , then within contentful it gets stored in a CDN, like below url: //videos.ctfassets.net/jfanvmv5j7kj/1HFUYLr95K2Q2sQkc8uUiY/67396d50863d6deb7e761764fca066dc/Aquaman_-_Official_Trailer_1.mp4)

However when I execute the elastic search in the results from within elastic search for links...it shows just the LINK IDs: instead of Cloudfront or CDN links shown above.


"fields": {
"caption": {
"en-US": "Aquaman is a 2018 American superhero film based on the DC Comics character of the same name, distributed by Warner Bros. Pictures. It is the sixth installment in the DC Extended Universe (DCEU). Directed by James Wan, with a screenplay by David Leslie "
},
"watchnowSlider": {
"en-US": [
{
"sys": {
"linkType": "Asset",
"type": "Link",
"id": "1USQ2qK5xiEQkoSa6IsYEo"
}
},
{
"sys": {
"linkType": "Asset",
"type": "Link",
"id": "780dWpitFu8myUaQqyaymi"
}
}
]
},
"video": {
"en-US": {
"sys": {
"linkType": "Asset",
"type": "Link",
"id": "6pTzHDe1gcswGay2eM20G8"
}
}
},


We are yet to build the front end , but we need to know how these links shows up in the front end when the user searches using elastic search from a website or an app. Kindly let me know any ideas how the elastic search actually displays the links from CDN or Cloudfront. Please point me some links for any example code to show the search results from front end as well. Thanks very much in advance. Have a great day

Elasticsearch has no concept of links by default.
What's ingesting the data and sending it to Elasticsearch? What is the mapping you are using?

Hi Mark,
Thanks for your response. Contentful-webhoook-to-elasticsearch We are using Contentful to create content. I am attaching the image which contains how the contentful is sending the data to Elastic thru endpoint.

The content itself is having links to the cloudfront managed by Contentful e.g.

//videos.ctfassets.net/jfanvmv5j7kj/1HFUYLr95K2Q2sQkc8uUiY/67396d50863d6deb7e761764fca066dc/Aquaman_-_Official_Trailer_1.mp4 )

But when it gets to Elastic cloud, it is sending the links as ID's "video": {
"en-US": {
"sys": {
"linkType": "Asset",
"type": "Link",
"id": "6pTzHDe1gcswGay2eM20G8"

But my question is when the actual user searches from the website, how does the elastic shows the search results...in what form these IDs will be displayed? Ideally they must be shown as the real links ((https://videos.ctfassets.net/jfanvmv5j7kj/1HFUYLr95K2Q2sQkc8uUiY/67396d50863d6deb7e761764fca066dc/Aquaman_-_Official_Trailer_1.mp4)) or a pointer to it...

Could you please suggest how to achieve this please

Elasticsearch can't change that, so it must be what the Contentful app is sending to it.

Exactly like you showed in the image.

Can you get the app to send the entire thing to Elasticsearch?

1 Like

Hi Mark, Thanks for your response. I tried sending the data which contains a CDN url of image and it is sending perfectly to the elastic as shown below

},
"description": {
"en-US": "

"
},

as you rightly suggested, I need to figure out how to send video fields contents also from Contentful app as a link instead of ID,

I just noticed , when I pasted the link... it is automatically getting the chutney's image from CDN and embedding in this chat as well..:slight_smile:

"//images.ctfassets.net/5yalg1fyk63m/4yYk1hBgCkAkg24WY2aeOi/5acfa3ef1b42d870540e45be7e7b5b71/chutneyrs.JPG"

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