From 4cb546e53d710ba7c50794bde88a8832944538cb Mon Sep 17 00:00:00 2001 From: Kalyan Dutia Date: Mon, 16 Dec 2024 18:00:45 +0000 Subject: [PATCH] enable token-based lexical search (#162) * enable token-based lexical search * bump version to 1.11.0 --- src/cpr_sdk/version.py | 4 ++-- src/cpr_sdk/yql_builder.py | 15 +++------------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/cpr_sdk/version.py b/src/cpr_sdk/version.py index 535d900..f580e9c 100644 --- a/src/cpr_sdk/version.py +++ b/src/cpr_sdk/version.py @@ -1,6 +1,6 @@ _MAJOR = "1" -_MINOR = "10" -_PATCH = "2" +_MINOR = "11" +_PATCH = "0" _SUFFIX = "" VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR) diff --git a/src/cpr_sdk/yql_builder.py b/src/cpr_sdk/yql_builder.py index f7df797..f8b9aee 100644 --- a/src/cpr_sdk/yql_builder.py +++ b/src/cpr_sdk/yql_builder.py @@ -59,23 +59,14 @@ def build_search_term(self) -> str: elif self.sensitive: return """ ( - {"targetHits": 1000} weakAnd( - family_name_index contains(@query_string), - family_description_index contains(@query_string), - text_block contains(@query_string) - ) + (userInput(@query_string)) ) """ else: return """ ( - ( - {"targetHits": 1000} weakAnd( - family_name_index contains(@query_string), - family_description_index contains(@query_string), - text_block contains(@query_string) - ) - ) or ( + (userInput(@query_string)) + or ( [{"targetNumHits": 1000}] nearestNeighbor(family_description_embedding,query_embedding) ) or (