What is LINQ to Lucene?

Providing a custom LINQ solution for the Lucene Information Retrieval System, commonly referred to as a search-engine.

Your feedback and thoughts on LINQ to Lucene are vital to guiding the direction of this project. Please submit your feedback, feature suggestions and bugs into the Issue Tracker or Discussion Forum

Blog Posts
Here are some useful links that demonstrate the use of LINQ to Lucene:
Current Release
LinqToLucene v0.61
Monday, April 2, 2012
Azure Blob Support for both Lucene indexes and entities in binary files
Azure Tables Support for both Lucene indexes and entities in binary files

Older Release
LinqToLucene v0.6
Monday, March 26 2012
Much refactoring and... Azure Blob Support for both Lucene indexes and entities in binary files

Older Release
LinqToLucene v0.5
Sunday, March 24 2012
Older Release
The Refactored Release
Tuesday, 22nd July 2008
A large set of library changes including an API analogous to LINQ to SQL, more supported LINQ methods, powerful LINQ to SQL Data Context support and more unit tests.

Older Release
The Re-Release
As promised, this release merges the features of previous releases into the one bundle.

Older Release
The Type-Conversion Release
Monday, 19 November 2007
As promised (albeit out of order), support has been added for type-conversion. If the type of the indexed-property uses a type-converter that supports conversion from a string, the type will automatically convert to its appropriate type. This automatically inlcudes string, bool, int, datetime and a number of other .net types that already implement their own type-converters. Custom types can implement their own type-converters. For more information on type-converters please review either of the following article: MSDN: How to Implement a Type-Converter

Older Release
The Query Release
Tuesday, 13 November 2007
This release provides a real focus on the querying abilities of the LINQ to Lucene project and is the first real 'working release', converting LINQ statements to Lucene queries with deferred query execution and object creation or projection. It culminates the majority of the required querying features for LINQ that Lucene provides natively.

Lucene Syntax LINQ to Lucene
Terms & Phrases "test" or "hello dolly" c.Match("test") or c.Match("hello dolly")
Fields title:"The Right way" and text:go c.Title == "The Right way" or c.Text == "go"
WildCard amb?r c.ContactName.Match("amb?r")
Prefix amber* c.ContactName.StartsWith("amber")
Fuzzy roam~ or roam~0.8 c.ContactName.Like("roam") or c.ContactName.Like("roam", 0.8)
Proximity "jakarta apache"~10 c.ContactName.Like("jakarta apache", 10)
Inclusive Range mod_date:[20020101 TO 20030101] c.ModifiedDate.Includes("20020101", "20030101")
Exclusive Range title:{Aida TO Carmen} c.Title.Between("Aida", "Carmen")
Boosting jakarta^4 apache c.Title.Match("jakarta".Boost(4), apache)
Boolean Or "jakarta apache" OR jakarta where c.Match("jakarta apache") || c.Match("jakarta")
Boolean And "jakarta apache" AND "Apache Lucene" where c.Match("jakarta apache") && c.Match("Apache Lucene")
Boolean Not "jakarta apache" NOT "Apache Lucene" where c.Match("jakarta apache") && !c.Match("Apache Lucene")
Required +jakarta lucene c.Title.Match("jakarta".Require(), "lucene")
Grouping (jakarta OR apache) AND website where (c.Title == "jakarta" || c.Title == "apache") && (c.Title == "website")
Native Syntax ie. title:{+return +"pink panther") c.Search("title:(return +\"pink panther\"")

First Releases
A first release for generating a simple index out of a database for mapping types to Lucene using LINQ is now available.
This is the first small piece of the puzzle.

The Index Release
public class Customer 
  [Field(Store=FieldStore.Yes, Index=FieldIndex.No)] public string CustomerID { get; set; }
  [Field(Store=FieldStore.Yes, Index=FieldIndex.Tokenized)] public string CustomerName { get; set; }

IndexContext index = new IndexContext;

Last edited Apr 2, 2012 at 1:50 PM by stemarie, version 99