Saving only selected fields and not saving _all in pyes / elasticsearch

I am trying to use pyes with elasticsearch as a full-text search engine, I only store UUIDs and string field indexes, the actual data is stored in MonogDB and retrieved using UUIDs. Unfortunately, I cannot create a mapping that will not store the source data, I tried various combinations of the "store" / "source" fields and disabled "_all", but I can still get the text of the indexed fields. The documentation seems to be misleading on this topic, as it is just a copy of the original documents.

Can someone provide a mapping example that only stores some fields and not the original JSON document?

+1
source share
1 answer

Of course, you could use something like this (with two fields: "uuid" and "body"):

{ "mytype" : { "_source" : { "enabled" : false }, "_all" : { "enabled" : false }, "properties" : { "data" : { "store" : "no", "type" : "string" }, "uuid" : { "store" : "yes", "type" : "string", "index" : "not_analyzed" } } } } 
+2
source

All Articles