Geo_shape field not being returned with explicit 'fields' query

Hi all,

I'm trying to query for a particular subset of fields, one of which is a
geo_shape. All of the other fields are returned as expected, aside from
the geo shape
. Here is a trimmed-down version of my mapping:

{
"house": {
"properties": {
"id": {"type": "string"},
"location": {
"properties": {
"geo": {"type": "geo_shape", "store": true},
"address": {"type": "string"}
}
}
}
}
}

And here are some sample queries I've tried:

{
"fields": ["id", "location.address", "location.geo"],
"query": {"match_all": {}}
}

{
"fields": ["id", "location.address", "location.geo.coordinates"],
"query": {"match_all": {}}
}

{
"fields": ["id", "location.address", "_source.location.geo"],
"query": {"match_all": {}}
}

{
"fields": ["id", "location.address", "_all.location.geo"],
"query": {"match_all": {}}
}

The search results always come back with only id and location.address.

Here's a sample document that was returned by a match_all query:

{
"id": "a04db707a0b0c8778abb4a25d92bd1a53801b994",
"location": {
"geo": {
"type": "point",
"coordinates": [-100,40]
},
"address": "123 Fake St."
}
}

Any thoughts on how to get a geo_shape returned? Thanks in advance!

Daniel

--
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/97480273-fa66-4763-819f-50355bc74edb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I have the same problem. It seems that any geo_shape type (envelope, point,
polygon, etc) is ignored if it's listed in the 'fields'.

ES version 1.3.4 on Ubuntu 14.04 using Java(TM) SE Runtime Environment
(build 1.7.0_55-b13)

Mike

On Thursday, August 21, 2014 11:51:37 AM UTC-6, Daniel Sarfati wrote:

Hi all,

I'm trying to query for a particular subset of fields, one of which is a
geo_shape. All of the other fields are returned as expected, aside from
the geo shape
. Here is a trimmed-down version of my mapping:

--
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/221649ae-7ec8-497a-bf12-d5595f9c3dae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Based on this
http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/mapping-geo-shape-type.html#_sorting_and_retrieving_index_shapes,
I suppose the behavior is 'as designed':

"Due to the complex input structure and index representation of shapes, it
is not currently possible to sort shapes or retrieve their fields directly.
The geo_shape value is only retrievable through the _source field."

I haven't tried it, but a workaround might be to only index the geo_shape
value without storing it. But, in another string field, store the value
without analyzing it.

On Thursday, October 16, 2014 11:12:19 PM UTC-6, mdd wrote:

I have the same problem. It seems that any geo_shape type (envelope,
point, polygon, etc) is ignored if it's listed in the 'fields'.

ES version 1.3.4 on Ubuntu 14.04 using Java(TM) SE Runtime Environment
(build 1.7.0_55-b13)

Mike

On Thursday, August 21, 2014 11:51:37 AM UTC-6, Daniel Sarfati wrote:

Hi all,

I'm trying to query for a particular subset of fields, one of which is a
geo_shape. All of the other fields are returned as expected, aside from
the geo shape
. Here is a trimmed-down version of my mapping:

--
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/a7aa124e-a4fe-439c-b302-51b9f75dcdcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.