lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Khludnev <>
Subject Re: Anti-Pattern in lucent-join jar?
Date Thu, 04 Dec 2014 17:34:30 GMT

I wonder if you see which
solves such problem.
QueryResult Cache are useless for join, because they carry cropped results.
Potentially you can hit filter cache wrapping fromQuery into this monster
new FilteredQuery(new MatchAllDocsQuery(),
however, you refer to TermsWithScoreCollector, but filterCache doesn't
stores scores.
fromQuery is not a hotspot for JoinQuery usually (I spoke about it at last
Fwiw, it's common to have a heavy processing at Lucene level eg. see
RangeQuery. The idea is to cache the result of query execution (but not the
intermediate data) on the levels above like it's done Solr's filterCache or
Hope it helps

On Thu, Dec 4, 2014 at 6:49 PM, Darin Amos <> wrote:

> Hello All,
> I have been doing a lot of research in building some custom queries and I
> have been looking at the Lucene Join library as a reference. I noticed
> something that I believe could actually have a negative side effect.
> Specifically I was looking at the JoinUtil.createJoinQuery(…) method and
> within that method you see the following code:
>         TermsWithScoreCollector termsWithScoreCollector =
>             TermsWithScoreCollector.create(fromField,
> multipleValuesPerDocument, scoreMode);
>, termsWithScoreCollector);
> As you can see, when the JoinQuery is being built, the code is executing
> the query that is wraps with it’s own collector to collect all the scores.
> If I were to write a query parser using this library (which someone has
> done here), doesn’t this reduce the benefit of the SOLR query cache? The
> wrapped query is being executing when the Join Query is being constructed,
> not when it is executed.
> Thanks
> Darin

Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message