Search using sparse vector with cosdata client
(collection, query_terms, top_k=10, early_terminate_threshold=0.0)
| 97 | |
| 98 | |
| 99 | def search_sparse_vector(collection, query_terms, top_k=10, early_terminate_threshold=0.0): |
| 100 | """Search using sparse vector with cosdata client""" |
| 101 | # query_terms should already be in the correct format from format_for_server_query |
| 102 | results = collection.search.sparse( |
| 103 | query_terms=query_terms, |
| 104 | top_k=top_k, |
| 105 | early_terminate_threshold=early_terminate_threshold, |
| 106 | ) |
| 107 | return results |
| 108 | |
| 109 | |
| 110 | def batch_ann_search(collection, batch, top_k=10, early_terminate_threshold=0.0): |