From d79be0f48323746b6a0a5baef8a45129778be9b8 Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Sat, 27 Jul 2024 22:44:09 -0300 Subject: [PATCH] #4964 - Flash message shown when trying to query during index rebuild shows wrong progress - Swap done and total values - Also rebuild index when getting an index writer throws IllegalArgumentException - this happens when an index was written with a newer version of Lucene --- .../de/tudarmstadt/ukp/inception/scheduling/TaskMonitor.java | 2 +- .../ukp/inception/search/index/mtas/MtasDocumentIndex.java | 2 +- .../app/ui/search/sidebar/SearchAnnotationSidebar.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inception/inception-scheduling/src/main/java/de/tudarmstadt/ukp/inception/scheduling/TaskMonitor.java b/inception/inception-scheduling/src/main/java/de/tudarmstadt/ukp/inception/scheduling/TaskMonitor.java index 2ff1564c340..c3d0baa8c5c 100644 --- a/inception/inception-scheduling/src/main/java/de/tudarmstadt/ukp/inception/scheduling/TaskMonitor.java +++ b/inception/inception-scheduling/src/main/java/de/tudarmstadt/ukp/inception/scheduling/TaskMonitor.java @@ -217,6 +217,6 @@ public boolean isCancelled() @Deprecated public synchronized Progress toProgress() { - return new Progress(maxProgress, progress); + return new Progress(progress, maxProgress); } } diff --git a/inception/inception-search-mtas/src/main/java/de/tudarmstadt/ukp/inception/search/index/mtas/MtasDocumentIndex.java b/inception/inception-search-mtas/src/main/java/de/tudarmstadt/ukp/inception/search/index/mtas/MtasDocumentIndex.java index 6c84ba33fab..15c3ae2d05f 100644 --- a/inception/inception-search-mtas/src/main/java/de/tudarmstadt/ukp/inception/search/index/mtas/MtasDocumentIndex.java +++ b/inception/inception-search-mtas/src/main/java/de/tudarmstadt/ukp/inception/search/index/mtas/MtasDocumentIndex.java @@ -211,7 +211,7 @@ private synchronized IndexWriter getIndexWriter() throws IOException _indexWriter = createIndexWriter(); return _indexWriter; } - catch (IOException e) { + catch (IOException | IllegalArgumentException e) { if (LOG.isDebugEnabled()) { LOG.warn("Unable to read MTAS index: {}. Deleting index so it can be rebuilt.", e.getMessage(), e); diff --git a/inception/inception-ui-search/src/main/java/de/tudarmstadt/ukp/inception/app/ui/search/sidebar/SearchAnnotationSidebar.java b/inception/inception-ui-search/src/main/java/de/tudarmstadt/ukp/inception/app/ui/search/sidebar/SearchAnnotationSidebar.java index 54e4ac0dfc5..521a6744439 100644 --- a/inception/inception-ui-search/src/main/java/de/tudarmstadt/ukp/inception/app/ui/search/sidebar/SearchAnnotationSidebar.java +++ b/inception/inception-ui-search/src/main/java/de/tudarmstadt/ukp/inception/app/ui/search/sidebar/SearchAnnotationSidebar.java @@ -585,7 +585,7 @@ private void executeSearchResultsGroupedQuery(AjaxRequestTarget aTarget) return; } catch (Exception e) { - error("Error in the query: " + e.getMessage()); + error("Query error: " + e.getMessage()); aTarget.addChildren(getPage(), IFeedback.class); resultsProvider.emptyQuery(); return;