lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <>
Subject Re: Performance of IndexSearcher.explain(Query)
Date Wed, 21 Nov 2012 02:07:05 GMT
On Wed, Nov 21, 2012 at 10:40 AM, Robert Muir <> wrote:
> Explain is not performant... but the comment is fair I think? Its more of a
> worst-case, depends on the query.
> Explain is going to rewrite the query/create the weight and so on just to
> advance() the scorer to that single doc
> So if this is e.g. a wildcard query then it could definitely be almost as
> slow as searching the whole index since the rewrite involves scanning
> through the term dictionary or whatever.

Hmm, yep. That does seem to be it. For complicated queries (or at
least queries which are slow to create a weight for) it's about the
same speed no matter which way I do it. For the more normal queries I
was trying, explain() seems to speed things up a fair bit. For simple
one-term queries it might be a bit quicker still.

It's at least never slower than doing the full query though, so I can
still use it. I'll just be putting a similar (though perhaps more
specific) warning about performance on the method.


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

View raw message