我在elasticsearch中使用以下映射创建了索引:
PUT my_master
{
"mappings": {
"documents": {
"properties": {
"fields": {
"type": "nested",
"properties": {
"uid": {
"type": "keyword"
},
"value": {
"type": "text",
"copy_to": "fulltext",
"fields": {
"raw": {
"type": "keyword",
"ignore_above": 32766
}
}
}
}
},
"fulltext": {
"type": "text"
}
}
}
}
}
在其中添加了一个文档:
POST my_master/documents/1/_create
{
"fields": [
{
"uid": "number",
"value": 111111111111111000000000000001100000000000000
}
]
}
添加后,我正在使用更新API更新文档:
POST my_master/documents/1/_update
{
"doc":{
"fields": [
{
"uid": "number",
"value": 1111111111111110000000000000011000000000000000
}
]
}}
但是Elasticsearch在更新文档时给了我以下错误:
cannot write xcontent for unknown value of type class java.math.BigInteger
请在这里帮助我吗?怎么了如何解决这个问题?
答案 0 :(得分:0)
根据映射,我希望您将值作为字符串发送,因此我认为这可能有效: “ 1111111111111110000000000000011000000000000000”