Skip to content

Commit

Permalink
fielddata_fields has been deprecated in ES5, use parameter docvalue_f…
Browse files Browse the repository at this point in the history
…ields instead (ruflin#1184)
  • Loading branch information
p365labs committed Nov 9, 2016
1 parent 16764ce commit 776016f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ All notable changes to this project will be documented in this file based on the
- implemented painless as default scripting language in tests
- removed search_type=count is removed in Elasticsearch 5.0
- removed logging.yml as now ES 5.0 uses log4j2.properties (leaving defaults)
- removed fielddata_fields has been deprecated in ES5, use parameter docvalue_fields instead

### Bugfixes

Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Aggregation/TopHits.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,6 @@ public function setHighlight(array $highlightArgs)
*/
public function setFieldDataFields(array $fields)
{
return $this->setParam('fielddata_fields', $fields);
return $this->setParam('docvalue_fields', $fields);
}
}
2 changes: 1 addition & 1 deletion lib/Elastica/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public function setStoredFields(array $fields)
*/
public function setFieldDataFields(array $fieldDataFields)
{
return $this->setParam('fielddata_fields', $fieldDataFields);
return $this->setParam('docvalue_fields', $fieldDataFields);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Query/InnerHits.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,6 @@ public function setHighlight(array $highlightArgs)
*/
public function setFieldDataFields(array $fields)
{
return $this->setParam('fielddata_fields', $fields);
return $this->setParam('docvalue_fields', $fields);
}
}
2 changes: 1 addition & 1 deletion test/lib/Elastica/Test/Aggregation/TopHitsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function testSetFieldDataFields()
$fields = ['title', 'tags'];
$agg = new TopHits('agg_name');
$returnValue = $agg->setFieldDataFields($fields);
$this->assertEquals($fields, $agg->getParam('fielddata_fields'));
$this->assertEquals($fields, $agg->getParam('docvalue_fields'));
$this->assertInstanceOf('Elastica\Aggregation\TopHits', $returnValue);
}

Expand Down
2 changes: 1 addition & 1 deletion test/lib/Elastica/Test/Query/InnerHitsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function testSetFieldDataFields()
$fields = ['title', 'tags'];
$innerHits = new InnerHits();
$returnValue = $innerHits->setFieldDataFields($fields);
$this->assertEquals($fields, $innerHits->getParam('fielddata_fields'));
$this->assertEquals($fields, $innerHits->getParam('docvalue_fields'));
$this->assertInstanceOf('Elastica\Query\InnerHits', $returnValue);
}

Expand Down

0 comments on commit 776016f

Please sign in to comment.