diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-10-07 17:16:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 17:16:39 +0200 |
commit | f518710c52c77838a6c150d138896ce7d546598f (patch) | |
tree | 404dc89164e3513a84da115e7ca3fab90d0325b8 /lib/public/Files | |
parent | 682944925839e5300c02a231b261bb6fc6dfdf20 (diff) | |
parent | 735105932680718e443cc6b9a883792d3e35729d (diff) | |
download | nextcloud-server-f518710c52c77838a6c150d138896ce7d546598f.tar.gz nextcloud-server-f518710c52c77838a6c150d138896ce7d546598f.zip |
Merge pull request #28608 from nextcloud/path-prefix-filter
generate a better optimized query for path prefix search filters
Diffstat (limited to 'lib/public/Files')
-rw-r--r-- | lib/public/Files/Search/ISearchComparison.php | 2 | ||||
-rw-r--r-- | lib/public/Files/Search/ISearchOperator.php | 18 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/public/Files/Search/ISearchComparison.php b/lib/public/Files/Search/ISearchComparison.php index 36d10824653..8ebaeced304 100644 --- a/lib/public/Files/Search/ISearchComparison.php +++ b/lib/public/Files/Search/ISearchComparison.php @@ -35,6 +35,8 @@ interface ISearchComparison extends ISearchOperator { public const COMPARE_LIKE = 'like'; public const COMPARE_LIKE_CASE_SENSITIVE = 'clike'; + public const HINT_PATH_EQ_HASH = 'path_eq_hash'; // transform `path = "$path"` into `path_hash = md5("$path")`, on by default + /** * Get the type of comparison, one of the ISearchComparison::COMPARE_* constants * diff --git a/lib/public/Files/Search/ISearchOperator.php b/lib/public/Files/Search/ISearchOperator.php index bcf2fb86573..1799b97c1ca 100644 --- a/lib/public/Files/Search/ISearchOperator.php +++ b/lib/public/Files/Search/ISearchOperator.php @@ -26,4 +26,22 @@ namespace OCP\Files\Search; * @since 12.0.0 */ interface ISearchOperator { + /** + * Get a query builder hint by name + * + * @param string $name + * @param $default + * @return mixed + * @since 23.0.0 + */ + public function getQueryHint(string $name, $default); + + /** + * Get a query builder hint + * + * @param string $name + * @param $value + * @since 23.0.0 + */ + public function setQueryHint(string $name, $value): void; } |