Query with partial fields does not return nested arrays values


(Ilya Korniyko) #1

I did
curl -XPUT http://localhost:9200/test/a/c -d "{ "list" : ["1"],
"nest_list" : [["1"]] }"
{"ok":true,"_index":"test","_type":"a","_id":"c","_version":1}

Now
curl -XPOST http://localhost:9200/_search?pretty=true -d "{ "query"
: { "match_all" : {}}}"

gives

{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "a",
"_id" : "c",
"_score" : 1.0, "_source" : { "list" : ["1"], "nest_list" : [["1"]]
}
} ]
}
}

While with partial fields, nested arrays are not returned
curl -XPOST http://localhost:9200/_search? -d "{ "query" : {
"match_all" : {}}, "partial_fields" : { "partial" : {
"exclude":"nothing" } } }"

{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "a",
"_id" : "c",
"_score" : 1.0,
"fields" : {
"partial" : {
"nest_list" : [ ],
"list" : [ "1" ]
}
}
} ]
}
}

--


(Mark Huang-2) #2

I'm pretty new to this whole ElasticSearch thing but if I'm not mistaken,
you didn't specify what fields to include; you only specified what fields
to exclude. I'm also using partial fields actively and I have no problems.
You have to specify what fields to include.

On Monday, 13 August 2012 13:35:37 UTC-5, Ilya Korniyko wrote:

I did
curl -XPUT http://localhost:9200/test/a/c -d "{ "list" : ["1"],
"nest_list" : [["1"]] }"
{"ok":true,"_index":"test","_type":"a","_id":"c","_version":1}

Now
curl -XPOST http://localhost:9200/_search?pretty=true -d "{
"query" : { "match_all" : {}}}"

gives

{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "a",
"_id" : "c",
"_score" : 1.0, "_source" : { "list" : ["1"], "nest_list" :
[["1"]] }
} ]
}
}

While with partial fields, nested arrays are not returned
curl -XPOST http://localhost:9200/_search? -d "{ "query" : {
"match_all" : {}}, "partial_fields" : { "partial" : {
"exclude":"nothing" } } }"

{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "a",
"_id" : "c",
"_score" : 1.0,
"fields" : {
"partial" : {
"nest_list" : [ ],
"list" : [ "1" ]
}
}
} ]
}
}

--


(system) #3