Skip to content

Instantly share code, notes, and snippets.

@kostromich
Created August 5, 2016 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kostromich/8e4140d3057cb18c2e200078259adcfc to your computer and use it in GitHub Desktop.
Save kostromich/8e4140d3057cb18c2e200078259adcfc to your computer and use it in GitHub Desktop.
Example ES mapping
PUT es
{
"mappings": {
"ru": {
"dynamic": "strict",
"_all": {
"enabled": true
},
"properties": {
"ARTICLE": {
"type": "string",
"index": "not_analyzed"
},
"CATEGORY": {
"type": "string",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"CATEGORY_ru": {
"type": "string",
"analyzer": "russian",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"CATEGORY_en": {
"type": "string",
"analyzer": "english",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"CATEGORY_de": {
"type": "string",
"analyzer": "german",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"CATEGORY_fr": {
"type": "string",
"analyzer": "french",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"INSERT": {
"type": "nested",
"properties": {
"NAME": {
"type": "string",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"TYPE": {
"type": "string",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"FORM": {
"type": "string",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"COLOR": {
"type": "string",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"PURITY": {
"type": "string",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"QUANTITY": {
"type": "integer"
},
"WEIGHT": {
"type": "double"
}
}
},
"INSERT_ru": {
"type": "nested",
"properties": {
"NAME": {
"type": "string",
"analyzer": "russian",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"TYPE": {
"type": "string",
"analyzer": "russian",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"FORM": {
"type": "string",
"analyzer": "russian",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"COLOR": {
"type": "string",
"analyzer": "russian",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"PURITY": {
"type": "string",
"analyzer": "russian",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"QUANTITY": {
"type": "integer"
},
"WEIGHT": {
"type": "double"
}
}
},
"INSERT_en": {
"type": "nested",
"properties": {
"NAME": {
"type": "string",
"analyzer": "english",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"TYPE": {
"type": "string",
"analyzer": "english",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"FORM": {
"type": "string",
"analyzer": "english",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"COLOR": {
"type": "string",
"analyzer": "english",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"PURITY": {
"type": "string",
"analyzer": "english",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"QUANTITY": {
"type": "integer"
},
"WEIGHT": {
"type": "double"
}
}
},
"INSERT_de": {
"type": "nested",
"properties": {
"NAME": {
"type": "string",
"analyzer": "german",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"TYPE": {
"type": "string",
"analyzer": "german",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"FORM": {
"type": "string",
"analyzer": "german",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"COLOR": {
"type": "string",
"analyzer": "german",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"PURITY": {
"type": "string",
"analyzer": "german",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"QUANTITY": {
"type": "integer"
},
"WEIGHT": {
"type": "double"
}
}
},
"INSERT_fr": {
"type": "nested",
"properties": {
"NAME": {
"type": "string",
"analyzer": "french",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"TYPE": {
"type": "string",
"analyzer": "french",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"FORM": {
"type": "string",
"analyzer": "french",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"COLOR": {
"type": "string",
"analyzer": "french",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"PURITY": {
"type": "string",
"analyzer": "french",
"fields": {
"filter": {
"type": "string",
"index": "not_analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"QUANTITY": {
"type": "integer"
},
"WEIGHT": {
"type": "double"
}
}
},
"DATE_UPDATE": {
"type": "integer"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment