elasticsearch/elasticsearch — pull request #4080 by RobCherry (2013-11-04 17:57:53+00:00)
Title: Fixes #4047 - Empty objects are not stored in _source when an include/ex...

...clude list is present

This was originally being tracked by pull request #4048. I closed that pull request because it was sloppy.

I am uncertain about the behavior for handling includes/excludes with empty objects and wildcards, so I added tests to cover the following cases, but please let me know if you think the results are is incorrect...

Given
```
{
"object1": { },
"object2": { }
}
```

And a mapping
```
{
...
{
"_source" : {
"excludes": "object1.*,
"includes": "object2.*"
}
}
}
```

Results in a filtered source of
```
{
"object1": { },
}
```