SearchLite.Sqlite 0.2.2

dotnet add package SearchLite.Sqlite --version 0.2.2
                    
NuGet\Install-Package SearchLite.Sqlite -Version 0.2.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="SearchLite.Sqlite" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SearchLite.Sqlite" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="SearchLite.Sqlite" />
                    
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 SearchLite.Sqlite --version 0.2.2
                    
#r "nuget: SearchLite.Sqlite, 0.2.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.
#addin nuget:?package=SearchLite.Sqlite&version=0.2.2
                    
Install SearchLite.Sqlite as a Cake Addin
#tool nuget:?package=SearchLite.Sqlite&version=0.2.2
                    
Install SearchLite.Sqlite as a Cake Tool

SearchLite

SearchLite is a lightweight .NET library for adding full-text search capabilities to SQLite and PostgreSQL databases. It offers a unified, strongly-typed, and async-friendly API, making it easy to index and query documents without the need for a dedicated search engine.

Installation

dotnet add package SearchLite

Quick Start

  1. Define your searchable document:
public class Product : ISearchableDocument
{
    public string Id { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
    public decimal Price { get; set; }
    public string GetSearchText() => $"{Id} {Name} {Description}";
}
  1. Create a search manager and index your documents:
// For PostgreSQL
var searchManager = new PgSearchManager("your_connection_string");

// For SQLite
var searchManager = new SqliteSearchManager("your_connection_string");

var productIndex = await searchManager.Get<Product>("products", CancellationToken.None);

await productIndex.IndexAsync(new Product 
{
    Id = "1",
    Name = "Gaming Laptop",
    Description = "High-performance gaming laptop with RTX 4080",
    Price = 1999.99m
});
  1. Search for documents:
var request = new SearchRequest<Product>
{
    Query = "gaming laptop",
    Options = new SearchOptions { MaxResults = 10, MinScore = 0.5f }
}.Where(p => p.Price < 2000);

var results = await productIndex.SearchAsync(request);

foreach (var match in results.Matches)
{
    Console.WriteLine($"Found: {match.Document.Name} (Score: {match.Score})");
}

Learn More

For detailed documentation, advanced usage, and contributing guidelines, visit the SearchLite GitHub Repository.


Licensed under the MIT License.

Product 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 is compatible.  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. 
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.2.2 604 2/25/2025
0.2.1 296 2/4/2025
0.2.0 106 2/3/2025
0.1.1 120 1/31/2025
0.1.0 106 1/28/2025
0.0.1 132 1/14/2025