![]() |
VOOZH | about |
dotnet add package Pervaxis.Genesis.Search.AWS --version 3.4.4
NuGet\Install-Package Pervaxis.Genesis.Search.AWS -Version 3.4.4
<PackageReference Include="Pervaxis.Genesis.Search.AWS" Version="3.4.4" />
<PackageVersion Include="Pervaxis.Genesis.Search.AWS" Version="3.4.4" />Directory.Packages.props
<PackageReference Include="Pervaxis.Genesis.Search.AWS" />Project file
paket add Pervaxis.Genesis.Search.AWS --version 3.4.4
#r "nuget: Pervaxis.Genesis.Search.AWS, 3.4.4"
#:package Pervaxis.Genesis.Search.AWS@3.4.4
#addin nuget:?package=Pervaxis.Genesis.Search.AWS&version=3.4.4Install as a Cake Addin
#tool nuget:?package=Pervaxis.Genesis.Search.AWS&version=3.4.4Install as a Cake Tool
AWS OpenSearch search provider for the Pervaxis Genesis platform — full-text search, document indexing, and query capabilities with native AWS integration.
Pervaxis.Genesis.Search.AWS implements the ISearch abstraction from Pervaxis.Core.Abstractions using OpenSearch.Client for AWS OpenSearch. It provides:
<PackageReference Include="Pervaxis.Genesis.Search.AWS" Version="1.0.0" />
{
"Search": {
"Region": "us-east-1",
"DomainEndpoint": "https://my-domain.us-east-1.es.amazonaws.com",
"IndexPrefix": "prod-",
"DefaultPageSize": 10,
"RequestTimeoutSeconds": 30,
"MaxRetries": 3,
"EnableDebugMode": false
}
}
| Property | Type | Default | Description |
|---|---|---|---|
Region |
string |
(required) | AWS region (e.g., "us-east-1", "ap-south-1") |
DomainEndpoint |
string |
(required) | OpenSearch domain endpoint URL |
IndexPrefix |
string |
"" |
Optional prefix for all indices (e.g., "prod-", "tenant-123-") |
DefaultPageSize |
int |
10 |
Default number of search results to return |
RequestTimeoutSeconds |
int |
30 |
Request timeout in seconds |
MaxRetries |
int |
3 |
Maximum number of retries for failed requests |
EnableDebugMode |
bool |
false |
Enable detailed logging |
Username |
string? |
null |
Username for basic authentication (optional) |
Password |
string? |
null |
Password for basic authentication (optional) |
For self-managed OpenSearch clusters with basic authentication:
{
"Search": {
"Region": "us-east-1",
"DomainEndpoint": "https://my-opensearch-cluster.example.com:9200",
"Username": "admin",
"Password": "strong-password"
}
}
using Pervaxis.Genesis.Search.AWS.Extensions;
var builder = WebApplication.CreateBuilder(args);
// Register OpenSearch
builder.Services.AddGenesisSearch(
builder.Configuration.GetSection("Search"));
using Pervaxis.Genesis.Search.AWS.Extensions;
using Pervaxis.Genesis.Search.AWS.Options;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGenesisSearch(options =>
{
options.Region = "us-east-1";
options.DomainEndpoint = "https://my-domain.us-east-1.es.amazonaws.com";
options.IndexPrefix = "prod-";
options.DefaultPageSize = 20;
});
using Pervaxis.Core.Abstractions.Genesis.Modules;
public class ProductService
{
private readonly ISearch _search;
public ProductService(ISearch search)
{
_search = search;
}
public async Task IndexProductAsync(Product product)
{
var indexed = await _search.IndexAsync(
index: "products",
id: product.Id.ToString(),
document: product);
Console.WriteLine($"Product indexed: {indexed}");
}
}
public async Task<IEnumerable<Product>> SearchProductsAsync(string query)
{
var results = await _search.SearchAsync<Product>(
index: "products",
query: query);
return results;
}
OpenSearch supports rich query string syntax:
// Simple term search
var results = await _search.SearchAsync<Product>("products", "laptop");
// Field-specific search
var results = await _search.SearchAsync<Product>("products", "name:laptop");
// Boolean operators
var results = await _search.SearchAsync<Product>("products", "laptop AND available:true");
// Wildcard search
var results = await _search.SearchAsync<Product>("products", "lap*");
// Range queries
var results = await _search.SearchAsync<Product>("products", "price:[100 TO 500]");
public async Task BulkIndexProductsAsync(List<Product> products)
{
var documents = products.ToDictionary(
p => p.Id.ToString(),
p => p);
var successCount = await _search.BulkIndexAsync(
index: "products",
documents: documents);
Console.WriteLine($"{successCount}/{products.Count} products indexed");
}
public async Task DeleteProductAsync(string productId)
{
var deleted = await _search.DeleteAsync(
index: "products",
id: productId);
Console.WriteLine($"Product deleted: {deleted}");
}
Use index prefixes to isolate data by tenant or environment:
// Configuration
options.IndexPrefix = "tenant-123-";
// Indexes to "tenant-123-products"
await _search.IndexAsync("products", "1", product);
// Searches "tenant-123-products"
await _search.SearchAsync<Product>("products", "laptop");
Your application needs these IAM permissions for AWS OpenSearch:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"es:ESHttpGet",
"es:ESHttpHead",
"es:ESHttpPost",
"es:ESHttpPut",
"es:ESHttpDelete"
],
"Resource": "arn:aws:es:region:account-id:domain/domain-name/*"
}
]
}
All methods throw GenesisException on failure:
using Pervaxis.Genesis.Base.Exceptions;
try
{
await _search.IndexAsync("products", "1", product);
}
catch (GenesisException ex)
{
_logger.LogError(ex, "Failed to index product: {Message}", ex.Message);
}
DefaultPageSize based on your use caseEnableDebugMode only for developmentRequestTimeoutSeconds based on your query complexityIncrease RequestTimeoutSeconds:
{
"Search": {
"RequestTimeoutSeconds": 60
}
}
Increase MaxRetries or implement exponential backoff:
{
"Search": {
"MaxRetries": 5
}
}
Enable debug logging to see detailed request/response information:
{
"Search": {
"EnableDebugMode": true
}
}
Copyright © 2026 Clarivex Technologies Private Limited. All rights reserved.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.