Sql Server Full Text Search

Description

SQL Server full-text search can be used as the backing implementation for Flex search operations. Your application code should depend on IFlexSearchStore, while Flex provides the provider bridge and wiring.

Important concepts

  • IFlexSearchStore is the contract: app code performs searches and indexing through the shared interface.

  • Table + column configuration: SQL Server full-text search requires a target table, an ID column, and searchable columns.

  • Provider bridge: the SQL Server implementation is exposed via an IFlexSearchStoreBridge internally, but most consumers only need IFlexSearchStore.

Configuration in DI

Add the provider in your DI composition root (commonly in EndPoints/...CommonConfigs/OtherApplicationServicesConfig.cs or wherever you centralize registrations).

// using Sumeru.Flex; // IFlexSearchStore

public static class OtherApplicationServicesConfig
{
	public static IServiceCollection AddOtherApplicationServices(
		this IServiceCollection services,
		IConfiguration configuration)
	{
		// Registers SQL Server full-text search as the IFlexSearchStore bridge.
		// Flex auto-wires generated Queries/Plugins that *use* IFlexSearchStore.
		services.AddFlexSqlServerSearchStore(configuration);

		return services;
	}
}

appsettings.json

Configuration is read from FlexBase:DataStores:Search:SqlServer.

Examples (template-based)

These examples mirror the generated Query and PostBus plugin templates. You do not register these types manually—Flex discovers and wires generated Queries/Handlers/Plugins automatically.

Search a single document (Query)

SQL Server considerations

  • Ensure SQL Server Full-Text Search is installed/enabled for the instance.

  • The configured database identity must be able to query the full-text catalog and underlying table(s).

Last updated