1

I am trying to use pyes with elasticsearch as full text search engine, I store only UUIDs and indexes of string fields, actual data is stored in MonogDB and retrieved using UUIDs. Unfortunately, I am unable to create a mapping that wouldn't store original data, I've tried various combinations of "store"/"source" fields and disabling "_all" but I can still get text of indexed fields. It seems that documentation is misleading on this topic as it's just a copy of original docs.

Can anyone please provide an example of mapping that would only store some fields and not the original document JSON?

Riz
  • 817
  • 1
  • 8
  • 21

1 Answers1

2

Sure, 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"
      }
    }
  }
}
thnetos
  • 1,316
  • 10
  • 9
  • Thank you, after checking your example, documentation and docs I was able to spot my error: 1. I was missing _content field, 2. I've missed the properties key and was having special field on the same level as my custom ones. – Riz Sep 18 '12 at 18:12