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

Use the IN operator for recommender filter with structured indexes #830

Merged
merged 1 commit into from
May 7, 2024

Conversation

farshidz
Copy link
Collaborator

@farshidz farshidz commented May 6, 2024

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    For structured indexes, use the IN operator for recommender input document exclusion

  • What is the current behavior? (You can also link to an open issue here)
    Conjunction of OR operators. From experience we know this is prone to SO errors in Vespa due to a Vespa bug

  • What is the new behavior (if this is a feature change)?
    Use the safer IN operator if index is structured

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    No

  • Have unit tests been run against this PR? (Has there also been any additional testing?)

  • Related Python client changes (link commit/PR here)

  • Related documentation changes (link commit/PR here)

  • Other information:

  • Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added / updated (for bug fixes / features)

@farshidz farshidz temporarily deployed to marqo-test-suite May 6, 2024 07:37 — with GitHub Actions Inactive
@@ -202,8 +202,11 @@ def _get_default_interpolation_method(self, marqo_index: MarqoIndex) -> Interpol
else:
return InterpolationMethod.LERP

def _get_exclusion_filter(self, documents: List[str], user_filter: Optional[str]) -> str:
not_in = 'NOT (' + ' OR '.join([f'_id:({doc})' for doc in documents]) + ')'
def _get_exclusion_filter(self, marqo_index: MarqoIndex, documents: List[str], user_filter: Optional[str]) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need a small test on this to track the divergence between structured and unstructured indexes?

@farshidz farshidz merged commit f0b39b3 into mainline May 7, 2024
29 of 31 checks passed
@farshidz farshidz deleted the farshid/recommender-in-operator branch May 7, 2024 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants