Verbex.Sdk
0.2.1
dotnet add package Verbex.Sdk --version 0.2.1
NuGet\Install-Package Verbex.Sdk -Version 0.2.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="Verbex.Sdk" Version="0.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Verbex.Sdk" Version="0.2.1" />
<PackageReference Include="Verbex.Sdk" />
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 Verbex.Sdk --version 0.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Verbex.Sdk, 0.2.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 Verbex.Sdk@0.2.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=Verbex.Sdk&version=0.2.1
#tool nuget:?package=Verbex.Sdk&version=0.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Verbex C# SDK
A comprehensive .NET SDK for interacting with the Verbex Inverted Index REST API.
All methods return domain objects directly rather than wrapped responses.
Requirements
- .NET 8.0 SDK
Building
cd sdk/csharp
dotnet build
Usage
using Verbex.Sdk;
// Create client
using var client = new VerbexClient("http://localhost:8080", "verbexadmin");
// Health check - returns HealthData directly
HealthData health = await client.HealthCheckAsync();
Console.WriteLine($"Server status: {health.Status}");
// Create an index - returns IndexInfo directly
IndexInfo index = await client.CreateIndexAsync(
name: "My Index",
description: "A test index",
inMemory: true
);
Console.WriteLine($"Created index: {index.Identifier}");
// Add documents - returns AddDocumentData directly
AddDocumentData doc1 = await client.AddDocumentAsync(index.Identifier, "The quick brown fox jumps over the lazy dog.");
AddDocumentData doc2 = await client.AddDocumentAsync(index.Identifier, "Machine learning is transforming industries.");
// Search - returns SearchData directly
SearchData results = await client.SearchAsync(index.Identifier, "fox");
foreach (SearchResult result in results.Results)
{
Console.WriteLine($"Document: {result.DocumentId}, Score: {result.Score}");
}
// Enriched search
SearchData enriched = await client.SearchAsync(index.Identifier, "machine learning", new SearchOptions
{
IncludeMatchedTerms = true,
IncludeTermDetails = true,
IncludeDocumentTermStats = true
});
// Cleanup
await client.DeleteIndexAsync(index.Identifier);
Running the Test Harness
cd sdk/csharp/Verbex.Sdk.TestHarness
dotnet run -- <endpoint> <access_key>
# Example:
dotnet run -- http://localhost:8080 verbexadmin
API Reference
VerbexClient
Constructor
VerbexClient(string endpoint, string accessKey)- Create a new client
Health Endpoints
HealthCheckAsync(CancellationToken)- ReturnsHealthDataRootHealthCheckAsync(CancellationToken)- ReturnsHealthData
Authentication
LoginAsync(string tenantId, string email, string password, CancellationToken)- ReturnsLoginResultLoginAsync(string bearerToken, CancellationToken)- ReturnsLoginResultValidateTokenAsync(CancellationToken)- ReturnsValidationData
Index Management
ListIndicesAsync(CancellationToken)- ReturnsList<IndexInfo>CreateIndexAsync(...)- ReturnsIndexInfoGetIndexAsync(string indexId, CancellationToken)- ReturnsIndexInfoIndexExistsAsync(string indexId, CancellationToken)- ReturnsboolDeleteIndexAsync(string indexId, CancellationToken)- ReturnsvoidUpdateIndexLabelsAsync(string indexId, List<string> labels, CancellationToken)- ReturnsvoidUpdateIndexTagsAsync(string indexId, Dictionary<string, string> tags, CancellationToken)- ReturnsvoidUpdateIndexCustomMetadataAsync(string indexId, object customMetadata, CancellationToken)- ReturnsIndexInfo
Document Management
ListDocumentsAsync(string indexId, CancellationToken)- ReturnsList<DocumentInfo>AddDocumentAsync(string indexId, string content, ...)- ReturnsAddDocumentDataGetDocumentAsync(string indexId, string documentId, CancellationToken)- ReturnsDocumentInfoGetDocumentsBatchAsync(string indexId, IEnumerable<string> documentIds, CancellationToken)- ReturnsBatchDocumentsResultDocumentExistsAsync(string indexId, string documentId, CancellationToken)- ReturnsboolDeleteDocumentsBatchAsync(string indexId, IEnumerable<string> documentIds, CancellationToken)- ReturnsBatchDeleteResponseDeleteDocumentAsync(string indexId, string documentId, CancellationToken)- ReturnsvoidUpdateDocumentLabelsAsync(...)- ReturnsvoidUpdateDocumentTagsAsync(...)- ReturnsvoidUpdateDocumentCustomMetadataAsync(...)- ReturnsDocumentInfo
Search
SearchAsync(string indexId, string query, int maxResults, ...)- ReturnsSearchDataSearchAsync(string indexId, string query, SearchOptions options, ...)- ReturnsSearchDatawith optional matched terms, term details, and document term stats
Admin - Tenant Management
ListTenantsAsync(CancellationToken)- ReturnsList<TenantInfo>GetTenantAsync(string tenantId, CancellationToken)- ReturnsTenantInfoCreateTenantAsync(string name, string? description, CancellationToken)- ReturnsTenantInfoDeleteTenantAsync(string tenantId, CancellationToken)- Returnsvoid
Admin - User Management
ListUsersAsync(string tenantId, CancellationToken)- ReturnsList<UserInfo>GetUserAsync(string tenantId, string userId, CancellationToken)- ReturnsUserInfoCreateUserAsync(...)- ReturnsUserInfoDeleteUserAsync(string tenantId, string userId, CancellationToken)- Returnsvoid
Admin - Credential Management
ListCredentialsAsync(string tenantId, CancellationToken)- ReturnsList<CredentialInfo>GetCredentialAsync(string tenantId, string credentialId, CancellationToken)- ReturnsCredentialInfoCreateCredentialAsync(string tenantId, string? description, CancellationToken)- ReturnsCredentialInfoDeleteCredentialAsync(string tenantId, string credentialId, CancellationToken)- Returnsvoid
Model Classes
HealthData- Health check response (Status, Version, Timestamp)ValidationData- Token validation resultLoginResult- Login attempt resultIndexInfo- Index information with statisticsDocumentInfo- Document informationAddDocumentData- Add document response (DocumentId, Message)SearchData- Search response with resultsSearchResult- Individual search resultSearchOptions- Optional search filters and enrichment flagsSearchTermDetail- Optional per-term score/frequency detailSearchDocumentTermStats- Optional whole-document term countsBatchDocumentsResult- Batch document retrieval result (Documents, NotFound, Count, RequestedCount)BatchDeleteResponse- Batch document deletion result (Deleted, NotFound, DeletedCount, NotFoundCount, RequestedCount)TenantInfo- Tenant informationUserInfo- User informationCredentialInfo- Credential/API key informationVerbexException- Exception thrown for API errors
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version aligned to 0.2.1 with the Verbex core library.