Hello i have alike problem. After i finally instaled and ran x-pack. I stuck on index problem. I use PL/SQL to create json from DB data. After i create whole json document i send it via HTTP POST to REST.
http://elastic:changeme@our_server:port/spm/spm-order/29289
json:
{
"primaryKey": 29289,
"orderVersion": 1,
"note": "Objednávka z SPM (messageId=ParallelOrderTest-jenkins-7071c0e7-f71f-4791-8ffa-5b5784c3e3fc): crmOrderId=ParallelOrderTest_TS7LJN4QI, technicalOrderId=ParallelOrderTest_TS7LJN4QM-pool-1-thread-90, "
"offerId": null,
"serviceId": null,
"orderAction": "ADD",
"crmOrderId": "ParallelOrderTest_TS7LJN4QI",
"technicalOrderId": "ParallelOrderTest_TS7LJN4QM-pool-1-thread-90",
"priority": 3,
"operator": "O2_CZ",
"cacRefNo": "5900000461",
"dateCreated": "02.12.2016 09:25:44",
"dateNeeded": null,
"dateRealization": null,
"lastModifTs": null,
"objednatelIco": "x2579555",
"objednatelName": "Michal Pavlusek",
"serviceItem": [{
"akce": "ADD",
"hlavniAtribut": "TARIFF_FREE_EU_D_L",
"processId": 91762,
"spmId": 311168,
"parentSpmId": 304928,
"productInstanceId": "TS7LJN4QL-pool-1-thread-90",
"crossId": null,
"serviceOrderId": 29289,
"parentServiceItemId": null,
"state": "ACTIVE",
"active": "PROJECT",
"specClassifier": "TARIFF_SPACE",
"tariffSpaceAttribut": "TARIFF_FREE_EU_D_L",
"specNazev": "TariffSpace",
"specProductCode": "TARIFF_SPACE",
"specProductCategory": "TARIFF_SPACE",
"ktt": {},
"serviceItemParam": []
}]
}
mapping:
{
"settings": {
"number_of_shards": "1",
"number_of_replicas": "1",
"index": {
"analysis": {
"analyzer": {
"lowerCaseCzechAnalyzer": {
"type": "custom",
"filter": [
"trim",
"czech_stop_words",
"czech_standard",
"lowercase"
],
"tokenizer": "keyword"
}
},
"filter": {
"czech_stop_words": {
"type": "stop",
"stopwords": [
"_czech_"
]
},
"custom_word_delimiter": {
"preserve_original": "true",
"type": "word_delimiter"
},
"czech_standard": {
"type": "standard",
"name": "czech"
}
}
},
"mapper": {
"dynamic": "false"
}
}
},
"mappings": {
"spm-order": {
"properties": {
"cacRefNo": {
"type": "keyword",
"store": true
},
"crmOrderId": {
"type": "text",
"analyzer": "lowerCaseCzechAnalyzer",
"store": true
},
"dateCreated": {
"type": "date",
"format": "dd.MM.yyyy HH:mm:ss",
"store": true
},
"dateNeeded": {
"type": "date",
"format": "dd.MM.yyyy HH:mm:ss"
},
"dateRealization": {
"type": "date",
"format": "dd.MM.yyyy HH:mm:ss"
},
"lastModifTs": {
"type": "date",
"format": "dd.MM.yyyy HH:mm:ss"
},
"note": {
"type": "text",
"analyzer": "lowerCaseCzechAnalyzer"
},
"offerId": {
"type": "keyword",
"store": true
},
"operator": {
"type": "keyword"
},
"orderAction": {
"type": "keyword",
"store": true
},
"primaryKey": {
"type": "long",
"store": true
},
"priority": {
"type": "short",
"store": true
},
"serviceId": {
"type": "keyword",
"store": true,
"fields": {
"text": {
"type": "text"
}
}
},
"objednatelIco": {
"type": "keyword"
},
"objednatelName": {
"type": "keyword"
},
"serviceItem": {
"type": "nested",
"properties": {
"active": {
"type": "keyword",
"store": true
},
"akce": {
"type": "keyword",
"store": true
},
"crossId": {
"type": "keyword",
"store": true
},
"hlavniAtribut": {
"type": "keyword",
"store": true
},
"parentServiceItemId": {
"type": "long",
"store": true,
"fields": {
"text": {
"type": "text"
}
}
},
"parentSpmId": {
"type": "long",
"fields": {
"text": {
"type": "text"
}
}
},
"processId": {
"type": "long"
},
"productInstanceId": {
"type": "keyword"
},
"serviceAssoc": {
"type": "nested",
"properties": {
"classifier": {
"type": "keyword"
},
"serviceAssocId": {
"type": "long"
},
"serviceInstanceId": {
"type": "long"
}
}
},
"serviceItemParam": {
"type": "nested",
"properties": {
"paramNazevValue": {
"type": "keyword",
"store": true
}
}
},
"basicServiceAttribut": {
"type": "keyword",
"store": true
},
"technologyPointAttribut": {
"type": "keyword",
"store": true
},
"specNazev": {
"type": "keyword",
"store": true
},
"specProductCategory": {
"type": "keyword",
"store": true
},
"specProductCode": {
"type": "keyword",
"store": true
},
"spmId": {
"type": "long",
"store": true,
"fields": {
"text": {
"type": "text"
}
}
},
"state": {
"type": "keyword",
"store": true
}
}
},
"statusId": {
"type": "long"
},
"technicalOrderId": {
"type": "keyword",
"store": true
}
}
}
}
}
If i get
status code: 400 content: {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse, document is empty"}],"type":"mapper_parsing_exception","reason":"failed to parse, document is empty"},"status":400} json: ....
when i copy JSON and post it via kibana dev tools it's works fine.