Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmos: support for full-text search #35476

Open
roji opened this issue Jan 14, 2025 · 0 comments
Open

Cosmos: support for full-text search #35476

roji opened this issue Jan 14, 2025 · 0 comments

Comments

@roji
Copy link
Member

roji commented Jan 14, 2025

Cosmos has full text support in preview (docs), and we've received a request to enable that from EF.

Implementation-wise, this shouldn't be too different from the work we did for vector search for 9.0 (see #33783, #35074):

  • Allow modeling information for full-text search; this would set up the full-text policy/index when creating a new container.
  • Query translations for the full-text functions (docs).
    • One interesting idea: rather than providiing e.g. EF.Functions. FullTextContains, the user could simply use regular string Contains; if the referenced property is known to have a full-text index (from the model), we would implicitly translate that Contains to FullTextContains. But this needs to be checked (possibly with the Cosmos people): it would mean the user can no longer decide between regular CONTAINS and FullTextContains (is there any reason to use regular CONTAINS on a column which has a full-text index?).
      • This doesn't work, since full-text search does e.g. stemming, and .NET Contains should do bare character search.
    • For FullTextContainsAll and FullTextContainsAny, we can decide to pattern-match the LINQ constructs Where(x => tags.All(t => x.FullTextContains(t))), rather than introducing a direct overload. Though it's simpler - and maybe a bit more discoverable - for us to just provide the exact functions that Cosmos provides.
    • As part of this, translation support for RRF should be done (hybrid search).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants