Hello Team ,
i have a large json file which has nested kind of, the start of json file has array. when i a writing a search query i am getting error as Unknown key for a START_ARRAY
parsing issue.
any suggestions to solve this
Hello Team ,
i have a large json file which has nested kind of, the start of json file has array. when i a writing a search query i am getting error as Unknown key for a START_ARRAY
parsing issue.
any suggestions to solve this
It indicates most likely a wrong json.
Hard to tell more without an example.
This is sample json format looks like as below
{
"test": [
{
" name":" vinay",
"location":"india"
},
{
"name":"kumar",
"location":"india2",
"contactdetails":[
{
"phone":"1234",
"address":"hyd"
}
]
}
]
}
This works well:
DELETE test
POST test/_doc
{
"test": [
{
" name": " vinay",
"location": "india"
},
{
"name": "kumar",
"location": "india2",
"contactdetails": [
{
"phone": "1234",
"address": "hyd"
}
]
}
]
}
It gives:
{
"_index" : "test",
"_type" : "_doc",
"_id" : "bVTOv3EBJjDNjw2CIKRe",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 2,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1
}
Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.
A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.
It worked..Thanks for help..
on this json ia trying to write a match query based on filed, but i am not getting results..
query :
{
"query": {
"bool": {
"must": [
{ "match": { "name": "kumar" }},
{ "match": { "location": "india2" }}
]
}
}
}
expected output :
{
"name": "kumar",
"location": "india2",
"contactdetails": [
{
"phone": "1234",
"address": "hyd"
}
]
}
is it possible ? because i have everything on one document
Please format your code, logs or configuration files using </>
icon as explained in this guide and not the citation button. It will make your post more readable.
Or use markdown style like:
```
CODE
```
This is the icon to use if you are not using markdown format:
There's a live preview panel for exactly this reasons.
Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.
Yeah. May be with the nested
document feature. But the question is more: why are you putting all that in the same document?
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.