lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Minh Kama Yie <m...@nuix.com.au>
Subject Use of explain() vs search()
Date Wed, 08 Sep 2004 04:28:15 GMT
Hi all,


I was wondering if anyone could tell me what the expected behaviour is 
for calling an explain() without calling a search() first on a 
particular query. Would it effectively do a search and then I can 
examine the Explanation in order to check whether it matches?

I'm currently looking at some existing code to this effect:

Explanation  exp = searcher.explain(myQuery, docId)
// Where docId was _not_ returned by a search on myQuery

if (exp.getValue() > 0.0f)
{
    // Assuming document for docId matched query.
}

Is the assumption wrong?

I ask because the result of this code is inconsistent with

Hits h = searcher.search(myQuery);  // there are not hits returned.

Thanks in advance,

Minh




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


Mime
View raw message