RavenDB version 2.0. Other versions:

Lucene queries example



Looking for words

In case we want to find all documents with property Text containing some word.


Looking for phrases

In case we want to find all documents with property Text containing specified sentence.

Text:"several words"

DateTime ranges

Take a look at these tests.


How can I query for a null value?

Let us say that we want to find all users that didn't provide their email. This is the query that we will need to issue:


The [[ ]] denotes and NotAnalyzed value, and Raven writes NULL_VALUE to the Lucene index when it encounters a null being indexed.

Comments add new comment

The comments section is for user feedback or community content. If you seek assistance or have any questions, please post them at our support forums.

Andrew Harry
REPLY Posted by Andrew Harry on

Don't forget you can query for empty strings with [EMPTY_STRING]

REPLY Posted by Khalilov on

A note for other extreme beginners like myself for the AND operator, if you wish to apply the AND operator to a specific query (Correct):

Message: hello AND Message: hi

I thought it was supposed to be (Wrong):

Message: hello AND hi