Skip to content

Conversation

wanliAlex
Copy link
Collaborator

@wanliAlex wanliAlex commented May 19, 2025

Change Summary

This pull request fixes a bug when generating lexical queries for required items.

For a lexical query '"required_1" "required_2"' with searchable attributes ['lexical_field_1', 'lexical_field_2'],
Previously, we have:

'marqo__lexical_lexical_field_1 contains "required_1" 
OR marqo__lexical_lexical_field_2 contains "required_1" 
AND marqo__lexical_lexical_field_1 contains "required_2" 
OR marqo__lexical_lexical_field_2 contains "required_2"'

Now we have:

'(marqo__lexical_lexical_field_1 contains "required_1" \
OR marqo__lexical_lexical_field_2 contains "required_1") \
AND (marqo__lexical_lexical_field_1 contains "required_2" \
OR marqo__lexical_lexical_field_1 contains "required_2")'

This fix applies to lexical search and hybrid search, for both structured index and semi-structured index.

Related Jira Ticket

Checklist

  • Tests have been added for changes
  • [n/a] Documentation has been updated
  • [n/a] Breaking changes are clearly identified
  • [n/a] Python client changes linked or N/A

For new field types:

  • Tests cover score modifier usage of this new type
  • Test indexes updated to cover the new type for all APIs (add docs, search, partial update, etc.)

@wanliAlex wanliAlex requested a review from farshidz May 19, 2025 10:32
@wanliAlex wanliAlex changed the title Fix lexical search required items string [releases/2.19] Fix lexical search required items string May 19, 2025
Copy link
Collaborator

@farshidz farshidz left a comment

Choose a reason for hiding this comment

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

Please bump the version

@wanliAlex wanliAlex requested a review from farshidz May 20, 2025 02:27
@farshidz farshidz merged commit 42e56d1 into releases/2.19 May 20, 2025
47 of 52 checks passed
@farshidz farshidz deleted the li/fix-lexical-search branch May 20, 2025 03:03
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.

2 participants