From adde9a685ccd57f515a556004af6cf26d2f39ba6 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Tue, 29 Jan 2019 16:53:49 -0100 Subject: [PATCH 1/3] +generateChunks() Signed-off-by: Maxence Lange --- .../IFullTextSearchProvider.php | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/public/FullTextSearch/IFullTextSearchProvider.php b/lib/public/FullTextSearch/IFullTextSearchProvider.php index 890b57d84c..a1bb14bdee 100644 --- a/lib/public/FullTextSearch/IFullTextSearchProvider.php +++ b/lib/public/FullTextSearch/IFullTextSearchProvider.php @@ -163,6 +163,24 @@ interface IFullTextSearchProvider { public function setIndexOptions(IIndexOptions $options); + /** + * Allow the provider to generate a list of chunk to split a huge list of + * indexable documents + * + * During the indexing the generateIndexableDocuments method will be called + * for each entry of the returned array. + * If the returned array is empty, the generateIndexableDocuments() will be + * called only once (per user). + * + * @since 16.0.0 + * + * @param string $userId + * + * @return array + */ + public function generateChunks(string $userId): array; + + /** * Returns all indexable document for a user as an array of IndexDocument. * @@ -178,13 +196,14 @@ interface IFullTextSearchProvider { * * @see IndexDocument * - * @since 15.0.0 + * @since 16.0.0 * * @param string $userId + * @param string $chunk * * @return IndexDocument[] */ - public function generateIndexableDocuments(string $userId): array; + public function generateIndexableDocuments(string $userId, string $chunk = ''): array; /** From b8e324177ea6ce2ac0e342852d0dd2e92ff3f56a Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Tue, 29 Jan 2019 17:13:29 -0100 Subject: [PATCH 2/3] removing default value in param $chunk Signed-off-by: Maxence Lange --- lib/public/FullTextSearch/IFullTextSearchProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/public/FullTextSearch/IFullTextSearchProvider.php b/lib/public/FullTextSearch/IFullTextSearchProvider.php index a1bb14bdee..aa80b2d7c8 100644 --- a/lib/public/FullTextSearch/IFullTextSearchProvider.php +++ b/lib/public/FullTextSearch/IFullTextSearchProvider.php @@ -173,7 +173,7 @@ interface IFullTextSearchProvider { * called only once (per user). * * @since 16.0.0 - * + * * @param string $userId * * @return array @@ -203,7 +203,7 @@ interface IFullTextSearchProvider { * * @return IndexDocument[] */ - public function generateIndexableDocuments(string $userId, string $chunk = ''): array; + public function generateIndexableDocuments(string $userId, string $chunk): array; /** From e87e93debf2a077dd34e31e5c83a5fba1a3facb5 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 31 Jan 2019 07:38:00 -0100 Subject: [PATCH 3/3] phpdoc Signed-off-by: Maxence Lange --- lib/public/FullTextSearch/IFullTextSearchProvider.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/public/FullTextSearch/IFullTextSearchProvider.php b/lib/public/FullTextSearch/IFullTextSearchProvider.php index aa80b2d7c8..a46ef05149 100644 --- a/lib/public/FullTextSearch/IFullTextSearchProvider.php +++ b/lib/public/FullTextSearch/IFullTextSearchProvider.php @@ -176,7 +176,7 @@ interface IFullTextSearchProvider { * * @param string $userId * - * @return array + * @return string[] */ public function generateChunks(string $userId): array; @@ -196,7 +196,8 @@ interface IFullTextSearchProvider { * * @see IndexDocument * - * @since 16.0.0 + * @since 15.0.0 + * -> 16.0.0: the parameter "$chunk" was added * * @param string $userId * @param string $chunk