![]() |
VOOZH | about |
dotnet add package Lucene.Net --version 4.8.0-beta00012
NuGet\Install-Package Lucene.Net -Version 4.8.0-beta00012
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00012" />
<PackageVersion Include="Lucene.Net" Version="4.8.0-beta00012" />Directory.Packages.props
<PackageReference Include="Lucene.Net" />Project file
paket add Lucene.Net --version 4.8.0-beta00012
#r "nuget: Lucene.Net, 4.8.0-beta00012"
#:package Lucene.Net@4.8.0-beta00012
#addin nuget:?package=Lucene.Net&version=4.8.0-beta00012&prereleaseInstall as a Cake Addin
#tool nuget:?package=Lucene.Net&version=4.8.0-beta00012&prereleaseInstall as a Cake Tool
Lucene.NET is a full-text search engine library capable of advanced text analysis, indexing, and searching. It can be used to easily add search capabilities to applications. Lucene.Net is a C# port of the popular Java Lucene search engine framework from The Apache Software Foundation, targeting the .NET platform.
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.Search;
using Lucene.Net.Store;
using Lucene.Net.Util;
// Ensures index backward compatibility
const LuceneVersion AppLuceneVersion = LuceneVersion.LUCENE_48;
// Construct a machine-independent path for the index
var basePath = Environment.GetFolderPath(
Environment.SpecialFolder.CommonApplicationData);
var indexPath = Path.Combine(basePath, "index");
using var dir = FSDirectory.Open(indexPath);
// Create an analyzer to process the text
var analyzer = new StandardAnalyzer(AppLuceneVersion);
// Create an index writer
var indexConfig = new IndexWriterConfig(AppLuceneVersion, analyzer);
using var writer = new IndexWriter(dir, indexConfig);
var source = new
{
Name = "Kermit the Frog",
FavoritePhrase = "The quick brown fox jumps over the lazy dog"
};
var doc = new Document
{
// StringField indexes but doesn't tokenize
new StringField("name",
source.Name,
Field.Store.YES),
new TextField("favoritePhrase",
source.FavoritePhrase,
Field.Store.YES)
};
writer.AddDocument(doc);
writer.Flush(triggerMerge: false, applyAllDeletes: false);
// Search with a phrase
var phrase = new MultiPhraseQuery
{
new Term("favoritePhrase", "brown"),
new Term("favoritePhrase", "fox")
};
// Re-use the writer to get real-time updates
using var reader = writer.GetReader(applyAllDeletes: true);
var searcher = new IndexSearcher(reader);
var hits = searcher.Search(phrase, 20 /* top 20 */).ScoreDocs;
// Display the output in a table
Console.WriteLine($"{"Score",10}" +
$" {"Name",-15}" +
$" {"Favorite Phrase",-40}");
foreach (var hit in hits)
{
var foundDoc = searcher.Doc(hit.Doc);
Console.WriteLine($"{hit.Score:f8}" +
$" {foundDoc.Get("name"),-15}" +
$" {foundDoc.Get("favoritePhrase"),-40}");
}
See the API documentation for Lucene.NET 4.8.0.
There are several demos implemented as simple console applications that can be copied and pasted into Visual Studio or compiled on the command line in the Lucene.Net.Demo project.
There is also a dotnet command line tool available on NuGet. It contains all of the demos as well as tools maintaining your Lucene.NET index, featuring operations such as splitting, merging, listing segment info, fixing, deleting segments, upgrading, etc. Always be sure to back up your index before running any commands against it!
dotnet tool install lucene-cli -g --version 4.8.0-beta00015
NOTE: The version of the CLI you install should match the version of Lucene.NET you use.
Once installed, you can explore the commands and options that are available by entering the command lucene.
Lucene.NET 4.8.0 is a large project that has been under development since 2014, and a few volunteers have contributed more than 5000 hours of their time to help. All of the Lucene.NET modules are ported from Java, but we are still missing a few key features and have much work to do on our biggest dependency, ICU4N, to get it production ready.
If you wish to contribute your time, please see the Contributing page to get started. Specifically, the types of people we need to get Lucene.NET 4.8.0 out of beta are:
We understand some people and companies don't have the time to contribute code or write documentation, but still wish to participate. While Apache provides much of the infrastructure we need through Apache sponsorship programs, these funds generally are not applied toward development work of Lucene.NET.
Being that Lucene.NET has over 450,000 lines of code and depends on several other projects that we also maintain, development on Lucene.NET is no small endeavor. It can be difficult for a small team of developers to put in the kind of time that a project of this magnitude requires, which is why we need your help. Lucene.NET needs more regular developers devoting periodic blocks of development time and it needs sponsorships so some of those developers can allocate substantial amounts of time to the project.
| Please Sponsor Our Development Team! | ||
|---|---|---|
| Shad Storhaug | 👁 Sponsor with GitHub Sponsors |
👁 Sponsor with PayPal |
| Shannon Deminick | 👁 Sponsor with GitHub Sponsors |
|
| Ron Clabo | 👁 Sponsor with GitHub Sponsors |
* (additional regular contributors will be featured here)
These sponsorships are not officially affiliated with the Apache Software Foundation, but aim to support endeavors related to Apache Lucene.NET. The ASF values community integrity and vendor independence very highly. As a general principle, it doesn't accept "cash for code" so that individual cash payments can't force contributions into a project which aren't aligned with community consensus.
Some of the developments we may be able to accelerate through this initiative include:
Funding may also be applied toward:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net45 net45 is compatible. net451 net451 was computed. net452 net452 was computed. net46 net46 was computed. net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Lucene.Net:
| Package | Downloads |
|---|---|
|
Lucene.Net.Analysis.Common
Analyzers for indexing content in different languages and domains for the Lucene.NET full-text search engine library from The Apache Software Foundation. Documentation: https://lucenenet.apache.org/docs/4.8.0-beta00018/api/analysis-common/overview.html This package is part of the Lucene.NET project: https://www.nuget.org/packages/Lucene.Net/4.8.0-beta00018 |
|
|
Lucene.Net.Queries
Extended Filters and Queries for the Lucene.NET full-text search engine library from The Apache Software Foundation. Documentation: https://lucenenet.apache.org/docs/4.8.0-beta00018/api/queries/Lucene.Net.Queries.html This package is part of the Lucene.NET project: https://www.nuget.org/packages/Lucene.Net/4.8.0-beta00018 |
|
|
Lucene.Net.Sandbox
Various third party contributions and new ideas extensions for the Lucene.NET full-text search engine library from The Apache Software Foundation. Documentation: https://lucenenet.apache.org/docs/4.8.0-beta00018/api/sandbox/overview.html This package is part of the Lucene.NET project: https://www.nuget.org/packages/Lucene.Net/4.8.0-beta00018 |
|
|
Lucene.Net.Grouping
Collectors for grouping search results for the Lucene.NET full-text search engine library from The Apache Software Foundation. Documentation: https://lucenenet.apache.org/docs/4.8.0-beta00018/api/grouping/package.html This package is part of the Lucene.NET project: https://www.nuget.org/packages/Lucene.Net/4.8.0-beta00018 |
|
|
Lucene.Net.Replicator
Replicator that allows replication of files between a server and client(s) for the Lucene.NET full-text search engine library from The Apache Software Foundation. Documentation: https://lucenenet.apache.org/docs/4.8.0-beta00018/api/replicator/Lucene.Net.Replicator.html This package is part of the Lucene.NET project: https://www.nuget.org/packages/Lucene.Net/4.8.0-beta00018 |
Showing the top 20 popular GitHub repositories that depend on Lucene.Net:
| Repository | Stars |
|---|---|
|
OrchardCMS/OrchardCore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
|
|
|
ravendb/ravendb
ACID Document Database
|
|
|
ErsatzTV/legacy
Open-source platform that transforms your personal media library into live, custom TV channels.
|
|
|
OrchardCMS/Orchard
Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform. Check out the next generation of this software built on ASP.NET Core: https://github.com/OrchardCMS/OrchardCore
|
|
|
NuGet/NuGetGallery
NuGet Gallery is a package repository that powers https://www.nuget.org. Use this repo for reporting NuGet.org issues.
|
|
|
dotnet/dotnet
Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK.
|
|
|
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
|
|
|
NuGet/NuGet.Client
Client Tools for NuGet - including Visual Studio extensions, command line tools, and msbuild support. (Open issues on https://github.com/nuget/home/issues)
|
|
|
SparkDevNetwork/Rock
An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
|
|
|
YAFNET/YAFNET
🌐 YAF.NET - C# ASP.NET Forum
|
|
|
aspose-words/Aspose.Words-for-.NET
Aspose.Words for .NET examples, plugins and showcases
|
|
|
MatterHackers/MatterControl
3D printing software for Windows, Mac and Linux
|
|
|
fraxiinus/ReplayBook
Play, manage, and inspect League of Legends replays
|
|
|
n2cms/n2cms
N2 CMS, an open source CMS for ASP.NET
|
|
|
axzxs2001/Asp.NetCoreExperiment
原来所有项目都移动到**OleVersion**目录下进行保留。新的案例装以.net 5.0为主,一部分对以前案例进行升级,一部分将以前的工作经验总结出来,以供大家参考!
|
|
|
dotnetrdf/dotnetrdf
dotNetRDF is a powerful and flexible API for working with RDF and SPARQL in .NET environments
|
|
|
roadkillwiki/roadkill
A modern .NET Wiki
|
|
|
SitecoreUnicorn/Unicorn
A Sitecore utility designed to simplify deployment of Sitecore items across environments automatically
|
|
| iPromKnight/zilean | |
|
lofcz/Infidex
The high-performance .NET search engine based on pattern recognition.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.8.0-beta00018 | 1,757 | 6/22/2026 |
| 4.8.0-beta00017 | 4,997,326 | 10/29/2024 |
| 4.8.0-beta00016 | 10,603,218 | 2/17/2022 |
| 4.8.0-beta00015 | 1,148,601 | 10/29/2021 |
| 4.8.0-beta00014 | 4,792,833 | 3/28/2021 |
| 4.8.0-beta00013 | 657,680 | 11/16/2020 |
| 4.8.0-beta00012 | 294,652 | 9/19/2020 |
| 4.8.0-beta00011 | 108,443 | 7/24/2020 |
| 4.8.0-beta00010 | 12,532 | 7/19/2020 |
| 4.8.0-beta00009 | 26,268 | 6/30/2020 |
| 4.8.0-beta00008 | 278,980 | 5/5/2020 |
| 4.8.0-beta00007 | 1,144,833 | 12/29/2019 |
| 4.8.0-beta00006 | 299,228 | 8/13/2019 |
| 4.8.0-beta00005 | 1,176,626 | 10/24/2017 |
| 4.8.0-beta00004 | 228,083 | 5/21/2017 |
| 4.8.0-beta00001 | 43,704 | 5/9/2017 |
| 3.0.3 | 17,636,667 | 10/26/2012 |
| 2.9.4.1 | 4,289,422 | 12/2/2011 |