RavenDB 4.1 FeaturesCan you explain that choice?

time to read 2 min | 204 words

One of the features that RavenDB exposes is the ability to get results in match order. In other words, you can write a query like this:

from Employees 
    boost(Address.City = 'London', 10) 
or  boost(Address.City = 'Seattle', 5)
order by score()
include explanations()

In other words, find me all the employees in London or Seattle, but I want to get the London employees first. This is a pretty simple example. But there are cases where you may involve multiple clauses, full text search, matches on arrays, etc. Figuring out why the documents came back in the order that they did can be complex.

Luckily, RavenDB 4.1 give you a new feature just for that. Look at the last line in the query: “include explanations()”. This will tell RavenDB that you want to dig into the actual details of the query, and in the user interface you’ll get:


And the full explanation for each is:


More posts in "RavenDB 4.1 Features" series:

  1. (22 Aug 2018) MongoDB & CosmosDB Migration Wizards
  2. (04 Jul 2018) This document is included in your subscription
  3. (03 Jul 2018) Detailed query timing details
  4. (02 Jul 2018) Of course I know ya, dude
  5. (29 Jun 2018) Running RavenDB embedded
  6. (26 Jun 2018) Can you explain that choice?
  7. (20 Jun 2018) Cluster wide ACID transactions
  8. (19 Jun 2018) Explain that choice
  9. (22 May 2018) Highlighting
  10. (11 May 2018) Counting my counters
  11. (10 May 2018) JavaScript Indexes
  12. (04 May 2018) SQL Migration Wizard