Skip to content

Conversation

@alzarei
Copy link
Owner

@alzarei alzarei commented Nov 24, 2025

Replica of microsoft#13194 (comment) in the Microsoft Repo

…ples

Add comprehensive LINQ filtering demonstrations for the new ITextSearch<TRecord> interface to showcase type-safe search capabilities across multiple connectors.

**GettingStartedWithTextSearch (Step1_Web_Search.cs):**
- Add BingSearchWithLinqFilteringAsync() demonstrating ITextSearch<BingWebPage> with Language and FamilyFriendly filters
- Add GoogleSearchWithLinqFilteringAsync() demonstrating ITextSearch<GoogleWebPage> with Title.Contains() and DisplayLink.EndsWith() filters
- Use interface type declaration (ITextSearch<TRecord>) to showcase the new generic interface
- Include CA1859 pragma suppression with explanation (sample intentionally demonstrates interface usage)

**Concepts (Bing_TextSearch.cs):**
- Add UsingBingTextSearchWithLinqFilteringAsync() with 4 progressive LINQ filter examples
- Demonstrate Language equality, FamilyFriendly boolean filtering, compound AND filters, and complex multi-property filters
- Show both SearchAsync() and GetSearchResultsAsync() usage patterns

**Concepts (Tavily_TextSearch.cs):**
- Add UsingTavilyTextSearchWithLinqFilteringAsync() with 4 progressive LINQ filter examples
- Demonstrate Title.Contains() filtering, compound filters with exclusion (!Contains), full result retrieval with filtering, and complex multi-property filters
- Showcase null-safety patterns with Title != null checks

**Technical Notes:**
- Uses ITextSearch<TRecord> interface type to avoid method ambiguity with legacy ITextSearch
- Generic methods are explicitly implemented, requiring interface type or casting
- All examples include proper null checks for nullable properties
- Maintains backward compatibility with existing simple search examples

Addresses microsoft#10456
@alzarei alzarei merged commit 9604b91 into feature-text-search-linq Nov 24, 2025
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants