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" />
<PackageReference Include="SearchLite.Sqlite" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=SearchLite.Sqlite&version=0.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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
- 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}";
}
- 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
});
- 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 | 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 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.
-
net8.0
- Microsoft.Data.Sqlite (>= 9.0.2)
- SearchLite (>= 0.2.2)
-
net9.0
- Microsoft.Data.Sqlite (>= 9.0.2)
- SearchLite (>= 0.2.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.