64 MB worth of post entries Create returns a new IndexWriter that will write the index to file.
(file string)
| 59 | |
| 60 | // Create returns a new IndexWriter that will write the index to file. |
| 61 | func Create(file string) *IndexWriter { |
| 62 | return &IndexWriter{ |
| 63 | trigram: sparse.NewSet(1 << 24), |
| 64 | nameData: bufCreate(""), |
| 65 | nameIndex: bufCreate(""), |
| 66 | postIndex: bufCreate(""), |
| 67 | main: bufCreate(file), |
| 68 | post: make([]postEntry, 0, npost), |
| 69 | inbuf: make([]byte, 16384), |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | // A postEntry is an in-memory (trigram, file#) pair. |
| 74 | type postEntry uint64 |
searching dependent graphs…