本文整理汇总了Golang中github.com/balzaczyy/golucene/store.IndexInput.Clone方法的典型用法代码示例。如果您正苦于以下问题:Golang IndexInput.Clone方法的具体用法?Golang IndexInput.Clone怎么用?Golang IndexInput.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/balzaczyy/golucene/store.IndexInput
的用法示例。
在下文中一共展示了IndexInput.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: newFieldReader
func newFieldReader(owner *BlockTreeTermsReader,
fieldInfo FieldInfo, numTerms int64, rootCode []byte,
sumTotalTermFreq, sumDocFreq int64, docCount int32, indexStartFP int64,
indexIn store.IndexInput) (r FieldReader, err error) {
log.Print("Initializing FieldReader...")
if numTerms <= 0 {
panic("assert fail")
}
// assert numTerms > 0
r = FieldReader{
BlockTreeTermsReader: owner,
fieldInfo: fieldInfo,
numTerms: numTerms,
sumTotalTermFreq: sumTotalTermFreq,
sumDocFreq: sumDocFreq,
docCount: docCount,
indexStartFP: indexStartFP,
rootCode: rootCode,
}
log.Printf("BTTR: seg=%v field=%v rootBlockCode=%v divisor=",
owner.segment, fieldInfo.name, rootCode)
in := store.NewByteArrayDataInput(rootCode)
n, err := in.ReadVLong()
if err != nil {
return r, err
}
r.rootBlockFP = int64(uint64(n) >> BTT_OUTPUT_FLAGS_NUM_BITS)
if indexIn != nil {
clone := indexIn.Clone()
log.Printf("start=%v field=%v", indexStartFP, fieldInfo.name)
clone.Seek(indexStartFP)
r.index, err = util.LoadFST(clone, util.ByteSequenceOutputsSingleton())
}
return r, err
}