Skip to content

Instantly share code, notes, and snippets.

Created January 26, 2015 04:27
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 anonymous/3f07f1bd9f0598bb5a0b to your computer and use it in GitHub Desktop.
Save anonymous/3f07f1bd9f0598bb5a0b to your computer and use it in GitHub Desktop.
Kibana is giving the error -- TypeError: Cannot read property 'length' of undefined -- This is a search generated by kibana for the panel receiving error, it is working for me in the terminal for both remote and local curl requests generating the expected results.
#!/bin/bash
#Dependencies elasticsearch on port 9200,kibana
cd ~ && mkdir KibanaElasticChapOne
wget http://www.elasticsearch.org/guide/en/kibana/current/snippets/shakespeare.json
curl -XPUT localhost:9200/_bulk --data-binary @shakespeare.json
curl -XGET 'localhost:9200/_all/_search?pretty' -d '{
"facets": {
"terms": {
"terms": {
"field": "_type",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment