org.apache.lucene.chunk
Interface DocNumMap

All Known Implementing Classes:
XtfDocNumMap

public interface DocNumMap

Provides information on the chunk size and chunk overlap for a given index, and provides a mapping from main documents to the chunks they are made of.


Method Summary
 int getChunkOverlap()
          Get the number of words one chunk overlaps with the next
 int getChunkSize()
          Get the max number of words per chunk
 int getDocCount()
          Count the number of main documents (not chunks) in the index.
 int getDocNum(int chunkNumber)
          Given a chunk number, return the corresponding document number that it is part of.
 int getFirstChunk(int docNum)
          Given a document number, this method returns the number of its first chunk.
 int getLastChunk(int docNum)
          Given a document number, this method returns the number of its last chunk.
 

Method Detail

getChunkSize

int getChunkSize()
Get the max number of words per chunk


getChunkOverlap

int getChunkOverlap()
Get the number of words one chunk overlaps with the next


getDocCount

int getDocCount()
Count the number of main documents (not chunks) in the index.


getDocNum

int getDocNum(int chunkNumber)
Given a chunk number, return the corresponding document number that it is part of. Note that like all Lucene indexes, this is ephemeral and only applies to the given reader. If not found, returns -1.

Parameters:
chunkNumber - Chunk number to translate
Returns:
Document index, or -1 if no match.

getFirstChunk

int getFirstChunk(int docNum)
Given a document number, this method returns the number of its first chunk.


getLastChunk

int getLastChunk(int docNum)
Given a document number, this method returns the number of its last chunk.