Hi all,

Sorry I should clarify my last point.

The search() would return no hits, but the explain() using the apparently invalid docId returns a value greater than 0.

For what it's worth it's performing a PhraseQuery.

Thanks in advance,

Minh

Minh Kama Yie wrote:

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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to