- Notifications
You must be signed in to change notification settings - Fork28
How to sort search serults#321
-
Hello. I am wondering if there is a way to sort the search result. Thank you. |
BetaWas this translation helpful?Give feedback.
All reactions
Answered by StijnCaertsDec 11, 2024
Hi@piust, I had a look at your example and there are a few things that might need to be fixed:
properties.published
is not a default field in STAC. You can take a look at thecreated/updated field- the
sortby
field should be an array of sort keys
I modified your example into a working query with sorting:
{"filter": {"op":"and","args": [ {"op":"and","args": [ {"op":"=","args": [ {"property":"properties.constellation" },"sentinel-2" ] } ] }, {"op":">=","args": [ {"property"…
Replies: 2 comments
-
Hi@piust, I had a look at your example and there are a few things that might need to be fixed:
I modified your example into a working query with sorting: {"filter": {"op":"and","args": [ {"op":"and","args": [ {"op":"=","args": [ {"property":"properties.constellation" },"sentinel-2" ] } ] }, {"op":">=","args": [ {"property":"properties.updated" }, {"timestamp":"2024-11-10T00:00:00.000Z" } ] } ] },"collections": ["sentinel-2-l2a" ],"fields": {"include": ["properties","geometry","type","id","bbox","stac_version","assets","collection" ] },"limit":100,"sortby": [ {"field":"properties.updated","direction":"desc" } ]} I hope this helps! |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
0 replies
Answer selected bypiust
-
Thank you@StijnCaerts. You are right. I Fixed it and now it works perfectly. |
BetaWas this translation helpful?Give feedback.
All reactions
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment