lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <>
Subject [jira] [Commented] (LUCENE-7749) IndexOrDocValuesQuery not working with LRUQueryCache (?)
Date Mon, 03 Apr 2017 08:05:41 GMT


Adrien Grand commented on LUCENE-7749:

Hi Martin, thanks for looking at the patch. It is expected that BulkScorer always gets a scorer
with {{randomAccess=false}} since bulk scorers always need to return all matching documents.
I don't think this is an issue.

The stack trace that you shared happened because the query cache noticed that a BooleanQuery
that is part of your query tree (it might be your top-level query) is being reused, and so
it decides to build a cache entry for it ({{LRUQueryCache$CachingWrapperWeight.cache}}). Building
a cache entry requires to consume all documents that match the query, so it makes sense that
the scorer is created with {{randomAccess=false}}. Note that the fact that the boolean scorer
is created with {{randomAccess=false}} does not necessarily mean that all scorers of sub clauses
of the BooleanQuery will be created with {{randomAccess=false}} too: if the query is a conjunction
then only the clauses that have the lowest cost will be created with {{randomAccess=false}}.
As a consequence, the {{IndexOrDocValues}} optimization still applies if the range query is
not the least costly clause.

> IndexOrDocValuesQuery not working with LRUQueryCache (?)
> --------------------------------------------------------
>                 Key: LUCENE-7749
>                 URL:
>             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$1.scorerSupplier(
> 	  at$1.scorer(
> 	  at$CachingWrapperWeight.scorer(
> 	  at
> 	  at
> 	  at
> 	  at
> 	  at
> 	  at$CachingWrapperWeight.cache(
> 	  at$CachingWrapperWeight.bulkScorer(
> 	  at
> 	  at
> {quote}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message