@@ -107,6 +107,7 @@ public function getPropertyDefinitionsForScope(string $href, ?string $path): arr
107107 new SearchPropertyDefinition ('{DAV:}getlastmodified ' , true , true , true , SearchPropertyDefinition::DATATYPE_DATETIME ),
108108 new SearchPropertyDefinition ('{DAV:}creationdate ' , true , true , true , SearchPropertyDefinition::DATATYPE_DATETIME ),
109109 new SearchPropertyDefinition ('{http://nextcloud.org/ns}upload_time ' , true , true , true , SearchPropertyDefinition::DATATYPE_DATETIME ),
110+ new SearchPropertyDefinition ('{http://nextcloud.org/ns}last_activity ' , true , false , true , SearchPropertyDefinition::DATATYPE_DATETIME ),
110111 new SearchPropertyDefinition (FilesPlugin::SIZE_PROPERTYNAME , true , true , true , SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER ),
111112 new SearchPropertyDefinition (TagsPlugin::FAVORITE_PROPERTYNAME , true , true , true , SearchPropertyDefinition::DATATYPE_BOOLEAN ),
112113 new SearchPropertyDefinition (FilesPlugin::INTERNAL_FILEID_PROPERTYNAME , true , true , false , SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER ),
@@ -323,6 +324,8 @@ private function getSearchResultProperty(SearchResult $result, SearchPropertyDef
323324 return $ node ->getNode ()->getCreationTime ();
324325 case '{http://nextcloud.org/ns}upload_time ' :
325326 return $ node ->getNode ()->getUploadTime ();
327+ case '{http://nextcloud.org/ns}last_activity ' :
328+ return $ node ->getNode ()->getLastActivity ();
326329 case FilesPlugin::SIZE_PROPERTYNAME :
327330 return $ node ->getSize ();
328331 case FilesPlugin::INTERNAL_FILEID_PROPERTYNAME :
@@ -351,6 +354,8 @@ private function transformQuery(Query $query, ?SearchBinaryOperator $scopeOperat
351354 $ direction = $ order ->order === Order::ASC ? ISearchOrder::DIRECTION_ASCENDING : ISearchOrder::DIRECTION_DESCENDING ;
352355 if (str_starts_with ($ order ->property ->name , FilesPlugin::FILE_METADATA_PREFIX )) {
353356 return new SearchOrder ($ direction , substr ($ order ->property ->name , strlen (FilesPlugin::FILE_METADATA_PREFIX )), IMetadataQuery::EXTRA );
357+ } elseif ($ order ->property ->name === FilesPlugin::LAST_ACTIVITY_PROPERTYNAME ) {
358+ return new SearchOrder ($ direction , 'last_activity ' );
354359 } else {
355360 return new SearchOrder ($ direction , $ this ->mapPropertyNameToColumn ($ order ->property ));
356361 }
0 commit comments