You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Hany Azzam <ha...@eecs.qmul.ac.uk> on 2012/02/10 18:43:29 UTC

Re: Filter and IndexSearcher in Lucene 4.0 (trunk)

Hi,

I apologise upfront for the trivial question. I have an IndexSearcher and I am applying a FieldCacheTermsFilter filter on it to only retrieve documents whose single docId is in a provided set of allowed docIds. I am particularly interested in the stats being estimated over the accepted set of documents. However, the filtering is not working. Am I missing something here?

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


Re: Filter and IndexSearcher in Lucene 4.0 (trunk)

Posted by Hany Azzam <ha...@eecs.qmul.ac.uk>.
See the question was so trivial that you actually missed it :) 

The problem is that the docs are filtered (which is is great) but the stats (BasicStats) aren't, i.e. the stats have been calculated over the whole index and not just a selected set of documents. For example:

        Filter filter = new FieldCacheTermsFilter("QNO", queryNumber);
        searcher.search(qq, filter, collector);
	....
	stats.getNumberOfDocuments();

I only want to consider certain docs per query. The filter achieves that in terms of matching and the returned the results. However, the calculated score for each document has been calculated using the stats over the whole index and not just the filtered documents. Is there a way to calculate the stats only over the filtered documents? 

I hope the problem is a bit clearer now.

Thank you.

h.


On 10 Feb 2012, at 18:27, Uwe Schindler wrote:

> Whats the problem?
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
>> -----Original Message-----
>> From: Hany Azzam [mailto:hany@eecs.qmul.ac.uk]
>> Sent: Friday, February 10, 2012 6:43 PM
>> To: java-user@lucene.apache.org
>> Subject: Re: Filter and IndexSearcher in Lucene 4.0 (trunk)
>> 
>> Hi,
>> 
>> I apologise upfront for the trivial question. I have an IndexSearcher and
> I am
>> applying a FieldCacheTermsFilter filter on it to only retrieve documents
> whose
>> single docId is in a provided set of allowed docIds. I am particularly
> interested
>> in the stats being estimated over the accepted set of documents. However,
> the
>> filtering is not working. Am I missing something here?
>> 
>> h.
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 


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


RE: Filter and IndexSearcher in Lucene 4.0 (trunk)

Posted by Uwe Schindler <uw...@thetaphi.de>.
Whats the problem?

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Hany Azzam [mailto:hany@eecs.qmul.ac.uk]
> Sent: Friday, February 10, 2012 6:43 PM
> To: java-user@lucene.apache.org
> Subject: Re: Filter and IndexSearcher in Lucene 4.0 (trunk)
> 
> Hi,
> 
> I apologise upfront for the trivial question. I have an IndexSearcher and
I am
> applying a FieldCacheTermsFilter filter on it to only retrieve documents
whose
> single docId is in a provided set of allowed docIds. I am particularly
interested
> in the stats being estimated over the accepted set of documents. However,
the
> filtering is not working. Am I missing something here?
> 
> h.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


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