Skip to content

Commit a091433

Browse files
authored
Support for context documents in search (Personalization) - Revised (#294)
1 parent 36f91c0 commit a091433

File tree

4 files changed

+340
-140
lines changed

4 files changed

+340
-140
lines changed

src/marqo/index.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ def search(self, q: Optional[Union[str, dict]] = None, searchable_attributes: Op
227227
approximate_threshold: Optional[float] = None,
228228
language: Optional[str] = None,
229229
sort_by: Optional[dict] = None,
230-
relevance_cutoff: Optional[dict] = None
230+
relevance_cutoff: Optional[dict] = None,
231+
interpolation_method: Optional[str] = None
231232
) -> Dict[str, Any]:
232233
"""Search the index.
233234
@@ -268,11 +269,12 @@ def search(self, q: Optional[Union[str, dict]] = None, searchable_attributes: Op
268269
rerank_depth: The number of documents to rerank with score modifiers if used with hybrid search.
269270
Number of hits to get from each shard if used with tensor search.
270271
facets: a dictionary of facets to be used for facet search.
271-
track_total_hits: return total number of lexical matches
272+
track_total_hits: Set to True to return total number of lexical or tensor matches
272273
approximate_threshold: hit ratio threshold for deciding if a nearest neighbor search should be performed as
273274
an exact search, rather than an approximate search
274275
sort_by: a dictionary of the sort_by parameters to be used for sorting the results
275276
relevance_cutoff: a dictionary of the relevance cutoff parameters
277+
interpolation_method: the interpolation method to use for combining query & context embeddings.
276278
277279
Returns:
278280
Dictionary with hits and other metadata
@@ -314,7 +316,8 @@ def search(self, q: Optional[Union[str, dict]] = None, searchable_attributes: Op
314316
"trackTotalHits": track_total_hits,
315317
"language": language,
316318
"sortBy": sort_by,
317-
"relevanceCutoff": relevance_cutoff
319+
"relevanceCutoff": relevance_cutoff,
320+
"interpolationMethod": interpolation_method
318321
}
319322

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

tests/v2_tests/test_custom_vector_search.py

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)