Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Public Member Functions | Properties | List of all members
Lucene.Net.Index.TermVectorMapper Class Referenceabstract

The TermVectorMapper can be used to map Term Vectors into your own structure instead of the parallel array structure used by Lucene.Net.Index.IndexReader.GetTermFreqVector(int,String). It is up to the implementation to make sure it is thread-safe. More...

Inherited by Lucene.Net.Index.FieldSortedTermVectorMapper, Lucene.Net.Index.ParallelArrayTermVectorMapper, Lucene.Net.Index.PositionBasedTermVectorMapper, and Lucene.Net.Index.SortedTermVectorMapper.

Public Member Functions

abstract void SetExpectations (System.String field, int numTerms, bool storeOffsets, bool storePositions)
 Tell the mapper what to expect in regards to field, number of terms, offset and position storage. This method will be called once before retrieving the vector for a field.
 
abstract void Map (System.String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions)
 Map the Term Vector information into your own structure
 
virtual void SetDocumentNumber (int documentNumber)
 Passes down the index of the document whose term vector is currently being mapped, once for each top level call to a term vector reader. Default implementation IGNORES the document number. Override if your implementation needs the document number. NOTE: Document numbers are internal to Lucene and subject to change depending on indexing operations.
 

Properties

virtual bool IsIgnoringPositions [get]
 Indicate to Lucene that even if there are positions stored, this mapper is not interested in them and they can be skipped over. Derived classes should set this to true if they want to ignore positions. The default is false, meaning positions will be loaded if they are stored.
 
virtual bool IsIgnoringOffsets [get]
 
 

Detailed Description

The TermVectorMapper can be used to map Term Vectors into your own structure instead of the parallel array structure used by Lucene.Net.Index.IndexReader.GetTermFreqVector(int,String).

It is up to the implementation to make sure it is thread-safe.

Definition at line 32 of file TermVectorMapper.cs.

Member Function Documentation

abstract void Lucene.Net.Index.TermVectorMapper.Map ( System.String  term,
int  frequency,
TermVectorOffsetInfo[]  offsets,
int[]  positions 
)
pure virtual

Map the Term Vector information into your own structure

Parameters
termThe term to add to the vector
frequencyThe frequency of the term in the document
offsetsnull if the offset is not specified, otherwise the offset into the field of the term
positionsnull if the position is not specified, otherwise the position in the field of the term

Implemented in Lucene.Net.Index.ParallelArrayTermVectorMapper, Lucene.Net.Index.SortedTermVectorMapper, Lucene.Net.Index.PositionBasedTermVectorMapper, and Lucene.Net.Index.FieldSortedTermVectorMapper.

virtual void Lucene.Net.Index.TermVectorMapper.SetDocumentNumber ( int  documentNumber)
virtual

Passes down the index of the document whose term vector is currently being mapped, once for each top level call to a term vector reader. Default implementation IGNORES the document number. Override if your implementation needs the document number. NOTE: Document numbers are internal to Lucene and subject to change depending on indexing operations.

Parameters
documentNumberindex of document currently being mapped

Definition at line 108 of file TermVectorMapper.cs.

abstract void Lucene.Net.Index.TermVectorMapper.SetExpectations ( System.String  field,
int  numTerms,
bool  storeOffsets,
bool  storePositions 
)
pure virtual

Tell the mapper what to expect in regards to field, number of terms, offset and position storage. This method will be called once before retrieving the vector for a field.

This method will be called before Map(String,int,TermVectorOffsetInfo[],int[]).

Parameters
fieldThe field the vector is for
numTermsThe number of terms that need to be mapped
storeOffsetstrue if the mapper should expect offset information
storePositionstrue if the mapper should expect positions info

Implemented in Lucene.Net.Index.ParallelArrayTermVectorMapper, Lucene.Net.Index.SortedTermVectorMapper, Lucene.Net.Index.PositionBasedTermVectorMapper, and Lucene.Net.Index.FieldSortedTermVectorMapper.

Property Documentation

virtual bool Lucene.Net.Index.TermVectorMapper.IsIgnoringOffsets
get

See Also
IsIgnoringPositions()

Same principal as IsIgnoringPositions(), but applied to offsets. false by default.

false

Definition at line 94 of file TermVectorMapper.cs.

virtual bool Lucene.Net.Index.TermVectorMapper.IsIgnoringPositions
get

Indicate to Lucene that even if there are positions stored, this mapper is not interested in them and they can be skipped over. Derived classes should set this to true if they want to ignore positions. The default is false, meaning positions will be loaded if they are stored.

false

Definition at line 85 of file TermVectorMapper.cs.


The documentation for this class was generated from the following file: