indexData: experimental ngram map via binary search (#365)
This is an experiment where instead of creating an in memory
representation of the ngram map, we instead lazily read and decode the
data in the search request path.
This uses the fact that we marshal on to disk the ngrams in a sorted
order, so we can binary search it. This requires no changes to how we
marshal, so can be done without re-indexing.
I expect this to be slower, but I am not sure how much slower. But it
will give us good evidence that investing in a better on disk map (ie a
btree or a perfect hash map) would be worthwhile.
It is gated behind the environment variable ZOEKT_ENABLE_NGRAM_BS. I
intend to turn it on in a dogfood cluster to see experimental impact. If
that goes well I'll roll it out to a fraction of our production cluster.
Test Plan: ZOEKT_ENABLE_NGRAM_BS=1 go test ./... and some manual testing
with and without it turned on.