github.com/balzaczyy/golucene@v0.0.0-20151210033525-d0be9ee89713/core/index/random.go (about) 1 package index 2 3 import ( 4 . "github.com/balzaczyy/golucene/core/codec/spi" 5 "math/rand" 6 ) 7 8 // Test-only 9 10 // index/RandomCodec.java 11 12 /* 13 Codec that assigns per-field random postings format. 14 15 The same field/format assignment will happen regardless of order, a 16 hash is computed up front that determines the mapping. This means 17 fields can be put into things like HashSets and added to documents 18 in different orders and the tests will still be deterministic and 19 reproducible. 20 */ 21 type RandomCodec struct { 22 *CodecImpl 23 } 24 25 func NewRandomCodec(r *rand.Rand, avoidCodecs map[string]bool) *RandomCodec { 26 panic("not implemented yet") 27 }