Skip to content

fix: use OR logic for domain_guids filter in search_assets#214

Open
mothership-ai[bot] wants to merge 1 commit intomainfrom
fix/LINTEST-563-domain-guids-or-logic
Open

fix: use OR logic for domain_guids filter in search_assets#214
mothership-ai[bot] wants to merge 1 commit intomainfrom
fix/LINTEST-563-domain-guids-or-logic

Conversation

@mothership-ai
Copy link
Copy Markdown

@mothership-ai mothership-ai Bot commented Mar 12, 2026

Session owner: @viswesh

Summary

  • Fixed domain_guids filter in search_assets to use OR logic instead of AND
  • Previously, iterating over each GUID with .where(Asset.DOMAIN_GUIDS.eq(guid)) required assets to match ALL domains simultaneously
  • Now uses Asset.DOMAIN_GUIDS.within(domain_guids) which matches assets in ANY of the provided domains

Context

When an AI agent (MCP/Chat) finds DataDomains and then searches for DataProducts linked to those domain GUIDs, the AND logic causes 0 results because no asset belongs to multiple domains at once. The customer (Edenred) reported this as inability to list DataProducts under SmartER domains.

Fixes: LINTEST-563

Test plan

  • Search with single domain GUID returns matching assets (unchanged behavior)
  • Search with multiple domain GUIDs returns assets from ANY of those domains (was returning 0 before)
  • Verify no regression in other search_assets filters

🤖 Generated with Claude Code

The domain_guids filter was applying AND logic by iterating over each
GUID and adding a separate .where() clause. This meant an asset would
need to belong to ALL specified domains simultaneously to match, which
is incorrect — it should match assets in ANY of the provided domains.

Replace the loop with a single Asset.DOMAIN_GUIDS.within(domain_guids)
call that uses Elasticsearch Terms query (OR logic).

Fixes: LINTEST-563

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mothership-ai mothership-ai Bot requested review from Hk669 and firecast as code owners March 12, 2026 15:33
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.

1 participant