1

I have an expression built with Dynamic Linq that is used to query a RavenDb. I would like to be able to view the generated Lucene query so that I can evaluate if it's performant or not. I saw here a mention of the RavenDB console but I'm trying to get the query in a unit test where the db is in memory. Is there any way to get the Lucene query generated for the filter below?

var filteredPersons = persons.AsQueryable().Where(expression);

Thanks!

Community
  • 1
  • 1
Bianca
  • 382
  • 4
  • 12

1 Answers1

6

You can use ToString() in order to get the Lucene query.

An example:

session.Query<Person>.Where(x => x.IsActive).ToString()
Fitzchak Yitzchaki
  • 9,095
  • 12
  • 56
  • 96