Menu
  • HOME
  • TAGS

Raven paging queries in a specific way

asp.net-mvc,pagination,ravendb

Okay so basically what you will need to do is calculate the number of results that were in the previous pages and the number of results that are in the current page. Below is a quick example app to give you an idea of how to do it. One caveat,...

RavenDB many to many and indexes

c#,ravendb

You have a couple of options here. You could store both the CategoryId and the CategoryName on the Item entity. This will of course lead to duplicated data (if you still need to store the Category entity), but "storage is cheap" is a popular term these days.The downside of this...

easiest way to retrieve all data set from ravendb

.net,ravendb

You can use the streaming API for that.

RavenDB - How to know if a Store(entity) created or updated an entity?

ravendb

There is no way to know, nothing in RavenDB really cares if the document exists already or being created.

Can RavenDB be interfaced outside of .Net?

ravendb

In RavenDB 3.0 they added a Java client as well. I haven't tried it myself, but you can read about it here: http://ayende.com/blog/168354/what-is-new-in-ravendb-3-0-jvm-client-api In that blog post Ayende also mentions: RavenDB has always been accessible from other platforms. We have users using RavenDB from Python and Node.JS, we also have...

Problems with RavenDB.Client reference in asp.net 5.0 project.json

c#,ravendb,asp.net-5

The problem is that you referencing RavenDB.Client in the top level dependencies node in project.json. That means that those dependencies are applicable to both Desktop CLR (aspnet50) and CoreCLR (aspnetcore50). When you build an ASPNET 5 project, all configurations are built, not just the "active" one. Mostly sure RavenDB.Client works...

Odd exception with Raven DB Bulk Insert

exception,ravendb,ravendb-http

That exception is from the watch that we use for the bulk insert. When it is done, we close the watch, and the exception is thrown. It is handled internally, and shouldn't have any affect on your application

How to query RavenDB using HTTP API for all documents of a type

ravendb,ravendb-http

You can do it using: http://localhost:8080/databases/{database name}/indexes/dynamic/CollectionName ...

What is the correct syntax for RavenDB Search method in F#

f#,ravendb

You mentioned that you tried casting the string to object. I tried it using :> obj and it does work. Here is my working query: let expr = <@ Func<MyType,_>(fun x -> x.Text :> obj ) @> |> LeafExpressionConverter.QuotationToExpression |> unbox<Linq.Expressions.Expression<Func<MyType,_>>> let events = session.Query<MyType>() .Search(expr, "Liv*", decimal 1, SearchOptions.Or,...

Counting cascaded distincts in RavenDB

asp.net-mvc-4,ravendb

The best I could come up so far is: Map = boards => from board in boards select new { Users = new object[] { board.CreatedBy, board.Settings.Admins, board.Settings.Members } }; Reduce = results => from r in results group r by "all" into g select new { Users = g.SelectMany(x...

Querying for terms with a Where clause in RavenDB

ravendb

There is no other way to get the terms of an index. To get the terms the only function that the client api offers is documented here. So if you have to get the terms filtered by some property value you must move the where clause to the index definition....

using ravenDb or mssql as event store

c#,domain-driven-design,ravendb,cqrs

You can use RavenDB in the normal way - just load and save items through the session: public class RavenEventStorage : IEventStorage { private IDocumentStore store; public RavenEventStorage(IDocumentStore store) { this.store = store; } public IEnumerable<Event> GetEvents(Guid aggregateId) { using(var session = store.OpenSession()) { BaseMemento memento = session.Load<BaseMemento>(aggregateId); // Its...

RavenDB: Find closest date in range

datetime,ravendb

This would require to go over all the data in the db. Instead, do two queries. One to get the first one equal or less than the date. One to get the first one equal or greater than the date. Then pick the closest....

Deleting one specific list-object from db

asp.net-mvc,ravendb

You need to just remove the document value. var artist = Session.Load<AllArtists>("artists/1"); artists.Albums.RemoveAt(3); Session.SaveChages(); ...

How to get a document from Raven using the HTTP API

ravendb,ravendb-http

That URL would address the system database. I assume you are using a named database. Try http://localhost:9999/databases/{DbName}/docs/locations/1...

connection to local raven instance doesn't work using https

iis,ravendb

With thanks to Ayende Rahien for support provided offline, it turned out this issue is actually due to a feature of IIS itself: Windows XP SP2 and Windows Server 2003 SP1 include a loopback check security feature that is designed to help prevent reflection attacks on your computer. Therefore, authentication...

RavenDB: Method not supported: All

c#,ravendb

One option (albeit possibly inefficient) is that you can always pull the query into memory and then perform .All (or any other Linq method) because the records are already loaded into the application space. To do this in most cases, you just add .AsEnumerable() on your IQueyable object. Because extension...

Ravendb LoadDocument showing NULL value

ravendb

Finally i got solution... Bellow is the Map-Reduce function,in which i have used LoadDocument<> for selecting data from ImportTiming Document. public class IdxJoinBetweenCollections : AbstractIndexCreationTask<Ticket,JoinBetweenCollections.ResultClass> { public IdxJoinBetweenCollections() { Map = docs => from doc in docs let TimeDoc = LoadDocument<ImportTiming>("ImportTiming/" + doc.TicketID) select new { ID = doc.TicketID, Total...

Stop RavenDB Service running when I don't need it

windows,service,ravendb

Just like any other service, you can use the services management console to start, stop, and configure startup preferences. Run services.msc or search for "Services" from your start screen....

RavenDB: Prevent Index from returning revisions

.net,ravendb

You can manipulate the index query to filter out all but "current" version. See: http://www.mostlylucid.co.uk/archive/2010/07/12/handy-indexes-for-versioning-with-ravendb.aspx

Compilation error creating a fan-out index from multiple string arrays using RavenDB

c#,indexing,lucene,ravendb

Using information from here I changed the map to the following which solves the problem. from doc in docs from text1 in ((IEnumerable<dynamic>)doc.Texts1) from text2 in ((IEnumerable<dynamic>)doc.Texts2) from text3 in ((IEnumerable<dynamic>)doc.Texts3) select new { Text1 = text1, Text2 = text2, Text3 = text3 } Unfortunately I don't understand why this...

IRavenQueryable Search can't find &-sign (or other special characters)

c#,search,escaping,ravendb,iqueryable

Ok, it turned out it was pretty easy. We were using a base Tokenizer in our Analyser, which filters out all special characters and characters with a length of 1. When we replaced public override TokenStream TokenStream(string fieldName, TextReader reader) { return new LowerCaseFilter(new ASCIIFoldingFilter(base.TokenStream(fieldName, reader))); } in our AsciiFoldingAnalyser...

Starts with and full text search on same field in one query using RavenDB

c#,ravendb

I ended up adding two fields to an index, both based on SomeText. One analyzed using the StandardAnalyzer and the other using the LowerCaseKeywordAnalyzer. This allowed me to do starts with searches using the field indexed by the LowerCaseKeywordAnalyzer. Using the field indexed by the StandardAnalyzer would have generated a...

Every Nth Item RavenDB

c#,ravendb

Have you tried using the .Skip() method instead? MyDoc nthValue = session.Query<MyDoc, MyDoc_Index>().Skip(nStep-1).FirstOrDefault(); ...

Membership reboot replace Ninject with Simple Injector

asp.net-web-api,ninject,ravendb,simple-injector,membershipreboot

Simple Injector forces you to let your components to have one single public constructor, because having multiple injection constructors is an anti-pattern. In case the UserAccountService is part of your code base, you should remove the constructor that should not be used for auto-wiring. In case the UserAccountService is part...

Multi-client architecture advice for RavenDB

wcf,ravendb,soa

Yes, you can just use it like that. Note that RavenDB comes with clients for both .NET and Java.

Why does RavenDB return a wrong total result count?

ravendb

You need Intersect when using multiple where clauses. To combine Where and Search, you have to pass SearchOptions.And to Search: using (var db = _documentStore.OpenSession()) { RavenQueryStatistics stats; var query = db.Query<Club>() .Customize(_ => _.WaitForNonStaleResultsAsOfLastWrite()) .Statistics(out stats) .Where(club => club.Type == "Amateur") .Search( club => club.Name, "Foo*", escapeQueryOptions: EscapeQueryOptions.AllowPostfixWildcard, options:SearchOptions.And);...

RavenDB Lucene Query equivalent of Linq Contains

linq,ravendb,lucene.net,contains

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...

Updating Field in RavenDB Document

c#,json,ravendb

You need to Parse the JSON into an object and then hand it over to Raven DB. Strings are treated as strings. Use JSON.NET library to parse it into Anonymous objects. Change your Info property to type of object. Then Assign the anonymous object to the Info property.

RavenDB Results Transform doesn't like the as keyword

ravendb

I didn't understand what was meant by trying to use AsDocument and my attempts at using it resulted in ugly code that didn't work, so I gave that up and tried to come up with another idea. It turns out that the <T> in the AbstractTransformerCreationTask doesn't have to align...

RavenDB Nested Object Projection from Static Index

c#,nosql,ravendb

You asked RavenDB to fetch the property from the index, so you need to actually specify the property. Use the following index: public class TestIndex : AbstractIndexCreationTask<CardApplication> { public TestIndex() { Map = apps => from app in apps select new { State = app.State, IdentityDetails_Applicant_FirstName = app IdentityDetails.Applicant.FirstName}; Sort(c...

RavenDB Index an Index

indexing,ravendb,event-sourcing

You can do that using Scripted Index Results. See the docs http://ravendb.net/docs/article-page/2.5/csharp/server/extending/bundles/scripted-index-results

Cannot sort integer field index correctly in RavenDB

.net,ravendb

The key was in the Indexing value for the field, it must be set to Default in order for the range field to be set up correctly for integer sorting. ...

Find out if a user liked specific comment

c#,ravendb

You can do it the other way, keep track of the comments on the user, so you can show the comments they liked.

RavenDB: How do I query for documents by a property name that's changed case?

c#,json.net,ravendb

You would need to use the LuceneQuery to manually set the property name for the query.

RavenDb - What's faster?

ravendb

Do a load by id, then compare.

RavenDb Sharding reliable hash

ravendb

Use something like MD5 or SHA1 for consistent hashing. But be aware of things like case sensitivity for this if you care about it.

Could not load type 'GatewayDeduplication' from assembly 'NServiceBus.Core

ravendb,nservicebus

Update the NServiceBus package to the latest (5.2.0) and this should solve the issue

When a ConcurrencyException occurs, what gets written?

concurrency,ravendb

ConcurrencyException means that on a single server, you have two writes to the same document at the same instant. That lead to: One write is accepted. One write is rejected (with concurrency exception). ...

ravendb check if item is in list

ravendb

If a product can only have one category then it would something like this: products = from p in session.Query<Product>() where p.Category.In(new[] { 1,2,3 }) select p; If multiple categories for a product the following should work: products = from p in session.Query<Product>() where p.Categories.Any(new[] { 1,2,3 }) select p;...

RavenDb : Issue of matching with Search() and wilcards

nosql,ravendb

I found the solution, it's due to the choice of the analyzer for the index : http://ravendb.net/docs/article-page/2.5/Csharp/client-api/querying/static-indexes/configuring-index-options I choose the "KeywordAnalyzer"....

Transactions for patches in RavenDb

ravendb

RavenDB does support transactions for patches, as long as you are patching by id. If you are patching by query, the operation is handled as a transaction for each individual document, but not globally. Calling LoadDocument in a patch will result in all documents modified by a patch sharing the...

Search each element in string array for multiple terms using RavenDB and lucene

c#,lucene,ravendb

If you need it that way, you can do: from doc in docs from text in doc.Tests select new { Text = text } Note that this is a fan-out index, and if you have a lot of texts per document, that require paying attention to the resources required....

Can I POST multiple patch requests to RavenDB's /bulk_docs HTTP API endpoint?

ravendb,ravendb-http

The structure for PATCH is : [ { Method: 'PATCH', Key: 'users/1', Patches: [{ Type: 'Set', Name:'username', Value: 'new-username' }] }, ... ] The full structure can be see here: https://github.com/ayende/ravendb/blob/master/Raven.Abstractions/Commands/PatchCommandData.cs#L72...

retrieving data using stream api

c#,.net,ravendb

The documentation says explicitly for unbound results: Important side notes: the index already exists. Creation of a index won't occur and the query error with an IndexDoesNotExistsException exception. And that's what your exception is saying. You have to create a static index for streaming results....

RavenDB 3.0 Index using Enumerable.Range

ravendb

Change the index to be: from pupil in docs.Pupils from year in Enumerable.Select(Enumerable.Range(pupil.BirthAcademicYear, 12), (Func<int,object>)(u=> u)) select new { pupil.Upn, year } ...

RavenDB Client 3.0 with casting error

c#,nosql,ravendb

You are using a 3.0 client to talk to a 2.x server, that is not supported.

Load Multiple types of Documents at Once

nosql,ravendb

You can use lazy loading: Lazy<One> oneLazy = session.Advanced.Lazily.Load<One>("ones/1"); Lazy<Two> twoLazy = session.Advanced.Lazily.Load<Two("twos/2"); var numbers = new FeedMeDocs() { one = oneLazy.Result, two = twoLazy.Result }; On the first access of one of the Lazy<>'s Result the session will query the server for the collected Load's....

RavenDb Sharding Hilo storage pattern

ravendb

Sharding is designed to be independent, but in order to create consistent ids, we need to be able to create them from a consistent store. Because of that, we separate the notion of splitting data to multiple nodes and HA. The typical scenario is that the metadata shard is independent,...

How can I get counts of related items in RavenDb?

c#,ravendb

The customary way to do something like this is by using an index (i.e. a map - reduce index). I haven't thoroughly thought this though, so there may be easier ways to achieve this than using a multi map, but I think you can do the following: public class CategoryUsageCount...

RavenDB Facet Null_Value

c#,ravendb,faceted-search

Add Where condition after Select to filter the size: Map = listings => listings .Select(listing => new { category = listing.Category, make = listing.Make, size = listing.Size // Size may sometimes be NULL }).Where(e => e.Size != null); ...

Alternative to RavenDB Studio?

ravendb

It's all just HTTP, so you can access the studio from another computer. You may need to update your Windows Firewall settings to allow access.

RavenDB Server Mode Performance

c#,ravendb

Finally, the high response time is due to the size of packets sent in the network (limited to 1514 bytes). We spend many time to assemble all the packets.

RavenDB - How to replicate an index, not a document collection, on SQL Replication

ravendb,ravendb-studio

You can try the index replication bundle and compile that on 3.0

How to merge DB rows into a document?

database,mongodb,nosql,ravendb

Your document could look something like this in MongoDB: { person_id:PersonId, name: PersonName, addresses:[{ id:AddressId1, street:AddressText1 }, { id:AddressId2, street:AddressText2 }, ... { id:AddressIdn, street:AddressTextn }] } Then, we could update the second address this way: db.collection.update({person_id:PersonId,"addresses.id":AddressId2},{$set:{"addresses.$.street":NewAddress}}) See here for additional detail:...

Disable DTC tracking in RavenDB with Voron storage

ravendb,msdtc

Set EnlistInDistributedTransactions = false on the document store, and it will work for you

RavenDb Multi-map/reduce index in case of no common property to group by

ravendb

As far as I understand you do not need the blogs in your index but their languages: AddMap<Post>((posts) => from post in posts select new { UserId = post.AuthorId, Count = 1, Language = LoadDocument<Blog>(post.BlogId).Language }); and then reduce by UserId and Language: Reduce = results => from result in...

RavenDb Sharding. Get rid of LoadDocument

ravendb

The second option is the better one, yes.

Transform Linq Data Structure

linq,ravendb

Here's one way to do a pivot in Linq: var pivot = data .GroupBy(d => new {d.Name, d.Year}) .Select(g => new { Name = g.Key.Name, Year = g.Key.Year, East = g.Where(c => c.State == "East").Sum(c => c.Total), West = g.Where(c => c.State == "West").Sum(c => c.Total), North = g.Where(c =>...

Cannot use transactions in RavenDB 3 unittests

testing,transactions,nosql,nunit,ravendb

I also posted this question in https://groups.google.com/forum/?hl=sv#!topic/ravendb/2fHg48KkuZM And ayende answered it. The solution is to use esent to run the test and not voron. I added this setting: documentStore.Configuration.DefaultStorageTypeName = "esent"; ...

RavenDb Migrate single server to sharded environment

ravendb

The easiest way would be to read it all from the single server and write it to the sharded store, yes. Alternatively, you can manually move the data and make sure that the sharding strategy you use handle it, but that is more complex....

RavenDb 2.5 - TransformWith() not working after Where()

indexing,ravendb

The .Where(...) in your case is using the standard where in "System.Linq" namespace but in order to use .TransformWith<>() you need to use the .Where(...) extension in "Raven.Client.Linq" namespace. Make sure you have: using Raven.Client.Linq; in your code....

RavenDB statistics.TotalResults returning incorrect value

ravendb

In Raven 2.5 there are no simple solutions for this problem and the only way to solve this is by creating a separate query that returns all distinct id's within that query and then counting the results. This issue is solved in raven 3.0 since there is a replacement on...

Bulk delete using Ravendb

c#,ravendb

You can use set based operation. The following code will query specific index and delete everything matching the query var operation = store.DatabaseCommands.DeleteByIndex("Index Name", new IndexQuery { Query = "Lucene query of stuff to delete" }, options: null); for example, the following code will delete all documents from a document...

Multiple LoadDocument for the same DocumentId in indexes and transformers

ravendb

LoadDocument is cached, so calling it once or multiple times for the same document doesn't really matter.

Return actual patched property value from patchcommand in RavenDb

c#,ravendb

You can use the output() method to send values back to the user.

What is RavenDB's default order of the results received when the Load function is used?

ravendb

Yes, it will be returned in the same order that you gave it.

RavenDB Embedded Versioning not working

.net,ravendb

According to the documentation, By default, the Versioning bundle will track history for all documents and never purge old revisions. It turns out that for the embedded database, the versioning configuration document must be added. using (var session = Store.OpenSession()) { session.Store(new { Exclude = false, Id = "Raven/Versioning/DefaultConfiguration" });...

RavenDb script patching consistency

ravendb

Idsa, You can resolve that without patching by setting UseOptimisticConcurrency=true; on the session, which will cause a ConcurrencyException to be thrown. With Patching, we'll make sure that the patch is always running on a consistent view of the document, and it will only be applied if there has been no...

RavenDB - How to can one make a WithinRadiusOf(radius,lat,lng) query where radius is a document property?

ravendb,geospatial,spatial-query

You cannot ask this question as stated. Instead of storing a radius, store a circle shape from the location, then you can call intersect on that.

Query across multiple types using RavenDb

.net,ravendb,lucene.net

Not sure about Lucene, but you can do what you ask for with a MultiMap index: public class CustomerAndBusiness_ByName : AbstractMultiMapIndexCreationTask<CustomerBusiness> { public CustomerAndBusiness_ByName() { AddMap<Business>(businesses => from business in businesses select new { business.Id, business.Name }); AddMap<Customer>(customers => from customer in customers select new { customer.Id, customer.Name }); Index(x...

NServiceBus 5 with RavenDb 3

ravendb,nservicebus

There is an open issue for this

RavenDB: Getting exception for in memory Document Store “Voron is prone to failure in 32-bits mode.”

unit-testing,ravendb

In the constructor for NewDocumentStore pass in the configureStore parameter. This is an Action that takes the EmbeddableDocumentStore as its parameter. Within that action you can set different parts of the Configuration, including the AllowOn32Bits property. public void ConfigureTestStore(EmbeddableDocumentStore documentStore) { documentStore.Configuration.Storage.Voron.AllowOn32Bits = true; } Then pass this as the...

RavenDB update denormalized reference and stale indexes

indexing,ravendb,eventual-consistency

That is by design, whenever you modify a document, all documents are stale until they can verify that this document isn't related to them.

Ensuring RavenDB 3.0 FileSystem Synchronization Before Action

c#,ravendb

You are looking for: DestinationSyncResult[] syncResults = await store.AsyncFilesCommands.Synchronization.SynchronizeAsync(); This will force your server to push all changes to destinations and return all the details about processed files and errors if happened any. Investigate also more methods exposed by IAsyncFilesSynchronizationCommands: store.AsyncFilesCommands.Synchronization.XXXXX You can also use the Changes API mechanism to...

session.SaveChanges() not working

asp.net,ravendb,updating

Assigning the quote object to temp will not allow you to use session.SaveChanges() without doing another session.Store(quote); So either make the changes on the quote object itself or call session.Store(quote); again. More Detail: When you load an object from Raven it is actually a proxy class with tracking enabled. If...

IRavenQueryable for both space-splitted search-terms and complete search-string as whole

c#,search,full-text-search,ravendb,iqueryable

You really don't need to bother. Unless I am having a serious brainfart, it would not change your result because the OR condition will always be matched by the preceding chain of ANDs....

Getting a scoped component from a IDocumentStoreListener

dependency-injection,ravendb,asp.net-5

You can actually access RequestServices off of the HttpContext to get scoped instances. It's kind of backwards, and really will depend on Microsoft.AspNet to do it, but it will work for your situation; interestingly, IHttpContextAccessor is a singleton, too, though it gives you a scoped value. // injected: IHttpContextAccessor httpContextAccessor;...

RavenDB query on property of Id struct

linq,ravendb

By default RavenDB uses the Id property as the identity of the document, and complex types are not supported (as far as I know). I recommend reading Working with document identifiers. In general you can change the name of the identity property in Conventions.FindIdentityProperty, but I recommend to change the...

i am getting different type of database related error while implementing raven db in mvc4

asp.net-mvc-4,ravendb,mvcjqgrid

You need to recover the embedded raven database. More information how to do that: https://groups.google.com/forum/#!topic/ravendb/eKUYf2cHUkQ I think we accidentally committed a corrupted ravendb in the repository. ...

Queries with date arguments not returning expected results in RavenDB

ravendb

There is a known issue in 3599 regarding dates queries, we've issued a quick fix in an unstable, and will soon have an update.

Ravendb retreive all documents in collection for reporting

lucene,ravendb

Change your query to be: var luceneQuery = Session.Advanced.LuceneQuery<Test.ReduceResult>("Raven/DocumentsByEntityName") .WhereEquals("Tag", "Customers"); This will give you all customers....

Query database ETags on RavenDb

ravendb

That information is available in the Raven/Sources/URL document, and you can read it like any other document.

RavenDB count index including zero values

c#,mapreduce,nosql,ravendb

I removed my earlier answer as it proved to be incorrect. In this case you can actually use a MultiMap/Reduce index to solve your problem. Try using the following index: public class Category_Items : AbstractMultiMapIndexCreationTask<Category_Items.ReduceResult> { public class ReduceResult { public string CategoryId { get; set; } public int Count...

Creating constructor and send to view [closed]

c#,asp.net-mvc,ravendb

In Pedigree constructor you need to instantiate the property classes as well, they are not instantiated so it throws null reference exception: public Pedigree() { this.Mother = new Dog{Name = "Chanelle", Merit1 = "Universal"}; this.Father = new Dog{Name = "dfdfdf", Merit1 = "dfdfdfdfdf"}; this.GrandFather = new Dog(); this.GrandMother = new...

Getting weird error when trying to get simple test project and RavenDB to work together

c#,ravendb

I had Common Language Runtime exceptions to be thrown, disabled that and now it works ...

Throw exception in scripted patch

ravendb

That is just standard JS: throw "Too big"; // throw a text throw 500; // throw a number ...

If I replace a character in an MD5 hash, does that increase the possibility of collisions?

c#,hash,md5,ravendb

X-Y problem - instead of converting byte array into version that is known to be correctly handled as string with Base64 (or similar) you using UTF8 as encoding. Reading random byte array as UTF8 string will have non-printable and 0 characters as well random failures due to incorrect UTF8 sequences....

What is this HILO object in RavenDb studio?

ravendb

RavenDB uses HILO algorithm to generate identities by default. "Hi (High)" values are saved in the server while "Lo (Low)" values are maintained in the client. What you see in the studio are the "Hi" values: http://ravendb.net/docs/article-page/3.0/csharp/client-api/document-identifiers/hilo-algorithm Here is a good blog post explains how HiLo algorithm works: http://codeofrob.com/entries/ravendb---the-hilo-what-how-and-why.html...

shuffling collection and Cannot understand how to translate NewGuid()

c#,.net,ravendb

If you want to do random ordering, you can do that directly, instead of like this: http://ravendb.net/docs/article-page/3.0/csharp/client-api/session/querying/how-to-customize-query#randomordering List<Employee> results = session.Query<Employee>() .Customize(x => x.RandomOrdering()) .Where(x => x.FirstName == "Robert") .ToList(); ...