Disabling key_as_string

Hi,

We're performing some aggregations with size=0 on a lot of data, and I'm
looking to optimise the transfer over the wire. Our responses look like
this:

"buckets": [

  • {
    • "key": 15,
    • "key_as_string": "15",
    • "doc_count": 8183
      },
  • {
    • "key": 100,
    • "key_as_string": "100",
    • "doc_count": 4717
      },
      ...

Obviously, the key_as_string field is adding nothing in this instance. Is
there a way to ask for it to be excluded from the response?

Cheers,
James

--
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/b13ffb0f-9698-4154-bdcf-5b48da79c0e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi James,

This issue was brought up recently in the github issues list[1] and has
been fixed[2]. It should be available in the version 1.3.0.

[1] Aggregations: Histogram Aggregation key Bug · Issue #6655 · elastic/elasticsearch · GitHub

[2] Fixed Histogram key_as_string bug by colings86 · Pull Request #6830 · elastic/elasticsearch · GitHub

Regards,

Colin

On Friday, 1 August 2014 12:22:21 UTC+1, James Griffin wrote:

Hi,

We're performing some aggregations with size=0 on a lot of data, and I'm
looking to optimise the transfer over the wire. Our responses look like
this:

"buckets": [

  • {
    • "key": 15,
    • "key_as_string": "15",
    • "doc_count": 8183
      },
  • {
    • "key": 100,
    • "key_as_string": "100",
    • "doc_count": 4717
      },
      ...

Obviously, the key_as_string field is adding nothing in this instance. Is
there a way to ask for it to be excluded from the response?

Cheers,
James

--
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/636f70bd-5f9b-4b9c-a280-f94afe2939f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Colin,

Thanks for getting back to me so quick. I'm running my query against a
1.3.1 cluster and still seeing "key_as_string", even though no format
parameter is in the query. My query is below:

{
"query": {
"filtered": {
"query": {
"match_all": {}
}
}
},
"aggs": {
"topics": {
"terms": {
"size": 10,
"field": "content.topics"
}
}
}
}

In the mapping, the content.topics field is defined as an integer. The data
was indexed pre-upgrade, though I can't imagine that would make a
difference? Any ideas?

Thanks,
James

On Friday, August 1, 2014 12:40:24 PM UTC+1, Colin Goodheart-Smithe wrote:

Hi James,

This issue was brought up recently in the github issues list[1] and has
been fixed[2]. It should be available in the version 1.3.0.

[1] Aggregations: Histogram Aggregation key Bug · Issue #6655 · elastic/elasticsearch · GitHub

[2] Fixed Histogram key_as_string bug by colings86 · Pull Request #6830 · elastic/elasticsearch · GitHub

Regards,

Colin

On Friday, 1 August 2014 12:22:21 UTC+1, James Griffin wrote:

Hi,

We're performing some aggregations with size=0 on a lot of data, and I'm
looking to optimise the transfer over the wire. Our responses look like
this:

"buckets": [

  • {
    • "key": 15,
    • "key_as_string": "15",
    • "doc_count": 8183
      },
  • {
    • "key": 100,
    • "key_as_string": "100",
    • "doc_count": 4717
      },
      ...

Obviously, the key_as_string field is adding nothing in this instance. Is
there a way to ask for it to be excluded from the response?

Cheers,
James

--
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/1159e4b9-4278-4187-8f78-d404bc73b016%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi,

I dug into that PR and it seems it was solved for histograms but not for
terms aggregations. I presume this is a new bug, then? Are there other
aggregation types this should be solved for?

Thanks,
James

On Friday, August 1, 2014 2:04:52 PM UTC+1, James Griffin wrote:

Hi Colin,

Thanks for getting back to me so quick. I'm running my query against a
1.3.1 cluster and still seeing "key_as_string", even though no format
parameter is in the query. My query is below:

{
"query": {
"filtered": {
"query": {
"match_all": {}
}
}
},
"aggs": {
"topics": {
"terms": {
"size": 10,
"field": "content.topics"
}
}
}
}

In the mapping, the content.topics field is defined as an integer. The
data was indexed pre-upgrade, though I can't imagine that would make a
difference? Any ideas?

Thanks,
James

On Friday, August 1, 2014 12:40:24 PM UTC+1, Colin Goodheart-Smithe wrote:

Hi James,

This issue was brought up recently in the github issues list[1] and has
been fixed[2]. It should be available in the version 1.3.0.

[1] Aggregations: Histogram Aggregation key Bug · Issue #6655 · elastic/elasticsearch · GitHub

[2] Fixed Histogram key_as_string bug by colings86 · Pull Request #6830 · elastic/elasticsearch · GitHub

Regards,

Colin

On Friday, 1 August 2014 12:22:21 UTC+1, James Griffin wrote:

Hi,

We're performing some aggregations with size=0 on a lot of data, and I'm
looking to optimise the transfer over the wire. Our responses look like
this:

"buckets": [

  • {
    • "key": 15,
    • "key_as_string": "15",
    • "doc_count": 8183
      },
  • {
    • "key": 100,
    • "key_as_string": "100",
    • "doc_count": 4717
      },
      ...

Obviously, the key_as_string field is adding nothing in this instance.
Is there a way to ask for it to be excluded from the response?

Cheers,
James

--
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/15a97dd3-b3cf-46ea-a117-d0f7648b3c47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sorry, I assumed you were using the histogram aggregation. It was this
aggregation that the fixed was applied to. I have opened issue #7125
https://github.com/elasticsearch/elasticsearch/issues/7125 to resolve
this in the terms aggregation.

On Friday, 1 August 2014 14:04:52 UTC+1, James Griffin wrote:

Hi Colin,

Thanks for getting back to me so quick. I'm running my query against a
1.3.1 cluster and still seeing "key_as_string", even though no format
parameter is in the query. My query is below:

{
"query": {
"filtered": {
"query": {
"match_all": {}
}
}
},
"aggs": {
"topics": {
"terms": {
"size": 10,
"field": "content.topics"
}
}
}
}

In the mapping, the content.topics field is defined as an integer. The
data was indexed pre-upgrade, though I can't imagine that would make a
difference? Any ideas?

Thanks,
James

On Friday, August 1, 2014 12:40:24 PM UTC+1, Colin Goodheart-Smithe wrote:

Hi James,

This issue was brought up recently in the github issues list[1] and has
been fixed[2]. It should be available in the version 1.3.0.

[1] Aggregations: Histogram Aggregation key Bug · Issue #6655 · elastic/elasticsearch · GitHub

[2] Fixed Histogram key_as_string bug by colings86 · Pull Request #6830 · elastic/elasticsearch · GitHub

Regards,

Colin

On Friday, 1 August 2014 12:22:21 UTC+1, James Griffin wrote:

Hi,

We're performing some aggregations with size=0 on a lot of data, and I'm
looking to optimise the transfer over the wire. Our responses look like
this:

"buckets": [

  • {
    • "key": 15,
    • "key_as_string": "15",
    • "doc_count": 8183
      },
  • {
    • "key": 100,
    • "key_as_string": "100",
    • "doc_count": 4717
      },
      ...

Obviously, the key_as_string field is adding nothing in this instance.
Is there a way to ask for it to be excluded from the response?

Cheers,
James

--
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/eba1e62b-553c-406a-9434-7d359f0dc9e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cracking, thanks Colin

On Friday, August 1, 2014 3:28:45 PM UTC+1, Colin Goodheart-Smithe wrote:

Sorry, I assumed you were using the histogram aggregation. It was this
aggregation that the fixed was applied to. I have opened issue #7125
https://github.com/elasticsearch/elasticsearch/issues/7125 to resolve
this in the terms aggregation.

On Friday, 1 August 2014 14:04:52 UTC+1, James Griffin wrote:

Hi Colin,

Thanks for getting back to me so quick. I'm running my query against a
1.3.1 cluster and still seeing "key_as_string", even though no format
parameter is in the query. My query is below:

{
"query": {
"filtered": {
"query": {
"match_all": {}
}
}
},
"aggs": {
"topics": {
"terms": {
"size": 10,
"field": "content.topics"
}
}
}
}

In the mapping, the content.topics field is defined as an integer. The
data was indexed pre-upgrade, though I can't imagine that would make a
difference? Any ideas?

Thanks,
James

On Friday, August 1, 2014 12:40:24 PM UTC+1, Colin Goodheart-Smithe wrote:

Hi James,

This issue was brought up recently in the github issues list[1] and has
been fixed[2]. It should be available in the version 1.3.0.

[1] Aggregations: Histogram Aggregation key Bug · Issue #6655 · elastic/elasticsearch · GitHub

[2] Fixed Histogram key_as_string bug by colings86 · Pull Request #6830 · elastic/elasticsearch · GitHub

Regards,

Colin

On Friday, 1 August 2014 12:22:21 UTC+1, James Griffin wrote:

Hi,

We're performing some aggregations with size=0 on a lot of data, and
I'm looking to optimise the transfer over the wire. Our responses look like
this:

"buckets": [

  • {
    • "key": 15,
    • "key_as_string": "15",
    • "doc_count": 8183
      },
  • {
    • "key": 100,
    • "key_as_string": "100",
    • "doc_count": 4717
      },
      ...

Obviously, the key_as_string field is adding nothing in this instance.
Is there a way to ask for it to be excluded from the response?

Cheers,
James

--
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/6a7bdf43-6658-4cfd-8b85-efc91cf9d21e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.