Skip to content

MultiGet ignores _source field #849

@gmarz

Description

@gmarz
client.MultiGet(m => m
    .Get<ElasticsearchProject>(g => g.Id(1))
    .SourceEnabled("id", "name")
);

Should serialize to:

{
  "docs": [
    {
      "_index": "elasticsearchprojects",
      "_type": "elasticsearchproject",
      "_id": "1",
      "_source": ["id", "name"]
    }
  ]
}

But instead is:

{
  "docs": [
    {
      "_index": "elasticsearchprojects",
      "_type": "elasticsearchproject",
      "_id": "1"
    }
  ]
}

_source is completely ignored even when calling .SourceEnabled() without parameters and is a bit misleading as a name especially since the default in ES is true. We should consider renaming it to just Source to match the API (NEST 2.0).

Edit: this was originally reported in this SO issue: http://stackoverflow.com/questions/25125247/elasticsearch-nest-multiget-with-source-filtering#25125247

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions