> For the complete documentation index, see [llms.txt](https://docs.flexbase.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flexbase.in/data-and-providers/data-stores/search-store-full-text.md).

# Search Store (Full Text)

## Description

Full-text search providers register through `IFlexSearchStore`. Your application code stays provider-agnostic while the selected provider handles indexing and query execution.

## Infrastructure arrangement

When you add a full-text search provider through **Flex Studio**, Flex generates the provider infrastructure and configuration:

1. Provider files under `Infrastructure/Providers/{YourApplication}.DataStoreProviders/Search/{Provider}/`
2. Default configuration under `Application/EndPoints/{YourApplication}.EndPoint.CommonConfigs/AppSettings/DataStores/Search/{Provider}.json`

Flex auto-wires generated Queries/Handlers/Plugins that use `IFlexSearchStore`—you only register the provider.

## Configuration in DI

Register only the provider search store you need.

```csharp
// Pick ONE provider.
services.AddFlexSqlServerSearchStore(configuration);
// services.AddFlexPostgreSqlSearchStore(configuration);
// services.AddFlexElasticsearchStore(configuration);
```

## appsettings.json

Full-text search configuration is read from `FlexBase:DataStores:Search:<Provider>`.

```json
{
  "FlexBase": {
    "DataStores": {
      "Search": {
        "SqlServer": {
          "ConnectionString": "Server=...;Database=...;User Id=...;Password=<store-in-secrets>;TrustServerCertificate=True",
          "TableName": "dbo.Articles",
          "IdColumn": "Id",
          "SearchableColumns": [ "Title", "Body" ]
        }
      }
    }
  }
}
```

## Sample usage ({YourApplication})

```csharp
public class PolicySearch
{
	private readonly IFlexSearchStore _searchStore;

	public PolicySearch(IFlexSearchStore searchStore)
		=> _searchStore = searchStore;

	public Task<IReadOnlyList<PolicySearchDocument>> SearchAsync(string query)
		=> _searchStore.SearchAsync<PolicySearchDocument>(query, take: 25);
}

public class PolicySearchDocument
{
	public string Id { get; set; }
}
```

## Provider pages

* SQL Server: `search-store-full-text/sql-server-full-text-search.md`
* PostgreSQL: `search-store-full-text/postgre-sql-full-text-search.md`
* Elasticsearch: `search-store-full-text/elastic-search.md`

## Provider considerations

* Use full-text search for keyword-based scenarios (known terms, filters, “contains” style queries).
* If you need provider-specific SQL fragments, use `ProviderSqlMap` inside generated plugins/queries.
* For semantic search, use the Vector Store and keep full-text as a complementary filter.
