- Are the LinqToLucene and the Lucene.Net.Linq projects different?
- What are the pros and cons of each of them?
Since I found Lucene.Net.Linq to be updated more recently relative to LinqToLucene and it is available in nuget I want to use it in my simple project, but I came across lack of documentation and I can't find how can I use lucene advanced queries with this package like what are possible in LinqToLucene for example:
var query = from c in index.Customers where c.Like("amber") || c.CompanyName.Between("a", "d") where !c.CustomerId == "Jason"
If this extension functions aren't available then what is the point of this project?
- If it is not the point how can i use advance queries in LINQ to Lucene.Net?
With this code:
you could work with file system and not system memory.
LINQ to Lucene appears to be inactive. The last commit at time of writing was in October 2012 and the last discussion post asking if the project is active has gone unanswered since the same time frame.
LINQ to Lucene has some tight coupling to Entity Framework so it seems to me the project is designed to index data coming from EF for free text search.
Lucene.Net.Linq is a completely separate project that I started in 2012 and have been actively maintaining. This project does not have any coupling to EF or other libraries. It only depends on Lucene.Net, Common.Logging for logging, and Remotion.Linq for helping with LINQ query parsing and translation. I originally evaluated the possibility of contributing to LINQ to Lucene, but found that the tight coupling to EF and some other assumptions made the library inappropriate for my needs.
LINQ to Lucene cons:
where
clauseLucene.Net.Linq pros:
Lucene.Net.Linq cons:
The documentation, such that it is, consists of the project README and sample code in the unit test project.
Lucene.Net.Linq does not have extension methods for every query that Lucene.Net supports natively. However, it does provide an escape hatch where you can pass in your own
Query
:And it supports searching any indexed field with fuzzy match:
And it supports simple matching with
==
and!=
:Note that the meaning of
==
is controlled by how a given field is indexed. If the field is indexed as a keyword, exact matching takes effect. If the field is tokenized, stemmed, converted to lowercase, etc, then==
would match any term in the field.