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 Re: Use of explain() vs search()
Date Mon, 13 Sep 2004 01:37:03 GMT
Thanks for the reply Erik.
Sorry about the lateness of this reply; I was out of the office last 
week and it took me a bit to create a stand alone test case today.

I should prefix my statements by saying that I've discovered the problem 
I'm having is with 1.3, and it appears fixed in 1.4.
I also undestand that it is kind of illogical to "explain" a query that 
for a document that isn't returned by the query but nonetheless
I'm looking for confirmation that this is a bug and what can be done to 
fix it in 1.3
In doing so I hope to understand the main differences between explain() 
and search().

The test case is attached in the file LuceneTest.java

Notice that if you search for "currently classifies" in the content 
field and "9" in the id field, you will get 0 hits, but the explanation 
returns a value greater than 0.

Thanks in advance guys,

Minh



Erik Hatcher wrote:

> Could you create a simple piece of code (using a RAMDirectory) that 
> demonstrates this issue?
>
>     Erik
>
> On Sep 8, 2004, at 12:35 AM, Minh Kama Yie wrote:
>
>> 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: lucene-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> 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