Hi,
I have been trying to use the following query to get data back, sorted by @timestamp:
var my_indices=["news","oct", "finance", "othernews","bing","reports","fda",
"research","twitter","facebook","indeed","discussion","craigslist","jobs", "newsfeed"];
query = {
size: 1000,
from: 1,
"query": {
"indices": {
"indices":my_indices,
"query": {
"query_string": {
"query": event.term,
"default_operator":"OR"
}
},
"no_match_query": "none"
}
},
"aggs": {
"types": {
"terms": {
"field": "datasource",
size:0
}
}
},
"sort" : [
{ "@timestamp" : {"order" : "desc"}
}
]
};
This is the error, I get though (I am using AWS ElasticSearch with ES version 1.5):
{"took":324,"timed_out":false,"_shards":{"total":426,"successful":425,"failed":1,"failures":[{"index":".kibana-4","shard":0,"status":400,"reason":"SearchParseException[[.kibana-4][0]: query[MatchNoDocsQuery],from[1],size[1000]: Parse Failure [Failed to parse source [{\"size\":1000,\"from\":1,\"query\":{\"indices\":{\"indices\":[\"news\",\"oct\",\"finance\",\"othernews\",\"bing\",\"reports\",\"fda\",\"research\",\"twitter\",\"facebook\",\"indeed\",\"discussion\",\"craigslist\",\"jobs\"],\"query\":{\"query_string\":{\"query\":\"my search term\",\"default_operator\":\"OR\"}},\"no_match_query\":\"none\"}},\"aggs\":{\"types\":{\"terms\":{\"field\":\"datasource\",\"size\":0}}},\"sort\":[{\"@timestamp\":{\"order\":\"desc\"}}]}]]]; nested: SearchParseException[[.kibana-4][0]: query[MatchNoDocsQuery],from[1],size[1000]: Parse Failure [No mapping found for [@timestamp] in order to sort on]]; "}]},"hits":{"total":4177,"max_score":nu ...
Based on what was suggested on this post , I tired both of the following:
- Adding "ignore_unmapped" : true
- Adding "unmapped_type" : "long"
Both of which get rid of the error, but the results that come back are still not sorted.
I have some questions here:
-
ElasticSearch is trying to search within .kibana-4 index, while I have explicitly specified the indices it should search and set "no_match_query"to"none". How is that happening? Am I missing something?
-
Is there any other way for me to explicitly eliminate searching within Kibana index?
-
What else can I do to get this query to work?
I truly appreciate any help.
Thanks