@@ -725,6 +725,7 @@ async def search(
725725 hybrid : Hybrid | None = None ,
726726 locales : list [str ] | None = None ,
727727 retrieve_vectors : bool | None = None ,
728+ media : JsonMapping | None = None ,
728729 ) -> SearchResults :
729730 """Search the index.
730731
@@ -786,6 +787,13 @@ async def search(
786787 locales: Specifies the languages for the search. This parameter can only be used with
787788 Milisearch >= v1.10.0. Defaults to None letting the Meilisearch pick.
788789 retrieve_vectors: Return document vector data with search result.
790+ media: The content of media is used as if it were a document to generate request
791+ fragments from the searchFragments parameter. Defaults to None. This parameter can
792+ only be used with Meilisearch >= v1.16.0. In order to use this feature in
793+ Meilisearch v1.16.0 you first need to enable the feature by sending a PATCH request
794+ to /experimental-features with { "multimodal": true }. Because this feature is
795+ experimental it may be removed or updated causing breaking changes in this library
796+ without a major version bump so use with caution.
789797
790798 Returns:
791799 Results of the search
@@ -830,6 +838,7 @@ async def search(
830838 ranking_score_threshold = ranking_score_threshold ,
831839 locales = locales ,
832840 retrieve_vectors = retrieve_vectors ,
841+ media = media ,
833842 )
834843 search_url = f"{ self ._base_url_with_uid } /search"
835844
@@ -1349,6 +1358,7 @@ async def get_documents(
13491358 fields : list [str ] | None = None ,
13501359 filter : Filter | None = None ,
13511360 retrieve_vectors : bool = False ,
1361+ sort : str | None = None ,
13521362 ) -> DocumentsInfo :
13531363 """Get a batch documents from the index.
13541364
@@ -1362,6 +1372,7 @@ async def get_documents(
13621372 retrieve_vectors: If set to True the vectors will be returned with each document.
13631373 Defaults to False. Note: This parameter can only be
13641374 used with Meilisearch >= v1.13.0
1375+ sort: Attribute by which to sort the results. Defaults to None.
13651376
13661377 Returns:
13671378 Documents info.
@@ -1382,6 +1393,9 @@ async def get_documents(
13821393 "limit" : limit ,
13831394 }
13841395
1396+ if sort :
1397+ parameters ["sort" ] = sort
1398+
13851399 if retrieve_vectors :
13861400 parameters ["retrieveVectors" ] = "true"
13871401
@@ -5151,6 +5165,7 @@ def search(
51515165 hybrid : Hybrid | None = None ,
51525166 locales : list [str ] | None = None ,
51535167 retrieve_vectors : bool | None = None ,
5168+ media : JsonMapping | None = None ,
51545169 ) -> SearchResults :
51555170 """Search the index.
51565171
@@ -5212,6 +5227,13 @@ def search(
52125227 locales: Specifies the languages for the search. This parameter can only be used with
52135228 Milisearch >= v1.10.0. Defaults to None letting the Meilisearch pick.
52145229 retrieve_vectors: Return document vector data with search result.
5230+ media: The content of media is used as if it were a document to generate request
5231+ fragments from the searchFragments parameter. Defaults to None. This parameter can
5232+ only be used with Meilisearch >= v1.16.0. In order to use this feature in
5233+ Meilisearch v1.16.0 you first need to enable the feature by sending a PATCH request
5234+ to /experimental-features with { "multimodal": true }. Because this feature is
5235+ experimental it may be removed or updated causing breaking changes in this library
5236+ without a major version bump so use with caution.
52155237
52165238 Returns:
52175239 Results of the search
@@ -5256,6 +5278,7 @@ def search(
52565278 ranking_score_threshold = ranking_score_threshold ,
52575279 locales = locales ,
52585280 retrieve_vectors = retrieve_vectors ,
5281+ media = media ,
52595282 )
52605283
52615284 if self ._pre_search_plugins :
@@ -5584,6 +5607,7 @@ def get_documents(
55845607 fields : list [str ] | None = None ,
55855608 filter : Filter | None = None ,
55865609 retrieve_vectors : bool = False ,
5610+ sort : str | None = None ,
55875611 ) -> DocumentsInfo :
55885612 """Get a batch documents from the index.
55895613
@@ -5597,6 +5621,7 @@ def get_documents(
55975621 retrieve_vectors: If set to True the vectors will be returned with each document.
55985622 Defaults to False. Note: This parameter can only be
55995623 used with Meilisearch >= v1.13.0
5624+ sort: Attribute by which to sort the results. Defaults to None.
56005625
56015626 Returns:
56025627 Documents info.
@@ -5617,6 +5642,9 @@ def get_documents(
56175642 "limit" : limit ,
56185643 }
56195644
5645+ if sort :
5646+ parameters ["sort" ] = sort
5647+
56205648 if retrieve_vectors :
56215649 parameters ["retrieveVectors" ] = "true"
56225650
@@ -5633,6 +5661,7 @@ def get_documents(
56335661 parameters ["fields" ] = fields
56345662
56355663 parameters ["filter" ] = filter
5664+
56365665 response = self ._http_requests .post (f"{ self ._documents_url } /fetch" , body = parameters )
56375666
56385667 return DocumentsInfo (** response .json ())
@@ -8390,6 +8419,7 @@ def _process_search_parameters(
83908419 locales : list [str ] | None = None ,
83918420 retrieve_vectors : bool | None = None ,
83928421 exhaustive_facet_count : bool | None = None ,
8422+ media : JsonMapping | None = None ,
83938423) -> JsonDict :
83948424 if attributes_to_retrieve is None :
83958425 attributes_to_retrieve = ["*" ]
@@ -8444,6 +8474,9 @@ def _process_search_parameters(
84448474 if exhaustive_facet_count is not None :
84458475 body ["exhaustivefacetCount" ] = exhaustive_facet_count
84468476
8477+ if media is not None :
8478+ body ["media" ] = media
8479+
84478480 return body
84488481
84498482
0 commit comments