From d836426574cd6a1b9e26f6fc6772b2205100fade Mon Sep 17 00:00:00 2001 From: DiogoSobralCapgemini Date: Fri, 1 Feb 2019 13:17:55 +0100 Subject: [PATCH 1/2] LUTECE-2224 : Allow client calls to pass StringBuffer to SearchIndexer indexDocuments --- .../portal/service/search/IndexationService.java | 4 ++-- .../portal/service/search/SearchIndexer.java | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/java/fr/paris/lutece/portal/service/search/IndexationService.java b/src/java/fr/paris/lutece/portal/service/search/IndexationService.java index a62216e363..6be04cd9a8 100644 --- a/src/java/fr/paris/lutece/portal/service/search/IndexationService.java +++ b/src/java/fr/paris/lutece/portal/service/search/IndexationService.java @@ -293,7 +293,7 @@ private static void processFullIndexing( ) _sbLogs.append( "\r\n" ); // the indexer will call write(doc) - indexer.indexDocuments( ); + indexer.indexDocuments( _sbLogs ); } } catch( Exception e ) @@ -363,7 +363,7 @@ private static void processIncrementalIndexing( ) throws CorruptIndexException, // reindexing all pages. _writer.deleteDocuments( new Term( SearchItem.FIELD_TYPE, PARAM_TYPE_PAGE ) ); - _mapIndexers.get( PageIndexer.INDEXER_NAME ).indexDocuments( ); + _mapIndexers.get( PageIndexer.INDEXER_NAME ).indexDocuments( _sbLogs ); } /** diff --git a/src/java/fr/paris/lutece/portal/service/search/SearchIndexer.java b/src/java/fr/paris/lutece/portal/service/search/SearchIndexer.java index cb1449e0e0..c9ed744561 100644 --- a/src/java/fr/paris/lutece/portal/service/search/SearchIndexer.java +++ b/src/java/fr/paris/lutece/portal/service/search/SearchIndexer.java @@ -58,6 +58,21 @@ public interface SearchIndexer */ void indexDocuments( ) throws IOException, InterruptedException, SiteMessageException; + /** + * Index all lucene documents from the plugin, replace List<Document> getDocuments( ) method + * + * @param sbLogs + * Le logger + * @throws IOException + * If an IO error occured + * @throws InterruptedException + * If a thread error occured + * @throws SiteMessageException + * occurs when a site message need to be displayed + */ + default void indexDocuments( StringBuffer sbLogs ) throws IOException, InterruptedException, SiteMessageException { + indexDocuments( ); + } /** * Returns a List of lucene documents to add to the index * From 3470b34fe658b7a846c6016a6772385642c6f161 Mon Sep 17 00:00:00 2001 From: DiogoSobralCapgemini Date: Fri, 1 Feb 2019 15:31:31 +0100 Subject: [PATCH 2/2] LUTECE-2224 : Allow client calls to pass StringBuffer to SearchIndexer indexDocuments --- .../fr/paris/lutece/portal/service/search/SearchIndexer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/fr/paris/lutece/portal/service/search/SearchIndexer.java b/src/java/fr/paris/lutece/portal/service/search/SearchIndexer.java index c9ed744561..4b6cc6eaf5 100644 --- a/src/java/fr/paris/lutece/portal/service/search/SearchIndexer.java +++ b/src/java/fr/paris/lutece/portal/service/search/SearchIndexer.java @@ -70,7 +70,8 @@ public interface SearchIndexer * @throws SiteMessageException * occurs when a site message need to be displayed */ - default void indexDocuments( StringBuffer sbLogs ) throws IOException, InterruptedException, SiteMessageException { + default void indexDocuments( StringBuffer sbLogs ) throws IOException, InterruptedException, SiteMessageException + { indexDocuments( ); } /**