GXE.Umbraco.AzureAISearch 1.10.1

dotnet add package GXE.Umbraco.AzureAISearch --version 1.10.1
                    
NuGet\Install-Package GXE.Umbraco.AzureAISearch -Version 1.10.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GXE.Umbraco.AzureAISearch" Version="1.10.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GXE.Umbraco.AzureAISearch" Version="1.10.1" />
                    
Directory.Packages.props
<PackageReference Include="GXE.Umbraco.AzureAISearch" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GXE.Umbraco.AzureAISearch --version 1.10.1
                    
#r "nuget: GXE.Umbraco.AzureAISearch, 1.10.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GXE.Umbraco.AzureAISearch@1.10.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GXE.Umbraco.AzureAISearch&version=1.10.1
                    
Install as a Cake Addin
#tool nuget:?package=GXE.Umbraco.AzureAISearch&version=1.10.1
                    
Install as a Cake Tool

Umbraco.AzureAISearch

Azure AI Search provider for Umbraco Search — designed to work seamlessly with Microsoft Foundry while also supporting direct ranked search via the ISearcher interface.

Requires Umbraco 17+ and an Azure AI Search instance.


Why this package?

Microsoft Foundry expects an Azure AI Search index with specific fields — content, url, and title — to ground AI responses. This package indexes Umbraco content directly into that schema, so you can connect your CMS to Foundry without any manual field mapping or data transformation.

At the same time, it maintains relevance tiers and a scoring profile for high-quality direct search results when querying outside of Foundry.

Foundry uses: content, url, title
Direct search uses: contentR1 (4×), contentR2 (3×), contentR3 (2×), content (1×)


Quick Start

1. Install

dotnet add package Umbraco.Cms.Search.Core
dotnet add package GXE.Umbraco.AzureAISearch

2. Configure

Add to appsettings.json:

{
  "AzureAISearch": {
    "Endpoint": "https://your-service.search.windows.net",
    "Key": "your-admin-api-key",
    "BaseUrl": "https://www.your-umbraco-site.com",
    "ExcludedContentTypes": [],
    "Environment": null
  }
}
Setting Description
Endpoint Your Azure AI Search service URL
Key Admin API key
BaseUrl (Optional, recommended) Your public Umbraco site URL used to build absolute content links. Do not set this to the Azure Search Endpoint.
ExcludedContentTypes Array of content type aliases to skip during indexing
Environment Optional prefix for index names (e.g. "dev" → dev-publishedcontent)

3. Register

Create a composer:

using Umbraco.AzureAISearch.Extensions;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Search.Core.DependencyInjection;

public sealed class SearchComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        builder.AddSearchCore();
        builder.AddUmbracoAzureAISearch(builder.Config)
               .RebuildAzureAISearchOnStartup(); // optional: full re-index on every startup
    }
}

That's it. On startup, the index is created automatically. Content is indexed incrementally on save & publish.

Initial Index Population

By default, only new content published after the package is installed gets indexed. To populate the index with all existing content, chain .RebuildAzureAISearchOnStartup():

builder.AddUmbracoAzureAISearch(builder.Config)
       .RebuildAzureAISearchOnStartup();

This triggers a full rebuild via IContentIndexingService on every application start. Once your index is populated, you can remove this call to avoid unnecessary rebuilds — incremental indexing on save/publish will keep the index up to date.


Index Schema

The generated Azure AI Search index contains:

Field Type Purpose
id String (Key) Unique document identifier ({guid}_{culture}_{segment})
key String Umbraco content GUID
objectType String Umbraco object type
culture String Culture code or "inv"
segment String Segment or "def"
title String Content node name
content String All text combined, HTML-stripped — Foundry searches this
contentR1 Collection High-relevance text (titles, headings)
contentR2 Collection Medium-relevance text
contentR3 Collection Lower-relevance text
url String Full absolute URL
accessKeys Collection Content protection keys

Searching

Inject IAzureAISearchSearcher for direct search with full scoring:

using Umbraco.AzureAISearch.Services.Searcher;

public class SiteSearchService(IAzureAISearchSearcher searcher)
{
    public async Task<SearchResult> SearchAsync(string query, string? culture = null)
        => await searcher.SearchAsync(
            indexAlias: Umbraco.Cms.Search.Core.Constants.IndexAliases.PublishedContent,
            query: query,
            culture: culture,
            skip: 0,
            take: 20);
}

The scoring profile automatically boosts contentR1 (4×) over contentR2 (3×) over contentR3 (2×) over content (1×).


Microsoft Foundry Integration

Once content is indexed, connect the Azure AI Search index in Foundry:

  1. Go to your Foundry project → Data sources
  2. Add an Azure AI Search connection pointing to your search service
  3. Select the index (e.g. publishedcontent or dev-publishedcontent)
  4. Foundry will use the content field for search and url/title for grounding responses

No additional mapping or field configuration is needed in Foundry.


Server Role Awareness

On multi-server deployments, only the primary node manages the index. Subscriber nodes skip all write operations automatically.


Releasing a New Version

  1. Ensure all changes are committed and pushed to main
  2. Tag the release with the version number:
    git tag v1.2.0
    git push --tags
    
  3. The GitHub Actions workflow automatically builds, tests, and publishes to NuGet.org via Trusted Publishing (no API key required)

The version in the tag (e.g. v1.2.0) is used as the package version — no need to update .csproj manually.


License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.10.1 136 9/7/2026
1.0.9 225 7/7/2026
1.0.8 117 7/7/2026
1.0.7 117 7/7/2026
1.0.6 129 7/7/2026
1.0.5 121 7/6/2026
1.0.4 123 7/6/2026
1.0.3 116 7/6/2026
1.0.2 134 7/6/2026
1.0.1 115 7/6/2026
1.0.0 126 7/6/2026