Installation
Install the Orleans.Search NuGet packages into your Orleans projects.
NuGet Packages
Orleans.Search is distributed as two packages:
| Package | Description |
|---|---|
TGHarker.Orleans.Search | Core library with attributes and source generator |
TGHarker.Orleans.Search.PostgreSql | PostgreSQL search provider |
Installation
Using .NET CLI
# In your grain state project (where your state classes are defined)
dotnet add package TGHarker.Orleans.Search
# In your silo/host project
dotnet add package TGHarker.Orleans.Search.PostgreSqlUsing Package Manager
# In your grain state project
Install-Package TGHarker.Orleans.Search
# In your silo/host project
Install-Package TGHarker.Orleans.Search.PostgreSqlUsing PackageReference
Add to your .csproj files:
<!-- Grain state project -->
<PackageReference Include="TGHarker.Orleans.Search" Version="1.0.0" />
<!-- Silo/host project -->
<PackageReference Include="TGHarker.Orleans.Search.PostgreSql" Version="1.0.0" />Project Structure
A typical Orleans.Search project structure:
MyApp/
├── MyApp.Abstractions/ # Grain interfaces
│ └── IUserGrain.cs
├── MyApp.Grains/ # Grain implementations + state
│ ├── UserGrain.cs
│ └── UserState.cs # Add TGHarker.Orleans.Search here
└── MyApp.Silo/ # Host/silo project
└── Program.cs # Add TGHarker.Orleans.Search.PostgreSql hereVerify Installation
After installation, the source generator should automatically run during build. You can verify by:
- Building your project
- Checking for generated files in
obj/Debug/net10.0/generated/
If you have marked any state classes with [Searchable], you should see generated files like:
YourStateEntity.Generated.csYourStateSearchProvider.Generated.cs
Next Steps
Continue to Quick Start to configure Orleans.Search in your application.