From db88b28779cacc303d2dfe3190ab25c7bd741b50 Mon Sep 17 00:00:00 2001 From: maxlath Date: Mon, 22 Aug 2016 21:49:30 +0200 Subject: [PATCH] documenting mapper --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 4f94025..6ef3fae 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,25 @@ To keep a sync process going, run couch2elastic4sync ``` +### Format and filter documents + +A `mapper` function can be passed from the config to format documents before being put to ElasticSearch: +```ini +database=http://localhost:5984/idx-edm-v5 +elasticsearch=http://elastic-1.com:9200/idx-edm-v5/listing +mapper=path/to/my-mapper.js +``` + +Where my-mapper.js could be something like +``` +module.exports = function (doc) { + // apply formatting here + return doc +} +``` + +If the function returns empty, the document is filtered-out + ## License MIT