elasticsearch/elasticsearch — Issue #1570: Search: Support partial fields that can returns partial view of the _source
Author: kimchy
Created: 2011-12-26 14:49:28+00:00
State: open
Labels: feature, v0.19.0

Support `partial_fields` that can return a partial representation of `_source` based on `include` and `exclude` patterns. For example, include only data starts with `obj1.obj2`:

{
"query" : {
"match_all" : {}
},
"partial_fields" : {
"partial1" : {
"include" : "obj1.obj2.*",
}
}
}

And one that will also exclude `obj1.obj3`:

{
"query" : {
"match_all" : {}
},
"partial_fields" : {
"partial1" : {
"include" : "obj1.obj2.*",
"exclude" : "obj1.obj3.*"
}
}
}

Both `include` and `exclude` supports multiple patterns:

{
"query" : {
"match_all" : {}
},
"partial_fields" : {
"partial1" : {
"include" : ["obj1.obj2.*", "obj1.obj4.*"],
"exclude" : "obj1.obj3.*"
}
}
}