Skip to content

feat: expand SearchAttribute includes/excludes filtering#731

Merged
ascott18 merged 5 commits into
mainfrom
ascott18/expand-searchattribute-filtering
Jun 30, 2026
Merged

feat: expand SearchAttribute includes/excludes filtering#731
ascott18 merged 5 commits into
mainfrom
ascott18/expand-searchattribute-filtering

Conversation

@ascott18

Copy link
Copy Markdown
Collaborator

Search currently applies [Search] uniformly, which made it hard to scope searchable fields by request context. This adds include/exclude-aware search behavior so models can opt search fields in or out based on the request includes value.

What changed

  • Added SearchAttribute.Includes and SearchAttribute.Excludes for content-view-style search scoping.
  • Applied this filtering in ApplyListSearchTerm for normal list search clauses.
  • Kept directly targeted field:value search behavior unrestricted at the initial property match (per review feedback), while still filtering downstream search statements.
  • Implemented short-circuit logic in ShouldSearchProperty for requests with no incoming includes value.
  • Expanded Search attribute XML docs and modeling docs to document include/exclude behavior.
  • Updated docs to explicitly tie this behavior to the existing Includes concept and added dedicated coverage in docs/concepts/includes.md.

Notes for review

  • Filtering is intentionally based on existing IDataSourceParameters.Includes; no new filter parameter was introduced.
  • If both Includes and Excludes are set on SearchAttribute, Includes takes precedence.

ascott18 and others added 4 commits June 18, 2026 14:07
…tent views

Add support for filtering searchable properties based on content views:
- Add Includes and Excludes properties to SearchAttribute
- Add SearchIncludes and SearchExcludes properties to PropertyViewModel
- Add ContentView property to IFilterParameters and implementations
- Implement filtering logic in ApplyListSearchTerm
- Update documentation with examples

Includes: properties only searched when matching content view
Excludes: properties not searched when matching content view

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address review feedback by wiring SearchAttribute Includes/Excludes to IDataSourceParameters.Includes, removing extra filter-parameter surface area, refining short-circuit logic in ApplyListSearchTerm, and clarifying related documentation in search.md and includes.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…hattribute-filtering

# Conflicts:
#	CHANGELOG.md

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds include/exclude-aware scoping for [Search] so search participation can be controlled by the request includes string (the existing “includes string” concept used for shaping loading/serialization), and documents the new behavior.

Changes:

  • Added SearchAttribute.Includes / SearchAttribute.Excludes and documented their precedence and usage.
  • Applied include/exclude filtering to list search clause generation in ApplyListSearchTerm.
  • Updated modeling/concepts docs and added a CHANGELOG entry for the new feature.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/IntelliTect.Coalesce/DataAnnotations/SearchAttribute.cs Introduces Includes/Excludes properties and XML docs describing include/exclude-based search scoping.
src/IntelliTect.Coalesce/Api/DataSources/QueryableDataSourceBase`1.cs Adds ShouldSearchProperty and applies it when building list search predicates.
docs/modeling/model-components/attributes/search.md Documents new [Search(Includes=...)] / [Search(Excludes=...)] behavior with examples.
docs/concepts/includes.md Adds a dedicated section tying the includes string concept to search scoping.
CHANGELOG.md Records the new search scoping feature for release notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/IntelliTect.Coalesce/Api/DataSources/QueryableDataSourceBase`1.cs Outdated
…rchProperty

Refactor ShouldSearchProperty to short-circuit before any string
allocation when a property has no Includes/Excludes constraints, and
trim the incoming content view once. Add unit tests covering Includes
match, Excludes match, Includes precedence over Excludes, comma-separated
lists, and the no-incoming-content-view short-circuit.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ascott18 ascott18 merged commit 47a3470 into main Jun 30, 2026
17 checks passed
@ascott18 ascott18 deleted the ascott18/expand-searchattribute-filtering branch June 30, 2026 04:20
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