You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: entity-framework/core/what-is-new/ef-core-10.0/whatsnew.md
+143
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,149 @@ EF10 requires the .NET 10 SDK to build and requires the .NET 10 runtime to run.
21
21
22
22
## Azure Cosmos DB for NoSQL
23
23
24
+
<aname="full-text-search-support"></a>
25
+
26
+
### Full-text search support
27
+
28
+
Azure Cosmos DB now offers support for [full-text search](/azure/cosmos-db/gen-ai/full-text-search). It enables efficient and effective text searches, as well as evaluating the relevance of documents to a given search query. It can be used in combination with vector search to improve the accuracy of responses in some AI scenarios.
29
+
EF Core 10 is adding support for this feature allowing for modeling the database with full-text search enabled properties and using full-text search functions inside queries targeting Azure Cosmos DB.
> Configuring the index is not mandatory, but it is recommended as it greatly improves performance of full-text search queries.
62
+
63
+
Full-text search operations are language specific, using American English (`en-US`) by default. You can customize the language for individual properties as part of `EnableFullTextSearch` call:
You can also set a default language for the container - unless overridden in the `EnableFullTextSearch` method, all full-text properties inside the container will use that language.
As part of the full-text search feature, Azure Cosmos DB introduced several built-in functions which allow for efficient querying of content inside the full-text search enabled properties. These functions are: `FullTextContains`, `FullTextContainsAll`, `FullTextContainsAny`, which look for specific keyword or keywords and `FullTextScore`, which returns [BM25 score](https://en.wikipedia.org/wiki/Okapi_BM25) based on provided keywords.
101
+
102
+
> [!NOTE]
103
+
> `FullTextScore` can only be used inside `OrderBy` to rank the documents based on the score.
104
+
105
+
EF Core exposes these functions as part of `EF.Functions` so they can be used in queries:
Full-text search can be used with vector search in the same query (i.e. hybrid search), by combining results of `FullTextScore` and `VectorDistance` functions. It can be done using the `RRF` function (Reciprocal Rank Fusion), which EF Core also provides inside `EF.Functions`:
> You can combine more than two scoring functions inside `Rrf` call, as well as using only `FullTextScore`, or only `VectorDistance`.
156
+
157
+
<aname="full-text-search-limitations"></a>
158
+
159
+
#### Limitations
160
+
161
+
Here are some current limitations of the full-text search using EF Core:
162
+
163
+
-`FullTextScore` and `RRF` functions can only be used inside `OrderBy` and are mutually exclusive with other forms of ordering.
164
+
- EF Core can't create a container with full-text search or vector properties defined inside collection navigation - you can use those properties in queries, but the database has to be generated by other means (e.g. Microsoft.Azure.Cosmos SDK or using UI on Azure Portal).
165
+
- Keyword arguments for `FullTextContainsAll`, `FullTextContainsAny` and `FullTextScore` have to be either constants or parameters. `FullTextContains` allows more complex expressions.
0 commit comments