Read nested documents not as expected

Hi,

we have a problem to read nested documents (example here localized_data),
which we mapped as follows.

mapping :
{
"generic": { "_id": { "path": "id" },
"_source" : { "enabled" : false },
"properties": {
"p_id": { "type": "long", "store": "yes" },
"p_type_id": { "type": "long", "store": "yes" },
"localized_data": {
"type": "nested",
"include_in_root" : "true",
"properties": {
"l_id": { "type": "string", "store": "yes" },
"title": { "type": "string", "store": "yes" },
"description": { "type": "string", "store": "yes" },
"artists": { "type": "string", "store": "yes" }
}
}
}
}
}

is there any way to read the nested documents as related objects
e.g.:
first nested document:

localized_data.l_id = "1" ,

localized_data.title = "test1"

localized_data.description = "desc1

localized_data.artists = "artiist1"

second nested document:

localized_data.l_id = "2" ,

localized_data.title = "test2"

localized_data.description = "desc2

localized_data.artists = "artiist2"

actually we get the values as arrays

localized_data.l_id = [1,2], localized_data.title = [test1,test2],
localized_data.description = [desc1,desc2], localized_data.artists =
[artiist1,artiist2]

we cannot assign the l_id to the title from the result, because we get
separated arrays for each field.
is there a way to get the nested information for each nested document
separately?
we make a matchAll query, no nested search query.

suggestions?

thx
halit

--
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.

I never worked with source disabled and nested documents, but can you store
the localized_data field? That should return an array of objects.

--
Ivan

On Thu, Jul 4, 2013 at 4:17 AM, Halit Cimen halit.cimen@gmail.com wrote:

Hi,

we have a problem to read nested documents (example here localized_data),
which we mapped as follows.

mapping :
{
"generic": { "_id": { "path": "id" },
"_source" : { "enabled" : false },
"properties": {
"p_id": { "type": "long", "store": "yes" },
"p_type_id": { "type": "long", "store": "yes" },
"localized_data": {
"type": "nested",
"include_in_root" : "true",
"properties": {
"l_id": { "type": "string", "store": "yes" },
"title": { "type": "string", "store": "yes" },
"description": { "type": "string", "store": "yes" },
"artists": { "type": "string", "store": "yes" }
}
}
}
}
}

is there any way to read the nested documents as related objects
e.g.:
first nested document:

localized_data.l_id = "1" ,

localized_data.title = "test1"

localized_data.description = "desc1

localized_data.artists = "artiist1"

second nested document:

localized_data.l_id = "2" ,

localized_data.title = "test2"

localized_data.description = "desc2

localized_data.artists = "artiist2"

actually we get the values as arrays

localized_data.l_id = [1,2], localized_data.title = [test1,test2],
localized_data.description = [desc1,desc2], localized_data.artists =
[artiist1,artiist2]

we cannot assign the l_id to the title from the result, because we get
separated arrays for each field.
is there a way to get the nested information for each nested document
separately?
we make a matchAll query, no nested search query.

suggestions?

thx
halit

--
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.

--
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.

yes, we can store the localized_data field,
but we disabled the _source field, because it is not indexed (searchable,
just stored). (as described here
http://www.elasticsearch.org/guide/reference/mapping/source-field/)
it is only overhead, that we do not want

... That should return an array of objects.

unfortunately, it not returns an array of object.

if we make a search request with :

   String[] field = new String[] {"*"};
   QueryBuilder qb = QueryBuilders.matchQuery(p_ID,"2282104");
           SearchResponse response = 

node.client().prepareSearch("index_name")
.setSearchType(SearchType.DEFAULT) .setQuery(qb)
.addFields( field) .setSize(1000).execute().actionGet();

SearchHit
csb_dc_list - [182:12, 182:13]
p_id - [2282104]
localized_data.title - [Tre Amiche, 3 Gatas quentes, 3 Hot Girls, 3 heiße
Mädels]
p_type_id - [9]
localized_data.locale_id - [292, 433, 0, 290]

as you see the fields of localized_data are returned as arrays.
but we want get an array of localized_data objects.

Am Freitag, 5. Juli 2013 17:16:07 UTC+2 schrieb Ivan Brusic:

I never worked with source disabled and nested documents, but can you
store the localized_data field? That should return an array of objects.

--
Ivan

On Thu, Jul 4, 2013 at 4:17 AM, Halit Cimen <halit...@gmail.com<javascript:>

wrote:

Hi,

we have a problem to read nested documents (example here localized_data),
which we mapped as follows.

mapping :
{
"generic": { "_id": { "path": "id" },
"_source" : { "enabled" : false },
"properties": {
"p_id": { "type": "long", "store": "yes" },
"p_type_id": { "type": "long", "store": "yes" },
"localized_data": {
"type": "nested",
"include_in_root" : "true",
"properties": {
"l_id": { "type": "string", "store": "yes" },
"title": { "type": "string", "store": "yes" },
"description": { "type": "string", "store": "yes" },
"artists": { "type": "string", "store": "yes" }
}
}
}
}
}

is there any way to read the nested documents as related objects
e.g.:
first nested document:

localized_data.l_id = "1" ,

localized_data.title = "test1"

localized_data.description = "desc1

localized_data.artists = "artiist1"

second nested document:

localized_data.l_id = "2" ,

localized_data.title = "test2"

localized_data.description = "desc2

localized_data.artists = "artiist2"

actually we get the values as arrays

localized_data.l_id = [1,2], localized_data.title = [test1,test2],
localized_data.description = [desc1,desc2], localized_data.artists =
[artiist1,artiist2]

we cannot assign the l_id to the title from the result, because we get
separated arrays for each field.
is there a way to get the nested information for each nested document
separately?
we make a matchAll query, no nested search query.

suggestions?

thx
halit

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.

Is the above example with localized_data stored or with the original
mapping?

And enabling source is only an overhead in index size. If you are
retrieving several fields, then retrieving from source can/should be faster
since you are not executing an index lookup for each individual field.

--
Ivan

On Fri, Jul 5, 2013 at 8:51 AM, Halit Cimen halit.cimen@gmail.com wrote:

yes, we can store the localized_data field,
but we disabled the _source field, because it is not indexed (searchable,
just stored). (as described here
http://www.elasticsearch.org/guide/reference/mapping/source-field/)
it is only overhead, that we do not want

... That should return an array of objects.

unfortunately, it not returns an array of object.

if we make a search request with :

   String[] field = new String[] {"*"};
   QueryBuilder qb = QueryBuilders.matchQuery(p_ID,"2282104");
           SearchResponse response =

node.client().prepareSearch("index_name")
.setSearchType(SearchType.DEFAULT) .setQuery(qb)
.addFields( field) .setSize(1000).execute().actionGet();

SearchHit
csb_dc_list - [182:12, 182:13]
p_id - [2282104]
localized_data.title - [Tre Amiche, 3 Gatas quentes, 3 Hot Girls, 3 heiße
Mädels]
p_type_id - [9]
localized_data.locale_id - [292, 433, 0, 290]

as you see the fields of localized_data are returned as arrays.
but we want get an array of localized_data objects.

Am Freitag, 5. Juli 2013 17:16:07 UTC+2 schrieb Ivan Brusic:

I never worked with source disabled and nested documents, but can you
store the localized_data field? That should return an array of objects.

--
Ivan

On Thu, Jul 4, 2013 at 4:17 AM, Halit Cimen halit...@gmail.com wrote:

Hi,

we have a problem to read nested documents (example here
localized_data), which we mapped as follows.

mapping :
{
"generic": { "_id": { "path": "id" },
"_source" : { "enabled" : false },
"properties": {
"p_id": { "type": "long", "store": "yes" },
"p_type_id": { "type": "long", "store": "yes" },
"localized_data": {
"type": "nested",
"include_in_root" : "true",
"properties": {
"l_id": { "type": "string", "store": "yes" },
"title": { "type": "string", "store": "yes" },
"description": { "type": "string", "store": "yes" },
"artists": { "type": "string", "store": "yes" }
}
}
}
}
}

is there any way to read the nested documents as related objects
e.g.:
first nested document:

localized_data.l_id = "1" ,

localized_data.title = "test1"

localized_data.description = "desc1

localized_data.artists = "artiist1"

second nested document:

localized_data.l_id = "2" ,

localized_data.title = "test2"

localized_data.description = "desc2

localized_data.artists = "artiist2"

actually we get the values as arrays

localized_data.l_id = [1,2], localized_data.title = [test1,test2],
localized_data.description = [desc1,desc2], localized_data.artists =
[artiist1,artiist2]

we cannot assign the l_id to the title from the result, because we get
separated arrays for each field.
is there a way to get the nested information for each nested document
separately?
we make a matchAll query, no nested search query.

suggestions?

thx
halit

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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.

--
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.

localized_data is stored.
is there no way to get the the object array with disabled source?

Am Freitag, 5. Juli 2013 18:36:51 UTC+2 schrieb Ivan Brusic:

Is the above example with localized_data stored or with the original
mapping?

And enabling source is only an overhead in index size. If you are
retrieving several fields, then retrieving from source can/should be faster
since you are not executing an index lookup for each individual field.

--
Ivan

On Fri, Jul 5, 2013 at 8:51 AM, Halit Cimen <halit...@gmail.com<javascript:>

wrote:

yes, we can store the localized_data field,
but we disabled the _source field, because it is not indexed (searchable,
just stored). (as described here
http://www.elasticsearch.org/guide/reference/mapping/source-field/)
it is only overhead, that we do not want

... That should return an array of objects.

unfortunately, it not returns an array of object.

if we make a search request with :

   String[] field = new String[] {"*"};
   QueryBuilder qb = QueryBuilders.matchQuery(p_ID,"2282104");
           SearchResponse response = 

node.client().prepareSearch("index_name")
.setSearchType(SearchType.DEFAULT) .setQuery(qb)
.addFields( field) .setSize(1000).execute().actionGet();

SearchHit
csb_dc_list - [182:12, 182:13]
p_id - [2282104]
localized_data.title - [Tre Amiche, 3 Gatas quentes, 3 Hot Girls, 3 heiße
Mädels]
p_type_id - [9]
localized_data.locale_id - [292, 433, 0, 290]

as you see the fields of localized_data are returned as arrays.
but we want get an array of localized_data objects.

Am Freitag, 5. Juli 2013 17:16:07 UTC+2 schrieb Ivan Brusic:

I never worked with source disabled and nested documents, but can you
store the localized_data field? That should return an array of objects.

--
Ivan

On Thu, Jul 4, 2013 at 4:17 AM, Halit Cimen halit...@gmail.com wrote:

Hi,

we have a problem to read nested documents (example here
localized_data), which we mapped as follows.

mapping :
{
"generic": { "_id": { "path": "id" },
"_source" : { "enabled" : false },
"properties": {
"p_id": { "type": "long", "store": "yes" },
"p_type_id": { "type": "long", "store": "yes" },
"localized_data": {
"type": "nested",
"include_in_root" : "true",
"properties": {
"l_id": { "type": "string", "store": "yes" },
"title": { "type": "string", "store": "yes" },
"description": { "type": "string", "store": "yes" },
"artists": { "type": "string", "store": "yes" }
}
}
}
}
}

is there any way to read the nested documents as related objects
e.g.:
first nested document:

localized_data.l_id = "1" ,

localized_data.title = "test1"

localized_data.description = "desc1

localized_data.artists = "artiist1"

second nested document:

localized_data.l_id = "2" ,

localized_data.title = "test2"

localized_data.description = "desc2

localized_data.artists = "artiist2"

actually we get the values as arrays

localized_data.l_id = [1,2], localized_data.title = [test1,test2],
localized_data.description = [desc1,desc2], localized_data.artists =
[artiist1,artiist2]

we cannot assign the l_id to the title from the result, because we get
separated arrays for each field.
is there a way to get the nested information for each nested document
separately?
we make a matchAll query, no nested search query.

suggestions?

thx
halit

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.