blob: 698d77e5a3d472354a781063a6d2ee961a9a71de [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Welcome to the Lucene.NET website! | Apache Lucene.NET 4.8.0 </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Welcome to the Lucene.NET website! | Apache Lucene.NET 4.8.0 ">
<meta name="generator" content="docfx 2.58.0.0">
<link rel="shortcut icon" href="logo/favicon.ico">
<link rel="stylesheet" href="styles/docfx.vendor.css">
<link rel="stylesheet" href="styles/docfx.css">
<link rel="stylesheet" href="styles/main.css">
<meta property="docfx:navrel" content="toc.html">
<meta property="docfx:tocrel" content="toc.html">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.8.0/css/academicons.min.css" integrity="sha512-GGGNUPDhnG8LEAEDsjqYIQns+Gu8RBs4j5XGlxl7UfRaZBhCCm5jenJkeJL8uPuOXGqgl8/H1gjlWQDRjd3cUQ==" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw==" crossorigin="anonymous">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:400,700%7CMerriweather%7CRoboto+Mono">
<link rel="stylesheet" href="/styles/site.css">
</head> <body id="homepage" data-spy="scroll" data-target="#affix">
<span id="forkongithub"><a href="https://github.com/apache/lucenenet" target="_blank">Fork me on GitHub</a></span>
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
<img id="logo" class="svg" src="logo/lucene-net-color.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
</header>
<section id="intro" class="home-section">
<div class="container">
<p class="text-center">Lucene.Net is a high performance search engine library for .NET</p>
<div class="row">
<div class="nuget-well col-xs-8 col-xs-offset-2 col-lg-6 col-lg-offset-3">
Install-Package Lucene.Net -Pre
</div>
</div>
<div class="row">
<div class="text-center project-links">
<a href="https://github.com/apache/lucenenet" target="_blank">
<i class="fa fa-github"></i>
</a>
<a href="http://mail-archives.apache.org/mod_mbox/lucenenet-dev/" target="_blank">
<i class="fa fa-envelope-o"></i>
</a>
<a href="https://stackoverflow.com/questions/tagged/lucene.net" target="_blank">
<i class="fa fa-stack-overflow"></i>
</a>
<a href="download/download.html">
<i class="fa fa-download" target="_blank"></i>
</a>
</div>
</div>
</div>
</section>
<section id="quick-start" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-lg-6">
<p class="text-center">Create an index and define a text analyzer</p>
<pre class="clean">
<code class="csharp">
// 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);
</code>
</pre>
</div>
<div class="col-xs-12 col-lg-6">
<p class="text-center">Add to the index</p>
<pre class="clean">
<code class="csharp">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);
</code>
</pre>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-lg-6">
<p class="text-center">Construct a query</p>
<pre class="clean">
<code class="csharp">// Search with a phrase
var phrase = new MultiPhraseQuery
{
new Term("favoritePhrase", "brown"),
new Term("favoritePhrase", "fox")
};
</code>
</pre>
</div>
<div class="col-xs-12 col-lg-6">
<p class="text-center">Fetch the results</p>
<pre class="clean">
<code class="csharp">// 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}");
}
</code>
</pre>
</div>
</div>
</div>
</section>
<section class="home-section">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 id="about" class="text-center">About the project</h2>
<p>Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users</p>
<h3 id="latest-version---lucenenet-480-beta">Latest Version - Lucene.NET 4.8.0 Beta</h3>
<ul>
<li>The beta version is extremely stable</li>
<li>Has more than 7800+ passing unit tests</li>
<li>Integrates well with .NET 6.0, .NET 5.0 and .NET Core 2+</li>
<li>Supports .NET Standard 2.1 and .NET Standard 2.0</li>
<li>Supports .NET Framework 4.5+</li>
<li>Some developers already use it in production environments</li>
</ul>
<h3 id="our-goals">Our Goals</h3>
<ul>
<li>Maintain the existing line-by-line port from Java to C#, fully automating and commoditizing the process such that the project can easily synchronize with the Java Lucene release schedule</li>
<li>Maintaining the high-performance requirements expected of a first class C# search engine library</li>
<li>Maximize usability and power when used within the .NET runtime. To that end, it will present a highly idiomatic, carefully tailored API that takes advantage of many of the special features of the .NET runtime</li>
</ul>
</div>
</div>
</div>
</section>
<section class="home-section books">
<div class="container">
<div class="row">
<h2 id="books" class="text-center">Popular Books</h2>
<div class="row">
<div class="col-xs-12 col-md-6">
<a href="https://www.amazon.com/Instant-Lucene-NET-Michael-Heydt-ebook/dp/B00E7NC9EG" target="_blank"><img src="https://images-na.ssl-images-amazon.com/images/I/51ovFeqMwBL.jpg"></a>
</div>
<div class="col-xs-12 col-md-6">
<a href="https://www.amazon.com/Lucene-4-Cookbook-Edwood-Ng-ebook/dp/B00ZPJWC9S" target="_blank"><img src="https://images-na.ssl-images-amazon.com/images/I/51uIsUPhaeL.jpg"></a>
</div>
</div>
</div>
</div>
</section>
<section class="home-section">
<div class="container">
<div class="row"></div>
</div>
</section>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
Copyright &copy; 2021 The Apache Software Foundation, Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache License, Version 2.0</a><br> <small>Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation. <br>All other marks mentioned may be trademarks or registered trademarks of their respective owners.</small>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="styles/docfx.vendor.js"></script>
<script type="text/javascript" src="styles/docfx.js"></script>
<script type="text/javascript" src="styles/main.js"></script>
</body>
</html>