add search field in storage buckets
This commit is contained in:
parent
3e78abfc85
commit
da068085ef
|
@ -2127,6 +2127,17 @@ $collections = [
|
|||
'required' => true,
|
||||
'array' => false,
|
||||
],
|
||||
[
|
||||
'$id' => 'search',
|
||||
'type' => Database::VAR_STRING,
|
||||
'format' => '',
|
||||
'size' => 16384,
|
||||
'signed' => true,
|
||||
'required' => false,
|
||||
'default' => null,
|
||||
'array' => false,
|
||||
'filters' => [],
|
||||
],
|
||||
],
|
||||
'indexes' => [
|
||||
[
|
||||
|
@ -2135,7 +2146,14 @@ $collections = [
|
|||
'attributes' => ['name'],
|
||||
'lengths' => [1024],
|
||||
'orders' => [Database::ORDER_ASC],
|
||||
]
|
||||
],
|
||||
[
|
||||
'$id' => '_key_search',
|
||||
'type' => Database::INDEX_FULLTEXT,
|
||||
'attributes' => ['search'],
|
||||
'lengths' => [2048],
|
||||
'orders' => [Database::ORDER_ASC],
|
||||
],
|
||||
]
|
||||
],
|
||||
|
||||
|
|
|
@ -254,6 +254,7 @@ App::post('/v1/storage/buckets')
|
|||
'antiVirus' => $antiVirus,
|
||||
'$read' => $read,
|
||||
'$write' => $write,
|
||||
'search' => implode(' ', [$bucketId, $name]),
|
||||
]));
|
||||
} catch (Duplicate $th) {
|
||||
throw new Exception('Bucket already exists', 409);
|
||||
|
@ -603,6 +604,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
|
|||
'sizeActual' => $sizeActual,
|
||||
'algorithm' => empty($compressor) ? '' : $compressor->getName(),
|
||||
'comment' => '',
|
||||
'search' => implode(' ', [$fileId, $file['name'] ?? '',]),
|
||||
];
|
||||
|
||||
if($bucket->getAttribute('encryption', true) && $size <= APP_LIMIT_ENCRYPTION) {
|
||||
|
|
Loading…
Reference in a new issue