Skip to content

Fix unqualified search for collector instances table (#25479)#25567

Open
kroepke wants to merge 2 commits intomasterfrom
fix_attribute_search
Open

Fix unqualified search for collector instances table (#25479)#25567
kroepke wants to merge 2 commits intomasterfrom
fix_attribute_search

Conversation

@kroepke
Copy link
Copy Markdown
Member

@kroepke kroepke commented Apr 7, 2026

Description

SearchQueryParser ignored bsonFilterCreator and dbField overrides when resolving the default search field from EntityAttributes. Unqualified searches (bare terms without a field: prefix) generated queries against the literal default field name instead of using the attribute's custom filter logic, producing empty results for fields backed by attribute arrays.

Resolve the default field from the dbFieldMapping after it is built so it inherits the bsonFilterCreator and correct dbField. Also update the collector instances resource to use hostname as the default search field instead of instance_uid.

/nocl internal improvement

Fixes #25479

How Has This Been Tested?

Added test cases.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

SearchQueryParser ignored bsonFilterCreator and dbField overrides when
resolving the default search field from EntityAttributes. Unqualified
searches (bare terms without a field: prefix) generated queries against
the literal default field name instead of using the attribute's custom
filter logic, producing empty results for fields backed by attribute
arrays.

Resolve the default field from the dbFieldMapping after it is built so
it inherits the bsonFilterCreator and correct dbField. Also update the
collector instances resource to use hostname as the default search
field instead of instance_uid.
@kroepke kroepke requested a review from a team April 7, 2026 15:09
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.

Instances table does not have a default search field

2 participants