org.apache.lucene.mark
Interface MarkCollector


public interface MarkCollector

Receives callbacks to mark terms, context start/end, and span start/end notifications from ContextMarker.

Created: Dec 14, 2004

Author:
Martin Haye

Method Summary
 void beginContext(MarkPos pos, Span span)
          If context marking is enabled, this is called to mark the start of the context surrounding a hit.
 void beginField(MarkPos pos)
          Marks the position of the very start of the field.
 void beginSpan(MarkPos pos, Span span)
          Marks the beginning of a hit.
 void endContext(MarkPos pos)
          If context marking is enabled, this is called to mark the end of the context surrounding a hit.
 void endField(MarkPos pos)
          Marks the very end of the field.
 void endSpan(MarkPos pos)
          Marks the end of a hit.
 void term(MarkPos startPos, MarkPos endPos, String term)
          Marks the start and end of a search term.
 

Method Detail

beginField

void beginField(MarkPos pos)
Marks the position of the very start of the field.


term

void term(MarkPos startPos,
          MarkPos endPos,
          String term)
Marks the start and end of a search term. Depending on the term marking mode, this may occur only within hits, or in the context area surrounding hits, or in the whole field.

Parameters:
startPos - start character
endPos - end character
term - term text as found in the index

beginContext

void beginContext(MarkPos pos,
                  Span span)
If context marking is enabled, this is called to mark the start of the context surrounding a hit. It will be followed by a call to beginSpan(), one or more calls to term(), then a call to endSpan(), and finally a call to endContext().

Parameters:
pos - starting position for context
span - the hit for which context is being marked

beginSpan

void beginSpan(MarkPos pos,
               Span span)
Marks the beginning of a hit. If context marking is enabled, this will always occur within a beginContext()/ endContext() pair. It will be followed by one or more calls to term(), then a call to endSpan().


endSpan

void endSpan(MarkPos pos)
Marks the end of a hit. Always follows beginSpan().


endContext

void endContext(MarkPos pos)
If context marking is enabled, this is called to mark the end of the context surrounding a hit. Always follows beginContext().


endField

void endField(MarkPos pos)
Marks the very end of the field.