本文整理匯總了Golang中github.com/balzaczyy/golucene/core/store.IndexInput.Clone方法的典型用法代碼示例。如果您正苦於以下問題:Golang IndexInput.Clone方法的具體用法?Golang IndexInput.Clone怎麽用?Golang IndexInput.Clone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/balzaczyy/golucene/core/store.IndexInput
的用法示例。
在下文中一共展示了IndexInput.Clone方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: newFieldReader
func newFieldReader(parent *BlockTreeTermsReader,
fieldInfo *FieldInfo, numTerms int64, rootCode []byte,
sumTotalTermFreq, sumDocFreq int64, docCount int,
indexStartFP int64, longsSize int, indexIn store.IndexInput,
minTerm, maxTerm []byte) (r FieldReader, err error) {
// log.Print("Initializing FieldReader...")
assert(numTerms > 0)
r = FieldReader{
parent: parent,
fieldInfo: fieldInfo,
numTerms: numTerms,
sumTotalTermFreq: sumTotalTermFreq,
sumDocFreq: sumDocFreq,
docCount: docCount,
indexStartFP: indexStartFP,
rootCode: rootCode,
longsSize: longsSize,
minTerm: minTerm,
maxTerm: maxTerm,
}
// log.Printf("BTTR: seg=%v field=%v rootBlockCode=%v divisor=",
// parent.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 = fst.LoadFST(clone, fst.ByteSequenceOutputsSingleton())
}
return r, err
}
示例2: newFieldReader
func newFieldReader(owner *BlockTreeTermsReader,
fieldInfo model.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 = fst.LoadFST(clone, fst.ByteSequenceOutputsSingleton())
}
return r, err
}