// Create returns a new IndexWriter that will write the index to file. func Create(file string) *IndexWriter { return &IndexWriter{ trigram: sparse.NewSet(1 << 24), nameData: bufCreate(""), nameIndex: bufCreate(""), postIndex: bufCreate(""), main: bufCreate(file), post: make([]postEntry, 0, npost), inbuf: make([]byte, 16384), } }
// Create returns a new IndexWriter that will write the index to file. func Create(file string) *IndexWriter { return &IndexWriter{ // 1 << 24 = 16777216, how many numbers can be represented by 3 uint8_t’s. trigram: sparse.NewSet(1 << 24), nameData: bufCreate(""), nameIndex: bufCreate(""), postIndex: bufCreate(""), main: bufCreate(file), post: make([]postEntry, 0, npost), inbuf: make([]byte, 16384), } }