lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <trej...@trypticon.org>
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 <rcmuir@gmail.com> 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.

TX

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message