Skip to content

Add PrefixSearch for full-text prefix matching (GH-1327)#4128

Merged
jeremydmiller merged 1 commit intomasterfrom
GH1327
Feb 11, 2026
Merged

Add PrefixSearch for full-text prefix matching (GH-1327)#4128
jeremydmiller merged 1 commit intomasterfrom
GH1327

Conversation

@jeremydmiller
Copy link
Member

Summary

How it works

PostgreSQL's to_tsquery('english', 'Priced:*') matches any lexeme starting with "priced" (after stemming). Since "PricedIdeaScreening" is stored as a single lexeme 'pricedideascreening', the prefix 'price:*' matches it.

The PrefixSearch parser transforms the user's input by appending :* to each word and joining with & (AND), then passes it to to_tsquery. For example:

  • "Priced"to_tsquery('english', 'Priced:*')
  • "Priced Idea"to_tsquery('english', 'Priced:* & Idea:*')

Test plan

  • New test prefix_search_matches_partial_enum_value_GH_1327 verifies that PrefixSearch("Priced") matches a document containing "PricedIdeaScreening" while standard Search("Priced") does not
  • Existing NgramSearch tests pass (7/7)
  • Build succeeds with 0 errors

🤖 Generated with Claude Code

Adds PrefixSearch LINQ extension method that uses PostgreSQL's :* prefix
matching operator with to_tsquery. This enables partial word matching in
full-text search, e.g. searching "Priced" matches "PricedIdeaScreening".
Useful for enum values stored as strings or other concatenated identifiers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Text search on document not returning any results, when desired value is an enum and required parameter is not exact match(Case Insensitive)

1 participant