문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top