Skip to content

Instantly share code, notes, and snippets.

@jan-kran
Last active January 10, 2020 15:09
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 jan-kran/0cca0e779b4ee826cd7485008cb68eb7 to your computer and use it in GitHub Desktop.
Save jan-kran/0cca0e779b4ee826cd7485008cb68eb7 to your computer and use it in GitHub Desktop.
Elasticsearch sample data
DELETE index
PUT index
{
"settings": {
"index": {
"number_of_shards": "5",
"number_of_replicas": "1"
}
},
"mappings": {
"pim_catalog_product": {
"dynamic_templates": [
{
"date_scopable_localizable_structure": {
"path_match": "values.*-date.*",
"match_mapping_type": "object",
"mapping": {
"type": "object"
}
}
},
{
"date": {
"path_match": "values.*-date.*",
"mapping": {
"type": "date"
}
}
},
{
"option_scopable_localizable_structure": {
"path_match": "values.*-option.*",
"match_mapping_type": "object",
"mapping": {
"type": "object"
}
}
},
{
"option": {
"path_match": "values.*-option.*",
"mapping": {
"normalizer": "attribute_option_normalizer",
"type": "keyword"
}
}
}
],
"properties": {
"created": {
"type": "date"
},
"id": {
"type": "keyword"
},
"identifier": {
"type": "keyword"
},
"values": {
"properties": {
"description_created-date": {
"properties": {
"<all_channels>": {
"properties": {
"<all_locales>": {
"type": "date"
}
}
}
}
},
"footwear_size-option": {
"properties": {
"<all_channels>": {
"properties": {
"<all_locales>": {
"type": "keyword"
}
}
}
}
}
}
}
}
}
}
}
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.5.0
environment:
- discovery.type=single-node
ports:
- 9200:9200
kibana:
image: docker.elastic.co/kibana/kibana:6.5.0
ports:
- 5601:5601
PUT index/pim_catalog_product/bbb_2255444
{
"id": "2838",
"identifier": "bbb_2255444",
"created": "2019-12-05T11:34:36+00:00",
"values": {
"footwear_size-option": {
"<all_channels>": {
"<all_locales>": "42"
}
},
"description_created-date": {
"<all_channels>": {
"<all_locales>": "2019-12-19"
}
}
}
}
PUT index/pim_catalog_product/bbb_99112
{
"id": "2131",
"identifier": "bbb_99112",
"created": "2019-12-05T11:34:36+00:00",
"values": {
"footwear_size-option": {
"<all_channels>": {
"<all_locales>": "40"
}
},
"description_created-date": {
"<all_channels>": {
"<all_locales>": "2019-12-06"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment