On Wed, Nov 21, 2012 at 10:40 AM, Robert Muir <rcm...@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-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org