Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DON'T MERGE swap weakAnd to userInput in YQL #142

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all 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
18 changes: 4 additions & 14 deletions src/cpr_sdk/yql_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,16 @@ def build_search_term(self) -> str:
elif self.sensitive:
return """
(
{"targetHits": 1000} weakAnd(
family_name contains(@query_string),
family_description contains(@query_string),
text_block contains(@query_string)
)
userInput(@query_string)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be something that I'm missing when looking at the docs, but I'm struggling to get my head around how userInput 'knows' which fields to look at, do you have a clearer understanding of this you could help me with?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - i think it's the default fields specified in the schema

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that makes sense

)
"""
else:
return """
(
(
{"targetHits": 1000} weakAnd(
family_name contains(@query_string),
family_description contains(@query_string),
text_block contains(@query_string)
)
) or (
[{"targetNumHits": 1000}]
nearestNeighbor(family_description_embedding,query_embedding)
) or (
userInput(@query_string)
)
or (
[{"targetNumHits": 1000}]
nearestNeighbor(text_embedding,query_embedding)
)
Expand Down
Loading