Query customizations

Raven's Query has a bunch of customizations which you can set by using Customize() method. Example:

session.Query<User>().Customize(x => x.WaitForNonStaleResultsAsOfLastWrite());

Below there are presented available query customization options. All of them have equivalents for LuceneQuery. In example the Lucene version of the query above would be:

session.Advanced.LuceneQuery<User>().WaitForNonStaleResultsAsOfLastWrite();

NoCaching

It disables the caching for query results. It means that a response of a request send to get results of a specified query will not be keep in the cache.

session.Query<User>().Customize(x => x.NoCaching());

NoTracking

It disables the tracking mechanism for queried entities by Raven's Unit of Work. The usage of this option will prevent holding query results in memory.

session.Query<User>().Customize(x => x.NoTracking());