This is business log stat app in development.
I used version of elasticsearch is 0.90.1
$curl -XGET 'http://192.168.11.107:9200/'
{
"ok" : true,
"status" : 200,
"name" : "Ape",
"version" : {
"number" : "0.90.1",
"snapshot_build" : false,
"lucene_version" : "4.3"
},
"tagline" : "You Know, for Search"
}
And Mapping is simple except time filed is a dateOptionalTime
$ curl -XGET 'http://192.168.11.107:9200/syslog/syslog/_mapping?pretty'
{
"syslog" : {
"properties" : {
"facility" : {
"type" : "string"
},
"hostname" : {
"type" : "string"
},
"id" : {
"type" : "string"
},
"message" : {
"type" : "string"
},
"serverity" : {
"type" : "long"
},
"tag" : {
"type" : "string"
},
"time" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"type" : {
"type" : "string"
}
}
}
}
There is some example data,I use ISO dateformat:
$ curl -XGET http://192.168.11.107:9200/syslog/syslog/_search?pretty= -d '
{
"from": 0,
"size": 2,
"query": {
"match_all": {
}
}
}'
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 100020,
"max_score" : 1.0,
"hits" : [ {
"_index" : "syslog",
"_type" : "syslog",
"_id" : "6242157e-755c-4996-8219-c9b9458a5a26",
"_score" : 1.0, "_source" :
{"id":"6242157e-755c-4996-8219-c9b9458a5a26","facility":"test","serverity":6,"time":"2013-06-15T00:00:00","hostname":"127.0.0.1","tag":"test","message":"hello
there,1371225600548","type":"com.broadwave.service.log.Log"}
}, {
"_index" : "syslog",
"_type" : "syslog",
"_id" : "bf1739f5-93eb-40b8-958d-f27315f9bb7e",
"_score" : 1.0, "_source" :
{"id":"bf1739f5-93eb-40b8-958d-f27315f9bb7e","facility":"test","serverity":6,"time":"2013-06-15T00:00:00","hostname":"127.0.0.1","tag":"test","message":"hello
there,1371225600551","type":"com.broadwave.service.log.Log"}
} ]
}
}
And I meet problem when I use "Web front-end over elasticsearch data" list
in Elasticsearch client page. I encounter exception on time field.
curl -XGET http://192.168.11.107:9200/syslog/syslog/_search?pretty= -d '
{
"facets": {
"time": {
"date_histogram": {
"field": "time",
"interval": "hour"
}
}
}
}'
[2013-06-15 17:42:41,781][DEBUG][action.search.type ] [Ape]
[syslog][1], node[yn3er67mTN2lIGO7r8uXjw], [P], s[STARTED]: Failed to
execute [org.elasticsearch.action.search.SearchRequest@3cc95a]
org.elasticsearch.search.SearchParseException: [syslog][1]:
query[ConstantScore(:)],from[0],size[100]: Parse Failure [Failed to parse
source [
{
"from": 0,
"size": 100,
"query": {
"match_all": {
}
},
"facets": {
"time": {
"date_histogram": {
"field": "time",
"interval": "hour"
}
}
}
}]]
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:573)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:484)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:469)
at
org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:462)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:206)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:193)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:179)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassCastException:
org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be
cast to org.elasticsearch.index.fielddata.IndexNumericFieldData
at
org.elasticsearch.search.facet.datehistogram.DateHistogramFacetParser.parse(DateHistogramFacetParser.java:162)
at
org.elasticsearch.search.facet.FacetParseElement.parse(FacetParseElement.java:92)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:561)
... 12 more
Am I do something wrong?
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.