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 Fabio Gasparetti <ga...@dia.uniroma3.it> on 2004/01/30 17:32:57 UTC
selective-field and score
I'd like to have the query score of one particular document,
without cycling all the results.
I've used a "id" field so I can select the doc, then I execute:
QueryParser.parse("("+queryString+") AND id:"+id, "text", analyzer);
But in this way, the obtained score from hits is always 1.
If the id field is dropped, I've the correct score,
but I'm not able to directly select the doc I want.
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
Re: selective-field and score
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
If you know the document id, you can use IndexSearcher.explain() (you
could do a TermQuery to find it to get the number, or get to it more
directly through IndexReader perhaps).
You are affecting the score by adding more to the query as the score is
based on the query itself.
Erik
On Jan 30, 2004, at 11:32 AM, Fabio Gasparetti wrote:
> I'd like to have the query score of one particular document,
> without cycling all the results.
> I've used a "id" field so I can select the doc, then I execute:
>
> QueryParser.parse("("+queryString+") AND id:"+id, "text", analyzer);
>
> But in this way, the obtained score from hits is always 1.
> If the id field is dropped, I've the correct score,
> but I'm not able to directly select the doc I want.
>
>
>
>
>
> ---------------------------------------------------------------------
> 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