You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Haoyu Zhai <zh...@gmail.com> on 2020/09/23 02:33:08 UTC

BooleanQuery normal form

Hi there,
Does Lucene support normalizing a BooleanQuery into normalized form (like
CNF or DNF)?

If not, is there a suggested way of doing it?

Also, I wonder whether there'll be a performance difference between
different forms of essentially the same BooleanQuery?

Thanks
Patrick

Re: BooleanQuery normal form

Posted by Michael McCandless <lu...@mikemccandless.com>.
Hi Patrick,

I don't think Lucene supports CNF or DNF for BooleanQuery?

BooleanQuery will try to do some rewriting simplifications for degenerate
cases, e.g. a BooleanQuery with a single clause.  Probably it could do more
optimizing?  It is quite complex already :)

Mike

On Tue, Sep 22, 2020 at 10:33 PM Haoyu Zhai <zh...@gmail.com> wrote:

> Hi there,
>
> Does Lucene support normalizing a BooleanQuery into normalized form (like
>
> CNF or DNF)?
>
>
>
> If not, is there a suggested way of doing it?
>
>
>
> Also, I wonder whether there'll be a performance difference between
>
> different forms of essentially the same BooleanQuery?
>
>
>
> Thanks
>
> Patrick
>
> --
Mike McCandless

http://blog.mikemccandless.com