feat: expand SearchAttribute includes/excludes filtering#731
Merged
Conversation
…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
There was a problem hiding this comment.
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.Excludesand 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.
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 requestincludesvalue.What changed
SearchAttribute.IncludesandSearchAttribute.Excludesfor content-view-style search scoping.ApplyListSearchTermfor normal list search clauses.field:valuesearch behavior unrestricted at the initial property match (per review feedback), while still filtering downstream search statements.ShouldSearchPropertyfor requests with no incomingincludesvalue.docs/concepts/includes.md.Notes for review
IDataSourceParameters.Includes; no new filter parameter was introduced.IncludesandExcludesare set onSearchAttribute,Includestakes precedence.