Skip to content

script_fields does not return _source and seems to ignore the fields part #427

@machwatt

Description

@machwatt

Summary of problem or feature request

I try to include a script_fields part to the $params for a client->search(). The script is working, i tried the same request with Kibana/Sense. In Sense i get a response like this:

 "hits": {
    "total": 990,
    "max_score": 1.4142135,
    "hits": [
      { some entries here }

In elasticsearch-php i get the same response but with an empty array for hits[hits].

Code snippet of problem

$params['body']['script_fields'] = $scriptFields;
$result = $this->client->search($params);

System details

  • Operating System: OSX 10.11.5
  • PHP Version: 7.0.8
  • ES-PHP client version: 2.0.0
  • Elasticsearch version 2.3.3

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