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 Michael Wilkowski <mw...@silenteight.com> on 2017/05/23 11:52:26 UTC

MultiTermQuery vs multiple TermQuery'ies - is there a performance gain?

Hi,
I am building an app that will create multiple term queries join with OR
(>100 primitive TermQuery'ies).

Is there a real performance gain implementing custom MultiTermQuery instead
of simply joining multiple TermQuery with OR?

Regards,
MW

Re: MultiTermQuery vs multiple TermQuery'ies - is there a performance gain?

Posted by Adrien Grand <jp...@gmail.com>.
Rather than MultiTermQuery, you could consider using TermInSetQuery.
Depending on the number of terms, it will use sensible defaults. The main
drawback is that it returns constant scores, but if this does not work for
you then MultiTermQuery would not work either.

Le mar. 23 mai 2017 à 13:52, Michael Wilkowski <mw...@silenteight.com> a
écrit :

> Hi,
> I am building an app that will create multiple term queries join with OR
> (>100 primitive TermQuery'ies).
>
> Is there a real performance gain implementing custom MultiTermQuery instead
> of simply joining multiple TermQuery with OR?
>
> Regards,
> MW
>