Skip to content

Refactor message body full-text search configuration and tests - #5708

Merged
johnsimons merged 3 commits into
masterfrom
john_MessagesView
Aug 10, 2026
Merged

Refactor message body full-text search configuration and tests#5708
johnsimons merged 3 commits into
masterfrom
john_MessagesView

Conversation

@johnsimons

Copy link
Copy Markdown
Member

The EnableFullTextSearchOnBodies setting is only honored by the RavenDB persister, which uses it to control whether message bodies are indexed for full-text search. EF Core persisters, by design, always index message bodies.

This change removes the redundant EnableFullTextSearchOnBodies setting from the EF Core persistence configuration. Corresponding acceptance tests are updated: a new test is added specifically for RavenDB to verify that the setting correctly disables body search, while the previously shared test for disabled body search is removed as it's not applicable to EF Core.

"processed_at" => source.OrderBy(message => message.LastAttemptedAt, descending),
// Ordering follows the status the view reports, not the one the column stores.
"status" => source.OrderBy(message =>
message.Status == FailedMessageStatus.Resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can this be a switch statement instead of nested ternary?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No. Inside a LINQ expression tree, a switch expression is a compile error: CS8514 "An expression tree may not contain a switch expression."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

😢

@johnsimons
johnsimons enabled auto-merge August 10, 2026 02:17
The `EnableFullTextSearchOnBodies` setting is only honored by the RavenDB persister, which uses it to control whether message bodies are indexed for full-text search. EF Core persisters, by design, always index message bodies.

This change removes the redundant `EnableFullTextSearchOnBodies` setting from the EF Core persistence configuration. Corresponding acceptance tests are updated: a new test is added specifically for RavenDB to verify that the setting correctly disables body search, while the previously shared test for disabled body search is removed as it's not applicable to EF Core.
Search introduces IFullTextSearchDialect beside IIngestionSqlDialect. The full text indexes already existed but nothing queried them. SQL Server ORs two FREETEXT predicates, PostgreSQL matches the indexed tsvector against websearch_to_tsquery with the terms rejoined by OR, so both keep the OR semantics RavenDB's Search defaults to.

PostgreSQL only uses an expression index when the query expression parses to the same tree, and a mismatch is silent: search keeps working, on a sequential scan. The indexed expression is now a constant written the way EF renders it, and FullTextSearchIndexTests fails if the two drift apart.

SQL Server setup now fails with a named error when the Full-Text Search feature is missing, rather than migrating into an instance whose search
endpoint throws.
@johnsimons
johnsimons merged commit 72f34f0 into master Aug 10, 2026
37 checks passed
@johnsimons
johnsimons deleted the john_MessagesView branch August 10, 2026 02:34
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.

3 participants