Skip to content

Commit

Permalink
store_fields it will no longer extract values from the _source, use m…
Browse files Browse the repository at this point in the history
…apping 'store' (#1184) (#1215)
  • Loading branch information
p365labs authored and ruflin committed Nov 12, 2016
1 parent a204fe6 commit c72a75b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file based on the

### Backward Compatibility Fixes
- Updated Elastica\Test\Suggest\CompletionTest now payload and output are removed
- Updated Elastica\Test\TypeTest::testGetDocumentWithFieldsSelection The stored_fields parameter will only return stored fields — it will no longer extract values from the _source

### Bugfixes

Expand Down
18 changes: 17 additions & 1 deletion test/lib/Elastica/Test/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,25 @@ public function testDeleteByQueryWithQueryAndOptions()
*/
public function testGetDocumentWithFieldsSelection()
{
$this->_markSkipped50('Currently seems like stored_fields does not work as expected -> requires mapping?');
$index = $this->_createIndex();

$type = new Type($index, 'test');
$mapping = new Mapping();
$mapping->setProperties([
'name' => [
'type' => 'string',
'store' => 'yes', ],
'email' => [
'type' => 'string',
'store' => 'yes', ],
'country' => [
'type' => 'string'
]
]);

$mapping->disableSource();
$type->setMapping($mapping);

$type->addDocument(new Document(1, ['name' => 'loris', 'country' => 'FR', 'email' => '[email protected]']));
$index->refresh();

Expand Down

0 comments on commit c72a75b

Please sign in to comment.