@@ -162,7 +162,7 @@ async def get_all_collections(
162162 q : Optional [List [str ]] = None ,
163163 filter : Optional [Dict [str , Any ]] = None ,
164164 ) -> Tuple [List [Dict [str , Any ]], Optional [str ]]:
165- """Retrieve a list of collections from Elasticsearch , supporting pagination.
165+ """Retrieve a list of collections from Opensearch , supporting pagination.
166166
167167 Args:
168168 token (Optional[str]): The pagination token.
@@ -193,7 +193,7 @@ async def get_all_collections(
193193 raise HTTPException (
194194 status_code = 400 ,
195195 detail = f"Field '{ field } ' is not sortable. Sortable fields are: { ', ' .join (sortable_fields )} . "
196- + "Text fields are not sortable by default in Elasticsearch . "
196+ + "Text fields are not sortable by default in Opensearch . "
197197 + "To make a field sortable, update the mapping to use 'keyword' type or add a '.keyword' subfield. " ,
198198 )
199199 formatted_sort .append ({field : {"order" : direction }})
@@ -250,7 +250,7 @@ async def get_all_collections(
250250 # Convert string filter to dict if needed
251251 if isinstance (filter , str ):
252252 filter = orjson .loads (filter )
253- # Convert the filter to an Elasticsearch query using the filter module
253+ # Convert the filter to an Opensearch query using the filter module
254254 es_query = filter_module .to_es (await self .get_queryables_mapping (), filter )
255255 query_parts .append (es_query )
256256
@@ -298,7 +298,7 @@ async def get_one_item(self, collection_id: str, item_id: str) -> Dict:
298298 NotFoundError: If the specified Item does not exist in the Collection.
299299
300300 Notes:
301- The Item is retrieved from the Elasticsearch database using the `client.get` method,
301+ The Item is retrieved from the Opensearch database using the `client.get` method,
302302 with the index for the Collection as the target index and the combined `mk_item_id` as the document id.
303303 """
304304 try :
@@ -602,10 +602,6 @@ async def apply_cql2_filter(
602602 otherwise the original Search object.
603603 """
604604 if _filter is not None :
605- if isinstance (_filter , str ):
606- import json
607-
608- _filter = json .loads (_filter )
609605 es_query = filter_module .to_es (await self .get_queryables_mapping (), _filter )
610606 search = search .filter (es_query )
611607
0 commit comments