lucene-solr-user mailing list archives

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

I wonder if you see https://issues.apache.org/jira/browse/SOLR-6234 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
bridge
new FilteredQuery(new MatchAllDocsQuery(),
filterCache.get(fromQuery).getTopFilter())
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
LuceneRevolution)
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
queryResultCache.
Hope it helps


On Thu, Dec 4, 2014 at 6:49 PM, Darin Amos <darincs@gmail.com> 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);
>         fromSearcher.search(fromQuery, 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

<http://www.griddynamics.com>
<mkhludnev@griddynamics.com>

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