aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2023-11-23 07:52:27 -0100
committerGitHub <noreply@github.com>2023-11-23 07:52:27 -0100
commitee787cd1c6ee5c9934aebe282b3d0a151a0570a5 (patch)
tree823ae1b28f28739d650437bbf076b3de0a2134d9 /lib
parentf1a7fcea8111a36ff8ba8fcd57b91142f9e8c146 (diff)
parentfbe92d4a9018b8439946880148c2b907ea56c56c (diff)
downloadnextcloud-server-ee787cd1c6ee5c9934aebe282b3d0a151a0570a5.tar.gz
nextcloud-server-ee787cd1c6ee5c9934aebe282b3d0a151a0570a5.zip
Merge pull request #41459 from nextcloud/enh/noid/search-metadata-null
implements search on null/notnull metadata
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/SearchBuilder.php2
-rw-r--r--lib/public/Files/Search/ISearchComparison.php1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Files/Cache/SearchBuilder.php b/lib/private/Files/Cache/SearchBuilder.php
index c3699cca63d..38161ec9cc6 100644
--- a/lib/private/Files/Cache/SearchBuilder.php
+++ b/lib/private/Files/Cache/SearchBuilder.php
@@ -47,6 +47,7 @@ class SearchBuilder {
ISearchComparison::COMPARE_GREATER_THAN_EQUAL => 'gte',
ISearchComparison::COMPARE_LESS_THAN => 'lt',
ISearchComparison::COMPARE_LESS_THAN_EQUAL => 'lte',
+ ISearchComparison::COMPARE_DEFINED => 'isNotNull',
];
protected static $searchOperatorNegativeMap = [
@@ -57,6 +58,7 @@ class SearchBuilder {
ISearchComparison::COMPARE_GREATER_THAN_EQUAL => 'lt',
ISearchComparison::COMPARE_LESS_THAN => 'gte',
ISearchComparison::COMPARE_LESS_THAN_EQUAL => 'gt',
+ ISearchComparison::COMPARE_DEFINED => 'isNull',
];
public const TAG_FAVORITE = '_$!<Favorite>!$_';
diff --git a/lib/public/Files/Search/ISearchComparison.php b/lib/public/Files/Search/ISearchComparison.php
index d7313fbaf2a..ba02f39996f 100644
--- a/lib/public/Files/Search/ISearchComparison.php
+++ b/lib/public/Files/Search/ISearchComparison.php
@@ -35,6 +35,7 @@ interface ISearchComparison extends ISearchOperator {
public const COMPARE_LESS_THAN_EQUAL = 'lte';
public const COMPARE_LIKE = 'like';
public const COMPARE_LIKE_CASE_SENSITIVE = 'clike';
+ public const COMPARE_DEFINED = 'is-defined';
public const HINT_PATH_EQ_HASH = 'path_eq_hash'; // transform `path = "$path"` into `path_hash = md5("$path")`, on by default