Bielu.BetterSearch
A provider-agnostic search abstraction for .NET: describe a query once, then run it against whichever search engine you configure.
Warning
Beta, not production ready. The public API will change before 1.0. The feature matrix records what each provider really supports, and the roadmap is the plan for reaching a stable release.
One query model
Build a SearchQuery from term, terms, prefix, phrase prefix, fuzzy, date, numeric and string range,
geo-distance, raw Lucene and nested boolean sub-queries, or with the fluent API. Boolean logic follows
Lucene semantics on every provider.
Pluggable providers
Pick the engine in one line of configuration. A new engine is a new provider package, with no change to the core, and every provider runs the same shared tests.
Errors as results
Searching and indexing return FluentResults Results, so a
query a provider can't run is a failed result rather than an exception. Meilisearch fails a query that asks for
highlighting or for any facet other than a top-level term facet; Lifti fails one that asks for facets or
highlighting and ignores paging, sorting and post filters. In this beta some paths still throw; the roadmap lists known
defects.
Providers
Each provider is its own NuGet package. The feature matrix records exactly what each one supports today.
Elasticsearch Available
Bielu.BetterSearch.ElasticSearch
runs on an Elasticsearch cluster, configured from
Bielu:BetterSearch:ElasticSearch, with paging, sorting, post filters and scores.
search.AddElasticSearch()
OpenSearch Available
Bielu.BetterSearch.OpenSearch
runs on an OpenSearch cluster, configured from Bielu:BetterSearch:OpenSearch
with basic or API key authentication. It translates queries the same way as the Elasticsearch provider.
search.AddOpenSearch()
Meilisearch Available
Bielu.BetterSearch.Meilisearch
runs on a Meilisearch server, configured from
Bielu:BetterSearch:Meilisearch. Queries run as filters, so hits aren't ranked, and fuzzy and raw Lucene
queries return a failed Result.
search.AddMeilisearch()
Lifti Available
Bielu.BetterSearch.Lifti is an in-memory index built on LIFTI, for tests and small data sets. It needs no configuration and is due to be replaced by Lucene.NET.
search.AddLiftiSearch()
Lucene.NET Planned
Bielu.BetterSearch.Lucene will run on Lucene.NET, in memory or on
disk, with the same query semantics as Elasticsearch. See the roadmap.