lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stelios Eliakis" <elia...@gmail.com>
Subject Re: highlighting
Date Mon, 25 Sep 2006 22:48:10 GMT
You are right!
1)As far as Example 1 is concerned, I don't want these 2 fragments to have
the same score.Do you know how could I do this?

2)Furthemore, if a try to take fragment score:

Scorer fragmentScore= highlighter.getFragmentScorer();
float fragmentScoreFloat=fragmentScore.getFragmentScore();

I take 0.0. why?

3)Moreover,  for some docs lucene don't returns any fragment even if the
query exist in the document. why? :)

Thanks in advance
Stelios Eliakis


On 9/26/06, Doron Cohen <DORONC@il.ibm.com> wrote:
>
>
> "Stelios Eliakis" <eliakis@gmail.com> wrote on 23/09/2006 02:39:27:
> > I want to extract the Best Fragment (passage) from a text file.
> > When I use the following code I take the first fragment that contains my
> > query. Nevertheless, the JavaDoc says that the function getBestFragment
> > returns the best fragment. Do I something wrong?
>
> That code seems fine to me.
>
> A possible explanation (which I think might be the case here but not sure)
> is that getBestFragment*() only accumulates fragments scores for matches
> of
> "unique terms" in the fragment.
>
> Example 1: query = "xy", and the term "xy" appears once in an early
> fragment but 3 times in a later fragment. In this case both fragments
> would
> be scored equally, and hence the early fragment would be selected "best"
> just because of how the sorting works.
>
> Example 2: query = "xy zw", and the early fragment contains "xy" but a
> later fragment contains both "xy" and "zw". In this case the later
> fragment
> would be selected "best".
>
> Does this explain what you see in your program?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
Stelios Eliakis

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message