diff --git a/src/cpr_sdk/version.py b/src/cpr_sdk/version.py index 2d21011..d15aa65 100644 --- a/src/cpr_sdk/version.py +++ b/src/cpr_sdk/version.py @@ -1,6 +1,6 @@ _MAJOR = "1" _MINOR = "10" -_PATCH = "0" +_PATCH = "1" _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 340be82..f7df797 100644 --- a/src/cpr_sdk/yql_builder.py +++ b/src/cpr_sdk/yql_builder.py @@ -60,8 +60,8 @@ def build_search_term(self) -> str: return """ ( {"targetHits": 1000} weakAnd( - family_name contains(@query_string), - family_description contains(@query_string), + family_name_index contains(@query_string), + family_description_index contains(@query_string), text_block contains(@query_string) ) ) @@ -71,8 +71,8 @@ def build_search_term(self) -> str: ( ( {"targetHits": 1000} weakAnd( - family_name contains(@query_string), - family_description contains(@query_string), + family_name_index contains(@query_string), + family_description_index contains(@query_string), text_block contains(@query_string) ) ) or ( diff --git a/tests/test_search_adaptors.py b/tests/test_search_adaptors.py index 5c6f7c6..6864444 100644 --- a/tests/test_search_adaptors.py +++ b/tests/test_search_adaptors.py @@ -339,7 +339,11 @@ def test_vespa_search_adaptor__continuation_tokens__passages(test_vespa): # Collect family & hits for comparison later initial_family_id = initial_response.families[0].id - initial_passages = [h.text_block_id for h in initial_response.families[0].hits] + initial_passages = [ + h.text_block_id + for h in initial_response.families[0].hits + if isinstance(h, Passage) + ] this_continuation = initial_response.this_continuation_token passage_continuation = initial_response.families[0].continuation_token @@ -358,7 +362,9 @@ def test_vespa_search_adaptor__continuation_tokens__passages(test_vespa): assert response.families[0].id == initial_family_id # But Passages SHOULD have changed - new_passages = sorted([h.text_block_id for h in response.families[0].hits]) + new_passages = sorted( + [h.text_block_id for h in response.families[0].hits if isinstance(h, Passage)] + ) assert sorted(new_passages) != sorted(initial_passages) # Previous passage continuation gives initial results @@ -370,7 +376,9 @@ def test_vespa_search_adaptor__continuation_tokens__passages(test_vespa): ) response = vespa_search(test_vespa, request) assert response.families[0].id == initial_family_id - prev_passages = sorted([h.text_block_id for h in response.families[0].hits]) + prev_passages = sorted( + [h.text_block_id for h in response.families[0].hits if isinstance(h, Passage)] + ) assert sorted(prev_passages) != sorted(new_passages) assert sorted(prev_passages) == sorted(initial_passages) @@ -426,10 +434,34 @@ def test_vespa_search_adaptor__continuation_tokens__families_and_passages( # All of these should have different passages from each other assert ( - sorted([h.text_block_id for h in response_one.families[0].hits]) - != sorted([h.text_block_id for h in response_two.families[0].hits]) - != sorted([h.text_block_id for h in response_three.families[0].hits]) - != sorted([h.text_block_id for h in response_four.families[0].hits]) + sorted( + [ + h.text_block_id + for h in response_one.families[0].hits + if isinstance(h, Passage) + ] + ) + != sorted( + [ + h.text_block_id + for h in response_two.families[0].hits + if isinstance(h, Passage) + ] + ) + != sorted( + [ + h.text_block_id + for h in response_three.families[0].hits + if isinstance(h, Passage) + ] + ) + != sorted( + [ + h.text_block_id + for h in response_four.families[0].hits + if isinstance(h, Passage) + ] + ) )