From df6c8f4074f45a4c5375383cf0c2e444e8fba0b6 Mon Sep 17 00:00:00 2001 From: Steve Yen Date: Wed, 20 Dec 2017 10:06:50 -0800 Subject: [PATCH] scorch added kvconfig unsafe_batch option Added an option to the kvconfig JSON, called "unsafe_batch" (bool). Default is false, so Batch() calls are synchronously persisted by default. Advanced users may want to unsafe, asynchronous persistence to tradeoff performance (mutations are queryable sooner) over safety. { "index_type": "scorch", "kvconfig": { "unsafe_batch": true } } This change replaces the previous kvstore=="moss" workaround. --- index/scorch/scorch.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index/scorch/scorch.go b/index/scorch/scorch.go index 9484920f..d72a8f88 100644 --- a/index/scorch/scorch.go +++ b/index/scorch/scorch.go @@ -81,9 +81,9 @@ func NewScorch(storeName string, config map[string]interface{}, analysisQueue *i if ok { rv.readOnly = ro } - // hack for now to disable safe batches in FTS - if storeName == "moss" { - rv.unsafeBatch = true + ub, ok := config["unsafe_batch"].(bool) + if ok { + rv.unsafeBatch = ub } return rv, nil }