Skip to content

Commit

Permalink
documenting mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlath committed Aug 22, 2016
1 parent 47ccccc commit db88b28
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit db88b28

Please sign in to comment.