Non sigsegging indexing code that takes in options from JS about how to index each field, needs an API to support that on JS side of course