Question

Does ravenDB automatically Short-circuit queries ? If not is there a way to achieve this.

Example: I search in my database using a full text search. But this search has other fields which should meet specific values. So how would I prioritize this other fields first before doing the expensive full text search.

Atm my query looks something like this:

condition1 AND condition2 AND FTS

I'm using Raven embedded client on the .Net 4.5 framework

Was it helpful?

Solution

No. Lucene, the index implementation under the hood, will sometimes re-arrange your query on a best-effort basis. But there's no short-circuit behavior available, and no way to achieve that.

Your assumption of full-text search being "expensive" is wrong. Phrase searches, and sometimes wildcard/prefix queries may be a bit costlier to perform due to large lists of terms to enumerate or the requirement to load position data, but all queries in RavenDB are practically a Lucene query so both condition1 and FTS in your query are practically the same.

HTH

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top