[
https://issues.apache.org/jira/browse/LUCENE-7749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15952917#comment-15952917
]
Martin Amirault edited comment on LUCENE-7749 at 4/3/17 2:06 AM:
-----------------------------------------------------------------
[~jpountz] , thank you for working the on fix.
I dont have lucene development set up here, but the patch may still need one
more fix to work correctly (looking at 6.5.0 with your patch).
Actually LRUQueryCache#CachingWrapperWeight not delegating the scorerSupplier
was one of the problem, but there is another problem related to BulkScorer, if
you look at the last part of the stack trace:
{quote}
...
at
org.apache.lucene.search.BooleanWeight.scorer(BooleanWeight.java:381)
at org.apache.lucene.search.Weight.bulkScorer(Weight.java:160)
at
org.apache.lucene.search.BooleanWeight.bulkScorer(BooleanWeight.java:375)
at
org.apache.lucene.search.LRUQueryCache$CachingWrapperWeight.cache(LRUQueryCache.java:704)
at
org.apache.lucene.search.LRUQueryCache$CachingWrapperWeight.bulkScorer(LRUQueryCache.java:787)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:666)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:473)
{quote}
BooleanWeight.java:385 always get the score with randomAccess=false, which
again will ignore any IndexOrDocValuesQuery improvements.
Weight#bulkScorer should probably use the scorerSupplier method instead of the
scorer method internally.
was (Author: marumarutan):
[~jpountz] , thank you for working the fix.
I dont have lucene development set up here, but the patch may still need one
more fix to work correctly (looking at 6.5.0 with your patch).
Actually LRUQueryCache#CachingWrapperWeight not delegating the scorerSupplier
was one of the problem, but there is another problem related to BulkScorer, if
you look at the last part of the stack trace:
{quote}
...
at
org.apache.lucene.search.BooleanWeight.scorer(BooleanWeight.java:381)
at org.apache.lucene.search.Weight.bulkScorer(Weight.java:160)
at
org.apache.lucene.search.BooleanWeight.bulkScorer(BooleanWeight.java:375)
at
org.apache.lucene.search.LRUQueryCache$CachingWrapperWeight.cache(LRUQueryCache.java:704)
at
org.apache.lucene.search.LRUQueryCache$CachingWrapperWeight.bulkScorer(LRUQueryCache.java:787)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:666)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:473)
{quote}
BooleanWeight.java:385 always get the score with randomAccess=false, which
again will ignore any IndexOrDocValuesQuery improvements.
Weight#bulkScorer should probably use the scorerSupplier method instead of the
scorer method interally.
> IndexOrDocValuesQuery not working with LRUQueryCache (?)
> --------------------------------------------------------
>
> Key: LUCENE-7749
> URL: https://issues.apache.org/jira/browse/LUCENE-7749
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Martin Amirault
> Priority: Minor
> Attachments: LUCENE-7749.patch
>
>
> I was experimenting with 6.5.0-SNAPSHOT and could not see any performance
> improvement using the new IndexOrDocValuesQuery where I would have expected
> some.
> I am using a basic FILTER query (term + point/dv range), along with
> IndexSearcher#search.
> Looking at the stack trace it seems that LRUQueryCache#CachingWrapperWeight
> not delegating the scorerSupplier method is the reason.
> Maybe it is on purpose for the result to be cacheable ? Does that mean
> IndexOrDocValuesQuery is not useable with the default IndexSearcher cache ?
> (Or maybe am I just completely misusing the IndexOrDocValuesQuery feature ?)
> Here is a thread dump of the call to IndexOrDocValuesQuery#scorerSupplier
> {quote}
> at
> org.apache.lucene.search.IndexOrDocValuesQuery$1.scorerSupplier(IndexOrDocValuesQuery.java:148)
> at
> org.apache.lucene.search.IndexOrDocValuesQuery$1.scorer(IndexOrDocValuesQuery.java:168)
> at
> org.apache.lucene.search.LRUQueryCache$CachingWrapperWeight.scorer(LRUQueryCache.java:746)
> at org.apache.lucene.search.Weight.scorerSupplier(Weight.java:126)
> at
> org.apache.lucene.search.BooleanWeight.scorerSupplier(BooleanWeight.java:400)
> at
> org.apache.lucene.search.BooleanWeight.scorer(BooleanWeight.java:381)
> at org.apache.lucene.search.Weight.bulkScorer(Weight.java:160)
> at
> org.apache.lucene.search.BooleanWeight.bulkScorer(BooleanWeight.java:375)
> at
> org.apache.lucene.search.LRUQueryCache$CachingWrapperWeight.cache(LRUQueryCache.java:704)
> at
> org.apache.lucene.search.LRUQueryCache$CachingWrapperWeight.bulkScorer(LRUQueryCache.java:787)
> at
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:666)
> at
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:473)
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]