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

Add Linq support for full text search #4941

Open
xqrzd opened this issue Dec 27, 2024 · 2 comments
Open

Add Linq support for full text search #4941

xqrzd opened this issue Dec 27, 2024 · 2 comments
Assignees
Labels

Comments

@xqrzd
Copy link

xqrzd commented Dec 27, 2024

We use linq pretty heavily to generate dynamic queries, so it would be great if there was a way to call FullTextContains, FullTextContainsAll, FullTextContainsAny etc. from linq.

@Pilchie
Copy link
Member

Pilchie commented Dec 30, 2024

Tagging @adityasa

@adityasa
Copy link
Contributor

adityasa commented Jan 3, 2025

@leminh98 - can you please take a look? Seems similar to other extension methods like IsDefined.

microsoft-github-policy-service bot pushed a commit that referenced this issue Feb 19, 2025
…y as LINQ extension method (#4980)

# Pull Request Template

## Description

This PR introduces three new LINQ extension methods to provide support
for Full Text Search. The new methods are `FullTextContains`,
`FullTextContainsAll`, and `FullTextContainsAny`.

Usage example:

```csharp
// FullTextContains
var query = container.GetItemLinqQueryable<Items>.Where(item => item.Description.FullTextContains("bug"))
// FullTextContainsAll
var queryAll1 = container.GetItemLinqQueryable<Items>.Where(item => item.Description.FullTextContainsAll("bug"))
var queryAll2 = container.GetItemLinqQueryable<Items>.Where(item => item.Description.FullTextContainsAll("Syntax Error", "Out Of Memory", "Stack overflow"))

// FullTextContainsAny
var queryAny1 = container.GetItemLinqQueryable<Items>.Where(item => item.Description.FullTextContainsAny("bug"))
var queryAny2 = container.GetItemLinqQueryable<Items>.Where(item => item.Description.FullTextContainsAny("Syntax Error", "Out Of Memory", "Stack overflow"))
```

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## Closing issues
#4941
To automatically close an issue: closes #IssueNumber

---------

Co-authored-by: leminh98 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants