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 江梓涵 <ji...@ict.ac.cn> on 2017/09/11 02:28:00 UTC

How do I get lucene to score a given document

Hello, I am a student of Chinese Academy of Sciences. Search engine that based on lucene is an important part of our experiment. My question is how can I get lucene to score the given documents. For example, I just want lucene to score the document in the given docId set. As far as i know, Lucene will score all relevant documents in each query. I try to use filterQuery, but It increased the cost of time. 

Waiting for your kind help. Thanks!

RE: How do I get lucene to score a given document

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

There is an explain functionality for single documents available for that. Check IndexSearcher.explain(). Otherwise a filter is your only chance. It should not be slow, as selective filters (applied with BooleanClause.Occur.FILTER, maybe your filter is the problem: if you have many IDs to limit on, use Term*s*Filter/Term*s*Query)?

Uwe

-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: 江梓涵 [mailto:jiangzihan@ict.ac.cn]
> Sent: Monday, September 11, 2017 4:28 AM
> To: java-user@lucene.apache.org
> Subject: How do I get lucene to score a given document
> 
> Hello, I am a student of Chinese Academy of Sciences. Search engine that
> based on lucene is an important part of our experiment. My question is how
> can I get lucene to score the given documents. For example, I just want
> lucene to score the document in the given docId set. As far as i know, Lucene
> will score all relevant documents in each query. I try to use filterQuery, but It
> increased the cost of time.
> 
> Waiting for your kind help. Thanks!


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