Reputation: 728
Does anyone know how to write RavenDB Lucene query which is equivalent to the following Linq statement?
var results = events.Where(e => e.Detail.Contains("test"));
Any help on this would be much appreciated.
Thanks.
Upvotes: 0
Views: 761
Reputation: 1177
Not sure this is what you're looking for, but this is using ravendb (build 3548) DocumentQuery wich takes a lucene query in the where statement:
using (var session = _documentStore.OpenSession())
{
var result = session.Advanced
.DocumentQuery<Events>()
.Where("Details: *test*")
.ToList();
}
http://ravendb.net/docs/article-page/2.0/csharp/client-api/querying/query-and-lucene-query
Edit: This might not be very effective in terms of performance. Not sure how lucene is handling these kind of wildcards.
Upvotes: 3