mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
add search field in storage buckets
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user