Issue with min,max,mean


(einstein07) #1

Hi,

I have a mapping as below,

{"log_1":{"properties":{"responsetime":
{"index":"analyzed","type":"string"},"responsecode":
{"index":"analyzed","type":"string"},"requesturl":
{"type":"string"},"datetime":{"index":"analyzed","format":"dd/MMM/
yyyy:HH:mm:ss Z","type":"date"},"bytessent":
{"index":"analyzed","type":"string"},"ip":
{"index":"analyzed","type":"string"},"fields":
{"dynamic":"true","properties":{"responsetime":
{"type":"integer"},"responsecode":{"type":"integer"},"requesturl":
{"type":"string"},"datetime":{"format":"dd/MMM/yyyy:HH:mm:ss
Z","type":"date"},"bytessent":{"type":"integer"},"ip":
{"type":"ip"}}}}}}'

When I execute the below query,

{"query":{"match_all":{}},"facets":{"user1":{"date_histogram":
{"field":"timestamp","interval":"second"},"facet_filter":{"and":
[{"range":{"timestamp":{"from":"1313661420000","to":"1413663400000"}}},
{"term":{"text":"m2u"}}]}},"respsize":{"date_histogram":
{"key_field":"timestamp","value_field":"bytessent","interval":"minute"},"facet_filter":
{"and":[{"range":{"timestamp":
{"from":"1313661420000","to":"1413663400000"}}},{"term":
{"text":"m2u"}}]}},"resptime":{"date_histogram":
{"key_field":"timestamp","value_field":"responsetime","interval":"minute"},"facet_filter":
{"and":[{"range":{"timestamp":
{"from":"1213661420000","to":"1313663400000"}}},{"term":
{"text":"m2u"}}]}},"non200":{"date_histogram":
{"key_field":"timestamp","value_field":"responsetime","interval":"minute"},"facet_filter":
{"and":[{"range":{"timestamp":
{"from":"1213661420000","to":"1313663400000"}}},{"bool":{"must_not":
{"term":{"responsecode":"200"}}}}]}}}}

I am not getting the correct results.. what I am getting is Infinity
for min,max fields.

respsize: {
_type: date_histogram
entries: [
{
time: 1314353040000
count: 1629
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
{
time: 1314353220000
count: 40568
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
{
time: 1314353280000
count: 1291
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
{
time: 1314354240000
count: 1719
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
{
time: 1314409740000
count: 311753
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
{
time: 1314409800000
count: 592187
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
]
}

What is that I am missing?


(Shay Banon) #2

Cn you gist a recreation, hard to tell from what you pasted. See
http://www.elasticsearch.org/help.

On Sat, Aug 27, 2011 at 7:06 AM, Srinivas Pinisetti <
srinivas.pinisetti@gmail.com> wrote:

Hi,

I have a mapping as below,

{"log_1":{"properties":{"responsetime":
{"index":"analyzed","type":"string"},"responsecode":
{"index":"analyzed","type":"string"},"requesturl":
{"type":"string"},"datetime":{"index":"analyzed","format":"dd/MMM/
yyyy:HH:mm:ss Z","type":"date"},"bytessent":
{"index":"analyzed","type":"string"},"ip":
{"index":"analyzed","type":"string"},"fields":
{"dynamic":"true","properties":{"responsetime":
{"type":"integer"},"responsecode":{"type":"integer"},"requesturl":
{"type":"string"},"datetime":{"format":"dd/MMM/yyyy:HH:mm:ss
Z","type":"date"},"bytessent":{"type":"integer"},"ip":
{"type":"ip"}}}}}}'

When I execute the below query,

{"query":{"match_all":{}},"facets":{"user1":{"date_histogram":
{"field":"timestamp","interval":"second"},"facet_filter":{"and":
[{"range":{"timestamp":{"from":"1313661420000","to":"1413663400000"}}},
{"term":{"text":"m2u"}}]}},"respsize":{"date_histogram":

{"key_field":"timestamp","value_field":"bytessent","interval":"minute"},"facet_filter":
{"and":[{"range":{"timestamp":
{"from":"1313661420000","to":"1413663400000"}}},{"term":
{"text":"m2u"}}]}},"resptime":{"date_histogram":

{"key_field":"timestamp","value_field":"responsetime","interval":"minute"},"facet_filter":
{"and":[{"range":{"timestamp":
{"from":"1213661420000","to":"1313663400000"}}},{"term":
{"text":"m2u"}}]}},"non200":{"date_histogram":

{"key_field":"timestamp","value_field":"responsetime","interval":"minute"},"facet_filter":
{"and":[{"range":{"timestamp":
{"from":"1213661420000","to":"1313663400000"}}},{"bool":{"must_not":
{"term":{"responsecode":"200"}}}}]}}}}

I am not getting the correct results.. what I am getting is Infinity
for min,max fields.

respsize: {
_type: date_histogram
entries: [
{
time: 1314353040000
count: 1629
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
{
time: 1314353220000
count: 40568
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
{
time: 1314353280000
count: 1291
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
{
time: 1314354240000
count: 1719
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
{
time: 1314409740000
count: 311753
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
{
time: 1314409800000
count: 592187
min: Infinity
max: -Infinity
total: 0
total_count: 0
mean: NaN
}
]
}

What is that I am missing?


(system) #3