News
Delivery API: search improvements and performance gains
4 min read22 January 2020
If you've been using our Delivery API for a while now, you've probably carried out some sort of search to build rich interactions with your content.
12345678
{
"entry": {
"sys": {
"id": "015e3e82-8451-42ee-99eb-155445c5b2f8",
"dataFormat": "entry"
}
}
}
1234567891011
{
"entry": {
"sys": {
"dataFormat": "entry",
"contentTypeId": "movie",
"id": "015e3e82-8451-42ee-99eb-155445c5b2f8",
"uri": "/movies/deadpool"
}
}
}
1234567891011121314
{
"image": {
"asset": {
"sys": {
"id": "9eceb739-7b8b-4e63-a332-23ccf3489a00",
"dataFormat": "asset"
},
"caption": "Hold onto your chimichangas, folks. From the studio that brought you all 3 Taken films comes the block-busting, fourth-wall-breaking masterpiece about Marvel Comics’ sexiest anti-hero!",
"altText": "Deadpool Marvel character jumping over a car",
"transformations": "crop=644,503,316,192"
}
}
}
123456789101112131415
{
"image": {
"altText": "Deadpool Marvel character jumping over a car",
"transformations": "crop=644,503,316,192",
"caption": "Hold onto your chimichangas, folks. From the studio that brought you all 3 Taken films comes the block-busting, fourth-wall-breaking masterpiece about Marvel Comics’ sexiest anti-hero!",
"asset": {
"sys": {
"dataFormat": "asset",
"contentTypeId": "image",
"id": "bd9690c8-6198-476a-b108-6fbbb71b4c27",
"uri": "/image-library/deadpool.x6c66a57c.jpg?crop=644,503,316,192"
}
}
}
}
1234567891011121314151617181920212223242526272829
{
"where": [
{
"field": "sys.contentTypeId",
"equalTo": "locationDistanceSearch"
},
{
"field": "sys.versionStatus",
"equalTo": "latest"
},
{
"field": "location",
"distanceWithin": {
"lat": "51.5074",
"lon": "0.1278",
"distance": "150mi"
}
}
],
"orderBy": [
{
"asc": "location"
}
],
"fields": [
"entryTitle",
"location"
]
}
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
{
"pageIndex": 0,
"pageSize": 25,
"totalCount": 3,
"pageCount": 1,
"items": [
{
"location": {
"lat": 50.822530000000008,
"lon": -0.13716299999998682,
"distance": 48.69
},
"sys": {
"dataFormat": "entry",
"contentTypeId": "locationDistanceSearch",
"language": "en-GB",
"id": "d7e16a1f-cbfe-41a0-a6c3-c7bffdffff88",
"uri": null
},
"entryTitle": "Brighton"
},
{
"location": {
"lat": 51.7520209,
"lon": -1.2577263000000585,
"distance": 61.78
},
"sys": {
"dataFormat": "entry",
"contentTypeId": "locationDistanceSearch",
"language": "en-GB",
"id": "d166e3ef-56da-429d-9f06-fdd6715ffded",
"uri": null
},
"entryTitle": "Oxford"
},
{
"location": {
"lat": 52.367749,
"lon": -2.7139128999999684,
"distance": 134.84
},
"sys": {
"dataFormat": "entry",
"contentTypeId": "locationDistanceSearch",
"language": "en-GB",
"id": "26730949-6679-43c2-a4dc-03700d45abd2",
"uri": null
},
"entryTitle": "Ludlow"
}
]