Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/marqo/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def search(self, q: Optional[Union[str, dict]] = None, searchable_attributes: Op
track_total_hits: Optional[bool] = None,
approximate_threshold: Optional[float] = None,
language: Optional[str] = None,
sort_by: Optional[dict] = None,
relevance_cutoff: Optional[dict] = None
) -> Dict[str, Any]:
"""Search the index.

Expand Down Expand Up @@ -269,6 +271,8 @@ def search(self, q: Optional[Union[str, dict]] = None, searchable_attributes: Op
track_total_hits: return total number of lexical matches
approximate_threshold: hit ratio threshold for deciding if a nearest neighbor search should be performed as
an exact search, rather than an approximate search
sort_by: a dictionary of the sort_by parameters to be used for sorting the results
relevance_cutoff: a dictionary of the relevance cutoff parameters

Returns:
Dictionary with hits and other metadata
Expand Down Expand Up @@ -308,7 +312,9 @@ def search(self, q: Optional[Union[str, dict]] = None, searchable_attributes: Op
"hybridParameters": hybrid_parameters,
"facets": facets,
"trackTotalHits": track_total_hits,
"language": language
"language": language,
"sortBy": sort_by,
"relevanceCutoff": relevance_cutoff
}

body = {k: v for k, v in body.items() if v is not None}
Expand Down
Loading