You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by os...@apache.org on 2017/03/10 08:39:03 UTC
[3/4] jena git commit: Add more informative exception message when
trying to use an old Lucene index. (JENA-1250)
Add more informative exception message when trying to use an old Lucene index. (JENA-1250)
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/8bba58bb
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/8bba58bb
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/8bba58bb
Branch: refs/heads/master
Commit: 8bba58bb1b17d75ec9a8e1967a0e466f7e45898f
Parents: ac06feb
Author: Osma Suominen <os...@helsinki.fi>
Authored: Fri Mar 10 10:35:24 2017 +0200
Committer: Osma Suominen <os...@helsinki.fi>
Committed: Fri Mar 10 10:35:24 2017 +0200
----------------------------------------------------------------------
.../java/org/apache/jena/query/spatial/SpatialIndexLucene.java | 3 +++
.../main/java/org/apache/jena/query/text/TextIndexLucene.java | 4 ++++
2 files changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/8bba58bb/jena-spatial/src/main/java/org/apache/jena/query/spatial/SpatialIndexLucene.java
----------------------------------------------------------------------
diff --git a/jena-spatial/src/main/java/org/apache/jena/query/spatial/SpatialIndexLucene.java b/jena-spatial/src/main/java/org/apache/jena/query/spatial/SpatialIndexLucene.java
index 440df4d..26901da 100644
--- a/jena-spatial/src/main/java/org/apache/jena/query/spatial/SpatialIndexLucene.java
+++ b/jena-spatial/src/main/java/org/apache/jena/query/spatial/SpatialIndexLucene.java
@@ -108,6 +108,9 @@ public class SpatialIndexLucene implements SpatialIndex {
try {
IndexWriterConfig wConfig = new IndexWriterConfig(analyzer);
indexWriter = new IndexWriter(directory, wConfig);
+ } catch (IndexFormatTooOldException e) {
+ throw new SpatialIndexException("jena-spatial/Lucene cannot use indexes created before Jena 3.3.0. "
+ + "Please rebuild your spatial index using jena.spatialindexer from Jena 3.3.0 or above.", e);
} catch (IOException e) {
exception(e);
}
http://git-wip-us.apache.org/repos/asf/jena/blob/8bba58bb/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java
----------------------------------------------------------------------
diff --git a/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java b/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java
index b40ba03..31686ea 100644
--- a/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java
+++ b/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java
@@ -131,6 +131,10 @@ public class TextIndexLucene implements TextIndex {
// Force a commit to create the index, otherwise querying before writing will cause an exception
indexWriter.commit();
}
+ catch (IndexFormatTooOldException e) {
+ throw new TextIndexException("jena-text/Lucene cannot use indexes created before Jena 3.3.0. "
+ + "Please rebuild your text index using jena.textindexer from Jena 3.3.0 or above.", e);
+ }
catch (IOException e)
{
throw new TextIndexException(e) ;