diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2023-11-15 20:02:28 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2023-11-22 12:43:27 -0100 |
commit | 7467422f570a44d3b3865907ba6f6f1a96d53a0b (patch) | |
tree | d7b6f74aef3c56f7c80bdbada85a94b495c8e102 /lib | |
parent | 9c3321c524be0da20f614ee19c664c98e048955a (diff) | |
download | nextcloud-server-7467422f570a44d3b3865907ba6f6f1a96d53a0b.tar.gz nextcloud-server-7467422f570a44d3b3865907ba6f6f1a96d53a0b.zip |
implements search on null/notnull metadata
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Cache/SearchBuilder.php | 2 | ||||
-rw-r--r-- | lib/public/Files/Search/ISearchComparison.php | 1 |
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..e1650dabc61 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 = 'defined'; public const HINT_PATH_EQ_HASH = 'path_eq_hash'; // transform `path = "$path"` into `path_hash = md5("$path")`, on by default |