I have queries with a big big amount of OR terms. The AND terms are much
more convenient to handle because they can be turned into several filter
queries and cached.

Thinking in innovative solutions I recalled the De Morgan Laws
http://en.wikipedia.org/wiki/De_Morgan's_laws of Boolean Algebras, and
considering that Set theory can be considered a generalized Boolean algebra
(with: intersection as . (dot),  union as +,  complement as negation,  full
set as 1 and empty set as 0) can be an innovative way of solving it

With regular filter queries, all the fq filters are merged into one (using
intersection of sets) and in the results of the query we only consider the
documents contained in that resulting set. If we had an "inverse filter
query" that merges all the filters into one (performing an intersection
among the filter sets in the regular way) and then considering in the
results only documents NOT contained in the resulting set, we could
implement multiple OR queries in a much more performant way by aplying De
Morgan law to the query.

What are your opinions on this?

Thanks
Emmanuel

Reply via email to