File tree Expand file tree Collapse file tree 3 files changed +2
-22
lines changed
elasticsearch/stac_fastapi/elasticsearch
opensearch/stac_fastapi/opensearch
sfeos_helpers/stac_fastapi/sfeos_helpers Expand file tree Collapse file tree 3 files changed +2
-22
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,6 @@ async def get_all_collections(
187187 Returns:
188188 A tuple of (collections, next pagination token if any).
189189 """
190- # Format the sort parameter
191190 formatted_sort = []
192191 if sort :
193192 for item in sort :
@@ -199,18 +198,15 @@ async def get_all_collections(
199198 if not any ("id" in item for item in formatted_sort ):
200199 formatted_sort .append ({"id" : {"order" : "asc" }})
201200 else :
202- # Use a collections-specific default sort that doesn't rely on properties.datetime
203201 formatted_sort = [{"id" : {"order" : "asc" }}]
204202
205- # Build the search body step by step to avoid type errors
206203 body = {
207204 "sort" : formatted_sort ,
208205 "size" : limit ,
209206 }
210207
211- # Only add search_after if we have a token
212208 if token :
213- body ["search_after" ] = [token ] # search_after must be a list
209+ body ["search_after" ] = [token ]
214210
215211 response = await self .client .search (
216212 index = COLLECTIONS_INDEX ,
@@ -227,7 +223,6 @@ async def get_all_collections(
227223
228224 next_token = None
229225 if len (hits ) == limit :
230- # Ensure we have a valid sort value for next_token
231226 next_token_values = hits [- 1 ].get ("sort" )
232227 if next_token_values :
233228 next_token = next_token_values [0 ]
Original file line number Diff line number Diff line change @@ -170,7 +170,6 @@ async def get_all_collections(
170170 Returns:
171171 A tuple of (collections, next pagination token if any).
172172 """
173- # Format the sort parameter
174173 formatted_sort = []
175174 if sort :
176175 for item in sort :
@@ -182,18 +181,15 @@ async def get_all_collections(
182181 if not any ("id" in item for item in formatted_sort ):
183182 formatted_sort .append ({"id" : {"order" : "asc" }})
184183 else :
185- # Use a collections-specific default sort that doesn't rely on properties.datetime
186184 formatted_sort = [{"id" : {"order" : "asc" }}]
187185
188- # Build the search body step by step to avoid type errors
189186 body = {
190187 "sort" : formatted_sort ,
191188 "size" : limit ,
192189 }
193190
194- # Only add search_after if we have a token
195191 if token :
196- body ["search_after" ] = [token ] # search_after must be a list
192+ body ["search_after" ] = [token ]
197193
198194 response = await self .client .search (
199195 index = COLLECTIONS_INDEX ,
Original file line number Diff line number Diff line change @@ -160,17 +160,6 @@ class Geometry(Protocol): # noqa
160160 "dynamic_templates" : ES_MAPPINGS_DYNAMIC_TEMPLATES ,
161161 "properties" : {
162162 "id" : {"type" : "keyword" },
163- # "bbox_shape": {"type": "geo_shape"}, # Only this is used for spatial queries
164- # "extent": {
165- # "properties": {"temporal": {"properties": {"interval": {"type": "date"}}}}
166- # },
167- # "properties": {
168- # "properties": {
169- # "datetime": {"type": "date"},
170- # "start_datetime": {"type": "date"},
171- # "end_datetime": {"type": "date"},
172- # }
173- # },
174163 "extent.spatial.bbox" : {"type" : "long" },
175164 "extent.temporal.interval" : {"type" : "date" },
176165 "providers" : {"type" : "object" , "enabled" : False },
You can’t perform that action at this time.
0 commit comments