Azure AI Search provider for EasyAppDev.Blazor.AutoComplete.AI semantic search. Provides cloud-native vector search with hybrid (vector + keyword) search and semantic ranking support.
$ dotnet add package EasyAppDev.Blazor.AutoComplete.AI.AzureSearchAzure AI Search integration for semantic search with the Blazor AutoComplete component.
dotnet add package EasyAppDev.Blazor.AutoComplete.AI.AzureSearch
// Program.cs
builder.Services.AddAutoCompleteAzureSearch<Product>(
endpoint: "https://mysearch.search.windows.net",
apiKey: "your-admin-key",
indexName: "products",
options => {
options.EnableSemanticRanking = true;
options.SemanticConfigurationName = "my-semantic-config";
},
textSelector: p => $"{p.Name} {p.Description}",
idSelector: p => p.Id.ToString());
// Register embedding generator
builder.Services.AddAutoCompleteVectorSearch<Product>(
openAiApiKey: "sk-...");
@using EasyAppDev.Blazor.AutoComplete.AI
<VectorAutoComplete TItem="Product"
TextField="@(p => p.Name)"
@bind-Value="@selectedProduct"
Placeholder="Semantic search..." />
| Option | Description | Default |
|---|---|---|
Endpoint | Azure Search endpoint | Required |
ApiKey | Admin API key | Required |
IndexName | Search index name | Required |
EnableSemanticRanking | Use semantic ranker | false |
VectorFieldName | Vector field in index | embedding |
TopK | Max results to return | 10 |
Azure AI Search combines vector similarity with traditional keyword matching:
options.EnableHybridSearch = true;
options.HybridSearchWeight = 0.5f; // 50% vector, 50% keyword
Use Azure Portal or SDK to create an index with a vector field:
{
"name": "products",
"fields": [
{ "name": "id", "type": "Edm.String", "key": true },
{ "name": "name", "type": "Edm.String", "searchable": true },
{ "name": "embedding", "type": "Collection(Edm.Single)", "dimensions": 1536, "vectorSearchProfile": "default" }
]
}
MIT