Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cosmos: support for full-text search #35476

@roji

Description

@roji

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).

Sub-issues

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions