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 · May be fixed by #35868
Open

Cosmos: support for full-text search #35476

roji opened this issue Jan 14, 2025 · 0 comments · May be fixed by #35868

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).
@roji roji added this to the 10.0.0 milestone Jan 15, 2025
maumar added a commit that referenced this issue Mar 29, 2025
outstanding work:
- support for FTS Container building using Azure.ResourceManager.CosmosDb (currently blocked)
- support for Owned types (adjust model in tests and fix paths) - this also needs to happen for vector search
- add model building support for default language,
- add more tests for hybrid search,
- add more model validation tests for invalid scenarios (index on multiple columns, FTS on non-string etc)
- add xml docs,
- clean up exception messages and put them in a resource file,
- solve the problem of parameterized Skip/Take,

Fixes #35476
Fixes #35853
@maumar maumar linked a pull request Mar 29, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants