Re: Searching within very large subset of documents

Adrien Grand <[email protected]> Thu, 7 Aug 2025 09:40:55 +0200
Newsgroups gmane.comp.jakarta.lucene.user
Message-ID <CAPsWd+OPJ-rzYoj8Q5DYVVkTWRY3miJxWc0iDbch35XwmF_t2Q@mail.gmail.com>
--000000000000719d3e063bc1941b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Glad to hear it!

Le mer. 6 ao=C3=BBt 2025, 22:32, Thomas Barr <[email protected]> a =C3=A9crit :

> For what it's worth, TermInSetQuery worked great! Thanks!
>
> > On Aug 4, 2025, at 11:26=E2=80=AFPM, Adrien Grand <[email protected]> w=
rote:
> >
> > Hi Thomas,
> >
> > Your question suggests that you are creating a huge BooleanQuery to
> > identify these documents. A TermInSetQuery should perform better.
> >
> > Doing better would require to better understand what you are trying to
> > achieve. For instance if you end up with such a large list of terms
> because
> > you're trying to evaluate a join, you may want to look at Lucene's
> support
> > for suery-time joins:
> >
> https://lucene.apache.org/core/10_1_0/join/org/apache/lucene/search/join/=
package-summary.html#query-time-joins-heading
> >
> > Le mar. 5 ao=C3=BBt 2025, 05:48, Thomas Barr <[email protected]> a =
=C3=A9crit
> :
> >
> >> I have a medium-sized (~10m) Lucene index and I frequently want to
> >> repeatedly search within a subset of around ~100k documents. I can
> increase
> >> MaxClauseCount and build up a huge TermQuery, keep that around, then
> build
> >> a BooleanQuery out of the result at runtime, but the resulting query i=
s
> >> quite slow. The now deprecated Filter would have been a good option
> with a
> >> BitSet, but that=E2=80=99s deprecated.
> >>
> >> Any thoughts on the best way to do this?
> >>
> >> Thanks!
> >> -twb
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [email protected]
> >> For additional commands, e-mail: [email protected]
> >>
> >> Adrien
>
> Adrien

--000000000000719d3e063bc1941b--