1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

add search field in storage buckets

This commit is contained in:
Damodar Lohani 2021-10-17 11:51:13 +05:45
parent 3e78abfc85
commit da068085ef
2 changed files with 21 additions and 1 deletions

View file

@ -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],
],
]
],

View file

@ -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) {