On 19-Apr-08, at 3:02 AM, Christian Wittern wrote:
Mike Klaas wrote:

Fragments are generated independently from matching (I realize this isn't an ideal algorithm).

So it could be that the match is not part of the fragment? This sounds a bit strange. Is there a way to make sure the fragment contains the match other than returning the whole field and do the fragmenting myself?

The highlighting algorithm is as follows:
 1. fragment the whole field into N fragments
2. score each fragment based on the keyword matches (more matches the better; prefer different keyword matching to many of the same keyword matching). fragments that have no matching keywords do not have a positive score.
 3. return the top hl.maxSnippets fragments that score > 0

As you can see, only fragments containing a match are returned (note that there is very often multiple matches--you seemed to assume only one).

-Mike

Reply via email to