Indexing a JSON file as an object field without parsing it


(Francisco Gomez) #1

Hello,
this is my first time trying out ES and I have a question about indexing JSON objects.

I need to index some very large JSON files which in truth I have not much control over the content of it. The idea is to map a couple of other properties along side the JSON structure.
I'm having issues trying to map it or even index one of the files given the unruly structure of the JSON files.

Basically, what I need is to somehow ignore the JSON parser in this property so it's not indexed as JSON.

This is an example of the mapping I'm trying to make

{
   "mappings": {
      "page": {
         "properties" : {
            "pageId": {
               "type": "keyword"
            },
            "pageType": {
               "type": "keyword"
            },
            "site": {
               "type": "keyword"
            },
            "creationDate": {
               "type": "date"
            },
            "updateDate": {
               "type": "date"
            },
            "jsonInfo": {
               "type": "object"
            }
         }
      }
   }
}

I've tried setting the property as "enabled: false" but I'm still getting Illegal Argument Exceptions.

Thanks!