blob: 995e95b281e7afefdbea380d496d1ed12aee44ef [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.38.1.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">
<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-sm-6 col-sm-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-md-6">
<p class="text-center">Create an index and define a text analyzer</p>
<pre class="clean">
<code class="csharp">// Ensures index backwards compatibility
var AppLuceneVersion = LuceneVersion.LUCENE_48;
var indexLocation = @"C:\Index";
var dir = FSDirectory.Open(indexLocation);
//create an analyzer to process the text
var analyzer = new StandardAnalyzer(AppLuceneVersion);
//create an index writer
var indexConfig = new IndexWriterConfig(AppLuceneVersion, analyzer);
var writer = new IndexWriter(dir, indexConfig);
</code>
</pre>
</div>
<div class="col-xs-12 col-md-6">
<p class="text-center">Add to the index</p>
<pre class="clean">
<code class="csharp">var source = new
{
Name = "Kermit the Frog",
FavouritePhrase = "The quick brown fox jumps over the lazy dog"
};
var doc = new Document();
// StringField indexes but doesn't tokenise
doc.Add(new StringField("name", source.Name, Field.Store.YES));
doc.Add(new TextField("favouritePhrase", source.FavouritePhrase, 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-md-6">
<p class="text-center">Construct a query</p>
<pre class="clean">
<code class="csharp">// search with a phrase
var phrase = new MultiPhraseQuery();
phrase.Add(new Term("favouritePhrase", "brown"));
phrase.Add(new Term("favouritePhrase", "fox"));
</code>
</pre>
</div>
<div class="col-xs-12 col-md-6">
<p class="text-center">Fetch the results</p>
<pre class="clean">
<code class="csharp">// re-use the writer to get real-time updates
var searcher = new IndexSearcher(writer.GetReader(applyAllDeletes: true));
var hits = searcher.Search(phrase, 20 /* top 20 */).ScoreDocs;
foreach (var hit in hits)
{
&nbsp;&nbsp;&nbsp;&nbsp;var foundDoc = searcher.Doc(hit.Doc);
&nbsp;&nbsp;&nbsp;&nbsp;hit.Score.Dump("Score");
&nbsp;&nbsp;&nbsp;&nbsp;foundDoc.Get("name").Dump("Name");
&nbsp;&nbsp;&nbsp;&nbsp;foundDoc.Get("favouritePhrase").Dump("Favourite Phrase");
}
</code>
</pre>
</div>
</div>
</div>
</section> <section class="home-section">
<div class="container">
<div class="row">
<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="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>
</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 © 2019 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>