Since the result1 is equal to result2 I would assume that both usages are correct and equivalent. An interesting fact is that RavenDB's statistics total results is only correct when the query is build in the same way as for result2. But can anybody explain me in detail why the query as built in result1 is wrong or a bad practice despite the results are equivalent? Any idea why the statistics total results isn't working?
result1 = query1
.Where(first filter)
.Intersect()
.Search(second filter)
.Search(third filter)
.ToList();
Is interpreted as (first filter) INTERSECT ((second filter) OR (third filter)) by lucene.
result2 = query2.Where(first filter)
.Search(second filter, options:SearchOptions.And)
.Search(third filter).Search(third filter, options:SearchOptions.Or)
.ToList();
Is interpreted as (first filter) AND ((second filter) OR (third filter)) by lucene.