mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
PHRAS-2126_Array-to-String-err-idx_4.1 (#2656)
fix : es error message during indexation is now dumped (not always a string) fix : es file "size" is now type "long"
This commit is contained in:
@@ -157,8 +157,7 @@ class BulkOperation
|
||||
foreach ($response['items'] as $key => $item) {
|
||||
foreach($item as $command=>$result) { // command may be "index" or "delete"
|
||||
if($response['errors'] && $result['status'] >= 400) { // 4xx or 5xx error
|
||||
$err = array_key_exists('error', $result) ? $result['error'] : ($command . " error " . $result['status']);
|
||||
throw new Exception(sprintf('%d: %s', $key, $err));
|
||||
throw new Exception(sprintf('%d: %s', $key, var_export($result, true)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -71,7 +71,7 @@ class RecordIndex implements MappingProvider
|
||||
|
||||
$mapping->addIntegerField('width')->disableIndexing();
|
||||
$mapping->addIntegerField('height')->disableIndexing();
|
||||
$mapping->addIntegerField('size')->disableIndexing();
|
||||
$mapping->addLongField('size')->disableIndexing();
|
||||
|
||||
$mapping->addGeoPointField('location');
|
||||
|
||||
|
@@ -45,6 +45,15 @@ class MappingBuilder
|
||||
return $this->mapping->addField(new FieldMapping($name, FieldMapping::TYPE_INTEGER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return FieldMapping
|
||||
*/
|
||||
public function addLongField($name)
|
||||
{
|
||||
return $this->mapping->addField(new FieldMapping($name, FieldMapping::TYPE_LONG));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return FieldMapping
|
||||
|
Reference in New Issue
Block a user