VOOZH about

URL: https://www.nuget.org/packages/SOFTURE.Typesense/

⇱ NuGet Gallery | SOFTURE.Typesense 0.1.2




SOFTURE.Typesense 0.1.2

dotnet add package SOFTURE.Typesense --version 0.1.2
 
 
NuGet\Install-Package SOFTURE.Typesense -Version 0.1.2
 
 
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="SOFTURE.Typesense" Version="0.1.2" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SOFTURE.Typesense" Version="0.1.2" />
 
Directory.Packages.props
<PackageReference Include="SOFTURE.Typesense" />
 
Project file
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 SOFTURE.Typesense --version 0.1.2
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SOFTURE.Typesense, 0.1.2"
 
 
#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 SOFTURE.Typesense@0.1.2
 
 
#: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=SOFTURE.Typesense&version=0.1.2
 
Install as a Cake Addin
#tool nuget:?package=SOFTURE.Typesense&version=0.1.2
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SOFTURE.Typesense

Typesense wrapper for .NET with support for strongly typed models, filters, and queries.

Installation

dotnet add package SOFTURE.Typesense
dotnet add package SOFTURE.Typesense.Abstractions

Quick Start

1. Define Document Model

public sealed class ProductDocument : DocumentBase
{
 public ProductDocument() : base(collection: "products") { }

 public override required string Id { get; set; }

 [JsonPropertyName("name")]
 public string? Name { get; set; }

 [JsonPropertyName("price")]
 public decimal Price { get; set; }

 [JsonPropertyName("is_active")]
 public bool IsActive { get; set; }

 [JsonPropertyName("tags")]
 public string[]? Tags { get; set; }
}

2. Define Query Model

public sealed class ProductQuery : QueryBase
{
 public ProductQuery() : base(collection: "products") { }

 [JsonPropertyName("name")]
 public string? Name { get; set; }
}

3. Define Filters with Operators

public sealed class ProductFilters : FilterBase
{
 public ProductFilters() : base(collection: "products") { }

 [JsonPropertyName("is_active")]
 public bool? IsActive { get; set; }

 [FilterOperator(FilterOperator.LessThan)]
 [JsonPropertyName("price")]
 public decimal? Price { get; set; }

 [FilterOperator(FilterOperator.GreaterThan)]
 [JsonPropertyName("quantity")]
 public int? Quantity { get; set; }

 [FilterOperator(FilterOperator.Range)]
 [JsonPropertyName("created_at")]
 public (long From, long To)? CreatedAt { get; set; }

 [FilterOperator(FilterOperator.NotEquals)]
 [JsonPropertyName("excluded_ids")]
 public string[]? ExcludedIds { get; set; }

 [JsonPropertyName("tags")]
 public string[]? Tags { get; set; }
}

4. Define Sorting

public sealed class ProductSort : SortBase
{
 public ProductSort() : base(collection: "products") { }

 public ProductSort WithName(SortDirection direction)
 {
 Add("name", direction);
 return this;
 }

 public ProductSort WithPrice(SortDirection direction)
 {
 Add("price", direction);
 return this;
 }
}

5. Configure Collection

public sealed class ProductConfig : ICollectionConfiguration
{
 public ProductConfig()
 {
 Configurations.ConfigureCollection<ProductDocument, ProductQuery, ProductFilters>(
 collectionName: "products",
 fields:
 [
 new Field("name", FieldType.String, facet: false, optional: false, index: true, sort: true),
 new Field("price", FieldType.Float, facet: false, optional: false, index: true, sort: true),
 new Field("is_active", FieldType.Bool, facet: true),
 new Field("tags", FieldType.StringArray, facet: true, optional: true)
 ],
 defaultSortingField: "name"
 );
 }

 public List<CollectionConfiguration> Configurations { get; } = [];
}

6. Usage

await documentClient.ImportDocuments(products, batchSize: 100);

var query = new ProductQuery { Name = "iPhone" };

var filters = new ProductFilters
{
 IsActive = true,
 Price = 1000,
 Tags = ["electronics", "smartphones"]
};

var sort = new ProductSort()
 .WithPrice(SortDirection.Asc)
 .WithName(SortDirection.Desc);

var result = await documentClient.Search<ProductDocument, ProductQuery, ProductFilters, ProductSort>(
 query: query,
 filters: filters,
 sortBy: sort
);

Available Filter Operators

  • Default - Equals (=)
  • FilterOperator.NotEquals - Not equals (:!=)
  • FilterOperator.LessThan - Less than (:<)
  • FilterOperator.LessThanOrEquals - Less than or equals (:<=)
  • FilterOperator.GreaterThan - Greater than (:>)
  • FilterOperator.GreaterThanOrEquals - Greater than or equals (:>=)
  • FilterOperator.Range - Range (:[]) - requires tuple (From, To)

Field Configuration Parameters

  • facet (default: false) - Fields with true can be filtered and grouped
  • index (default: true) - Set to false for fields that should not be searchable
  • sort (default: false) - Set to true for fields that can be sorted
  • optional (default: false) - Whether the field is optional

License

See file for details.

Product Versions Compatible and additional computed target framework versions.
.NET net6.0 net6.0 is compatible.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.2 907 12/10/2025
0.1.1 319 11/10/2025
0.1.0 278 11/10/2025
0.0.15 234 11/6/2025
0.0.14 213 11/5/2025
0.0.13 224 11/5/2025
0.0.12 494 9/7/2024
0.0.11 197 9/7/2024
0.0.10 189 9/3/2024
0.0.9 191 9/3/2024
0.0.8 189 9/2/2024
0.0.7 192 9/2/2024
0.0.6 210 8/20/2024
0.0.5 187 8/20/2024
0.0.4 241 8/15/2024
0.0.3 218 8/12/2024
0.0.2 199 8/12/2024
0.0.1 188 8/12/2024