github.com/balzaczyy/golucene@v0.0.0-20151210033525-d0be9ee89713/core/codec/spi/postingsReaderBase.go (about) 1 package spi 2 3 import ( 4 . "github.com/balzaczyy/golucene/core/index/model" 5 "github.com/balzaczyy/golucene/core/store" 6 "github.com/balzaczyy/golucene/core/util" 7 "io" 8 ) 9 10 // PostingReaderBase.java 11 12 /* 13 The core terms dictionaries (BlockTermsReader, 14 BlockTreeTermsReader) interacts with a single instnce 15 of this class to manage creation of DocsEnum and 16 DocsAndPositionsEnum instances. It provides an 17 IndexInput (termsIn) where this class may read any 18 previously stored data that it had written in its 19 corresponding PostingsWrierBase at indexing 20 time. 21 */ 22 type PostingsReaderBase interface { 23 io.Closer 24 /** Performs any initialization, such as reading and 25 * verifying the header from the provided terms 26 * dictionary {@link IndexInput}. */ 27 Init(termsIn store.IndexInput) error 28 /** Return a newly created empty TermState */ 29 NewTermState() *BlockTermState 30 /** Actually decode metadata for next term */ 31 DecodeTerm([]int64, util.DataInput, *FieldInfo, *BlockTermState, bool) error 32 /** Must fully consume state, since after this call that 33 * TermState may be reused. */ 34 Docs(fieldInfo *FieldInfo, state *BlockTermState, skipDocs util.Bits, reuse DocsEnum, flags int) (de DocsEnum, err error) 35 // docsAndPositions(fieldInfo FieldInfo, state BlockTermState, skipDocs util.Bits) 36 }