|
|
|
|
@ -88,6 +88,7 @@ class FileSearchBackend implements ISearchBackend { |
|
|
|
|
new SearchPropertyDefinition('{DAV:}getlastmodified', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME), |
|
|
|
|
new SearchPropertyDefinition('{DAV:}creationdate', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME), |
|
|
|
|
new SearchPropertyDefinition('{http://nextcloud.org/ns}upload_time', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME), |
|
|
|
|
new SearchPropertyDefinition('{http://nextcloud.org/ns}last_activity', true, false, true, SearchPropertyDefinition::DATATYPE_DATETIME), |
|
|
|
|
new SearchPropertyDefinition(FilesPlugin::SIZE_PROPERTYNAME, true, true, true, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER), |
|
|
|
|
new SearchPropertyDefinition(TagsPlugin::FAVORITE_PROPERTYNAME, true, true, true, SearchPropertyDefinition::DATATYPE_BOOLEAN), |
|
|
|
|
new SearchPropertyDefinition(FilesPlugin::INTERNAL_FILEID_PROPERTYNAME, true, true, false, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER), |
|
|
|
|
@ -304,6 +305,8 @@ class FileSearchBackend implements ISearchBackend { |
|
|
|
|
return $node->getNode()->getCreationTime(); |
|
|
|
|
case '{http://nextcloud.org/ns}upload_time': |
|
|
|
|
return $node->getNode()->getUploadTime(); |
|
|
|
|
case '{http://nextcloud.org/ns}last_activity': |
|
|
|
|
return max($node->getNode()->getUploadTime(), $node->getNode()->getMTime()); |
|
|
|
|
case FilesPlugin::SIZE_PROPERTYNAME: |
|
|
|
|
return $node->getSize(); |
|
|
|
|
case FilesPlugin::INTERNAL_FILEID_PROPERTYNAME: |
|
|
|
|
@ -332,6 +335,8 @@ class FileSearchBackend implements ISearchBackend { |
|
|
|
|
$direction = $order->order === Order::ASC ? ISearchOrder::DIRECTION_ASCENDING : ISearchOrder::DIRECTION_DESCENDING; |
|
|
|
|
if (str_starts_with($order->property->name, FilesPlugin::FILE_METADATA_PREFIX)) { |
|
|
|
|
return new SearchOrder($direction, substr($order->property->name, strlen(FilesPlugin::FILE_METADATA_PREFIX)), IMetadataQuery::EXTRA); |
|
|
|
|
} elseif ($order->property->name === FilesPlugin::LAST_ACTIVITY_PROPERTYNAME) { |
|
|
|
|
return new SearchOrder($direction, 'last_activity'); |
|
|
|
|
} else { |
|
|
|
|
return new SearchOrder($direction, $this->mapPropertyNameToColumn($order->property)); |
|
|
|
|
} |
|
|
|
|
|