
C# REST client (sync and async), for the SeekStorm vector & lexical search server.
seekstorm_client_cs is open source licensed under the Apache License 2.0
Website | Benchmark | Demo | Repository for SeekStorm Python client | Repository for SeekStorm library, server, Rust client | Roadmap | Blog | X
SeekStorm.Clienttargetsnet8.0- Uses
HttpClient+System.Text.Json - Supports sync and async methods for all Python client endpoints
GET /api/v1/livePOST/DELETE/GET /api/v1/apikeyPOST /api/v1/indexGET/DELETE/PATCH /api/v1/index/{index_id}DELETE /api/v1/index/{index_id}/doc(clear with bodyclear)POST/PATCH/DELETE /api/v1/index/{index_id}/docGET /api/v1/index/{index_id}/doc/{doc_id}POST /api/v1/index/{index_id}/iteratorPOST /api/v1/index/{index_id}/queryPOST /api/v1/index/{index_id}/fileGET /api/v1/index/{index_id}/file/{doc_id}
using SeekStorm.Client;
var client = new SeekStormClient(
baseUrl: "http://localhost:8080",
apiKeyBase64: "YOUR_APIKEY_BASE64"
);
var live = await client.LiveAsync();
Console.WriteLine(live.Message);
var createIndex = await client.CreateIndexAsync(new CreateIndexRequest
{
IndexName = "demo",
Schema = new List<SchemaField>
{
new()
{
Field = "title",
FieldType = FieldType.Text,
Store = true,
IndexLexical = true
}
}
});
await client.IndexDocumentAsync(createIndex.IndexId, new Dictionary<string, object?>
{
["title"] = "hello seekstorm"
});
await client.CommitIndexAsync(createIndex.IndexId);
// Search without returning full documents (only ids and scores)
var result = await client.QueryIndexAsync(createIndex.IndexId, new SearchRequestObject
{
QueryString = "hello",
Length = 5
});
Console.WriteLine($"Total hits: {result.CountTotal}");
// Search with full documents and highlights
var resultWithDocs = await client.QueryIndexAsync(createIndex.IndexId, new SearchRequestObject
{
QueryString = "hello",
Length = 5,
ReturnDocuments = new DocumentOption
{
Fields = new() { "title" },
Highlights = new()
{
new Highlight
{
Field = "title",
FragmentNumber = 1,
FragmentSize = 160,
HighlightMarkup = true
}
}
}
});
Console.WriteLine($"Total hits: {resultWithDocs.CountTotal}");
foreach (var doc in resultWithDocs.Documents)
{
Console.WriteLine($"Document: {doc.Properties}");
}