Stats or Date Histogram query for unindexed fields

ElasticSearch Newbee so kindly consider stupid questions :wink:

lets say I have the following document structure

{
"@timestamp": DDMMYYHHMMSS,
"title": "some test here",
"views": 4
}

and my mapping is

mappings: {

default: {
- -
_all: {
- enabled: false
}
}

mytype: {
- dynamic: "strict"
- -
_all: {
- enabled: false
}
- -
properties: {
- -
@timestamp: {
- type: "date"
- format: "dateOptionalTime"
}
- -
title: {
- type: "string"
}
- -
- -
views: {
- type: "integer"
- index: "no"
}
}
}

}

so basically I don't want to index my views field as I don't want to search
by views, but I want to get stats for this field or get a date histogram,
for example a histogram of the total views over a given time per hour or
per day

my query looks like this
{
"facets": {
"0": {
"date_histogram": {
"key_field": "@timestamp",
"value_field": "views",
"interval": "1y"
},
"global": true,
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"query_string": {
"query": "*"
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

this returns

facets: {

0: {
- _type: "date_histogram"
- -
entries: [
- -
{
- time: 1356998400000
- count: 27339
- min: "Infinity"
- max: "-Infinity"
- total: 0
- total_count: 0
- mean: 0
}
]
}

}

so my question is can I do facet/aggregation querries on fields that are
not indexed ? and if not why not ? isn't indexing supposed to be only for
searching ?

Thanks

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/75539648-c132-4e70-bb72-bb49c6c4e7db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No. You need to index fields of you want to search and compute on those fields.

Le 4 oct. 2014 à 04:25, abid mahmood mabid.mahmood@gmail.com a écrit :

ElasticSearch Newbee so kindly consider stupid questions :wink:

lets say I have the following document structure

{
"@timestamp": DDMMYYHHMMSS,
"title": "some test here",
"views": 4
}

and my mapping is

mappings: {
-default: {
-_all: {
enabled: false
}
}
-mytype: {
dynamic: "strict"
-_all: {
enabled: false
}
-properties: {
-@timestamp: {
type: "date"
format: "dateOptionalTime"
}
-title: {
type: "string"
}

-views: {
type: "integer"
index: "no"
}
}
}
}

so basically I don't want to index my views field as I don't want to search by views, but I want to get stats for this field or get a date histogram, for example a histogram of the total views over a given time per hour or per day

my query looks like this
{
"facets": {
"0": {
"date_histogram": {
"key_field": "@timestamp",
"value_field": "views",
"interval": "1y"
},
"global": true,
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"query_string": {
"query": "*"
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

this returns

facets: {
-0: {
_type: "date_histogram"
-entries: [
-{
time: 1356998400000
count: 27339
min: "Infinity"
max: "-Infinity"
total: 0
total_count: 0
mean: 0
}
]
}
}

so my question is can I do facet/aggregation querries on fields that are not indexed ? and if not why not ? isn't indexing supposed to be only for searching ?

Thanks

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/75539648-c132-4e70-bb72-bb49c6c4e7db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/B758608D-B8B8-4F69-8AA5-E5C469E95C6F%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.