ApienFTS 1.0.0.1
dotnet add package ApienFTS --version 1.0.0.1
NuGet\Install-Package ApienFTS -Version 1.0.0.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="ApienFTS" Version="1.0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ApienFTS" Version="1.0.0.1" />
<PackageReference Include="ApienFTS" />
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 ApienFTS --version 1.0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ApienFTS, 1.0.0.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 ApienFTS@1.0.0.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=ApienFTS&version=1.0.0.1
#tool nuget:?package=ApienFTS&version=1.0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
🔍 Apien.Search
.NET için ultra hızlı full-text arama motoru. Tantivy seviyesinde performans, minimal bellek kullanımı.
🚀 Performans Metrikleri
| Metrik | Değer |
|---|---|
| Indexleme Hızı | 65,000+ doc/s |
| Arama P50 | 0.57ms |
| Arama P95 | 1.03ms |
| Arama P99 | 1.3ms |
| End-to-End QPS | ~450 req/s |
| Engine QPS | 1,700+ req/s |
| Bellek (1M doc) | ~170 MB |
| Disk (1M doc) | ~743 MB |
📦 Kurulum
dotnet add package Apien.Search
⚡ Hızlı Başlangıç
DI ile Kullanım (Önerilen)
// Program.cs
builder.Services.AddApienSearch(builder.Configuration);
// appsettings.json
{
"ApienSearch": {
"DataPath": "./search-data",
"DefaultSize": 20,
"MaxSize": 10000
}
}
// Index Service
public class ProductIndexService(IApienIndexer indexer)
{
public async Task CreateIndex()
{
await indexer.CreateIndexAsync<Product>("products", m => m
.Keyword(p => p.ProductId)
.Text(p => p.PartName, boost: 3.0f)
.Text(p => p.PartNameTr, boost: 3.0f)
.TextArray(p => p.OemNumbers, boost: 5.0f)
.TextArray(p => p.VehicleModels, boost: 2.0f)
);
}
public async Task IndexProducts(IEnumerable<Product> products)
{
await indexer.BulkAsync("products", products, p => p.ProductId);
}
}
// Search Service
public class ProductSearchService(IApienSearch search)
{
public async Task<SearchResult<Product>> Search(string query)
{
var request = new TypedSearchRequestBuilder<Product>()
.Query(q => q.MultiMatch(query,
p => p.PartName,
p => p.OemNumbers,
p => p.VehicleModels))
.SortByScore()
.Size(20)
.Build();
return await search.SearchAsync<Product>("products", request);
}
}
Doğrudan Kullanım
using Apien.Search;
// Client oluştur
await using var client = new SearchClient("./search-data");
// Strongly-typed mapping ile index tanımla
await client.Indices.CreateAsync("products", c => c
.Map<Product>(m => m
.Keyword(p => p.ProductId)
.Text(p => p.PartName, boost: 3.0f)
.Text(p => p.PartNameTr, boost: 3.0f)
.TextArray(p => p.OemNumbers, boost: 5.0f)
.TextArray(p => p.VehicleModels, boost: 2.0f)
));
// Doküman indexle (65K+ doc/s)
await client.BulkAsync("products", products);
// Ara (sub-millisecond)
var results = await client.SearchAsync<Product>("products", "bosch fren");
foreach (var hit in results.Hits.Hits)
{
Console.WriteLine($"{hit.Source?.PartName} - Skor: {hit.Score}");
}
✨ Özellikler
Sorgu Tipleri
- 🔍 Match - Tam kelime eşleşmesi (case insensitive)
- 🔤 Prefix - Ön ek araması (
pass→passat) - O(log n) binary search - 🎯 Term - Exact match (filtreleme için)
- 📋 Terms - Çoklu değer araması
- 🌟 Wildcard - Pattern matching (
*sat*,pass*) - 🔮 Fuzzy - Yazım hatası toleransı (Levenshtein)
- 📊 Range - Sayısal aralık sorguları
- ✅ Exists - Alan varlık kontrolü
- 🔗 Bool - AND/OR/NOT kombinasyonları
- 🎚️ MultiMatch - Birden fazla alanda arama
- ⚡ FunctionScore - Custom skorlama fonksiyonları
Teknik Özellikler
- 🔥 Tantivy seviyesi performans - P99 < 2ms
- 💾 Minimal bellek - ~170MB / 1M doküman
- 🔤 Çoklu dil desteği - Türkçe, Almanca, Fransızca, Lehçe, Romence, Macarca
- 📦 Array field araması - Tags, kategoriler, çoklu değerler
- 🚀 SIMD tokenization - AVX2 hızlandırmalı
- 🔒 Thread-safe - Eşzamanlı arama desteği
- 📁 Memory-mapped dosyalar - OS tarafından yönetilen cache
- ⚡ Binary search - O(log n) prefix/range sorguları
- 🧠 Token cache - Tekrarlı posting list okumayı önleme
- 🔄 ArrayPool - Bellek yeniden kullanımı
DI Interface'leri
- 📥 IApienIndexer - Index ve doküman yönetimi
- 🔎 IApienSearch - Arama işlemleri
- 🔧 ISearchClient - Legacy uyumluluk
📖 Dokümantasyon
Detaylı kullanım kılavuzu için: docs/API-REFERENCE.md
🆚 Karşılaştırma
| Özellik | Apien.Search | Elasticsearch | Tantivy |
|---|---|---|---|
| P99 Latency | 1.3ms | 10-50ms | 2-5ms |
| Bellek (1M) | 170MB | 2-4GB | 500MB |
| Kurulum | Sıfır | Karmaşık | Rust FFI |
| .NET Native | ✅ | ❌ | ❌ |
| Türkçe | ✅ | Plugin | Plugin |
🔧 Yapılandırma
// appsettings.json
{
"ApienSearch": {
"DataPath": "./search-data",
"DefaultSize": 20,
"MaxSize": 10000,
"EnableMetrics": false,
"DocumentCacheSize": 10000,
"MaxPostingsPerToken": 10000,
"ViewPoolSize": 128
}
}
// Program.cs
builder.Services.AddApienSearch(builder.Configuration);
// Veya manuel yapılandırma
builder.Services.AddApienSearch(options =>
{
options.DataPath = "./search-data";
options.DefaultSize = 20;
options.MaxSize = 10000;
});
🎯 Kullanım Senaryoları
E-Ticaret Ürün Araması
var request = new TypedSearchRequestBuilder<Product>()
.Query(q => q.Bool(b => b
.Must(inner => inner.MultiMatch(query, m => m
.Field(p => p.Name, BoostLevel.High)
.Field(p => p.Description)
.Field(p => p.Brand, BoostLevel.Medium)
.Fuzziness(Fuzziness.High)
))
.Range(p => p.Stock, r => r.Gt(0)) // Stokta olanlar
))
.SortByScore()
.Highlight(p => p.Name, p => p.Description)
.Aggregations(a => a
.Terms("brands", p => p.Brand, 20)
.Range("priceRanges", p => p.Price, r => r
.Range(null, 100, "Ucuz")
.Range(100, 500, "Orta")
.Range(500, null, "Pahalı")
)
)
.Page(1, PageSize.Default)
.Build();
OEM Numarası Araması
var request = new TypedSearchRequestBuilder<Product>()
.Query(q => q.Bool(b => b
.Should(p => p.OemNumbers, oemNumber, BoostLevel.Extreme) // Exact match
.Should(inner => inner.Prefix(p => p.OemNumbers, oemNumber, BoostLevel.High))
.MinimumShouldMatch(1)
))
.Size(50)
.Build();
Autocomplete
var request = new TypedSearchRequestBuilder<Product>()
.Query(q => q.Prefix(p => p.Name, prefix))
.SuggestCompletion("suggestions", p => p.Name, prefix, size: 10, fuzzy: true)
.Size(5)
.Build();
📄 Lisans
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net10.0 was computed. 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.
-
net9.0
- K4os.Compression.LZ4 (>= 1.3.8)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.ObjectPool (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.