Change default mapping of string to “not analyzed” in Elasticsearch

Just create a template. run curl -XPUT localhost:9200/_template/template_1 -d ‘{ “template”: “*”, “settings”: { “index.refresh_interval”: “5s” }, “mappings”: { “_default_”: { “_all”: { “enabled”: true }, “dynamic_templates”: [ { “string_fields”: { “match”: “*”, “match_mapping_type”: “string”, “mapping”: { “index”: “not_analyzed”, “omit_norms”: true, “type”: “string” } } } ], “properties”: { “@version”: { “type”: “string”, “index”: “not_analyzed” … Read more

How can a Elasticsearch client be notified of a new indexed document?

This is what you’re looking for: https://github.com/ForgeRock/es-change-feed-plugin Using this plugin, you can register to a websocket channel to receive indexation/deletion events as they happen. It has some limitations, though. Back in the days, it was possible to install river plugins to stream documents to ES. The river feature has been removed, but this plugin above … Read more

How to setup ElasticSearch index structure with multiple entity bindings

That’s a great start! I would definitely flatten it all out (i.e. denormalize) and come up with product documents that look like the one below. That way you get rid of the N:M relationship between products and flags by simply creating a flags array for each product. It will thus be easier to query those … Read more

How to force Logstash to reparse a file?

By default logstash writes the position is last was on to a logfile which usually resides in $HOME/.sincedb. Logstash can be fooled into believing it never parsed the logfile by specifying /dev/null as sincedb_path. Here the part of the documentation Input File. Where to write the since database (keeps track of the current position of … Read more

tech