From 98df5163845c9d4bcb39c5098c04faa42ce3a0bf Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Tue, 12 Jul 2011 07:58:44 +0000 Subject: [PATCH] LUCENE-3296: Enable passing a IndexWriterConfig into PKIndexSplitter git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1145479 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/index/MultiPassIndexSplitter.java | 7 ++-- .../apache/lucene/index/PKIndexSplitter.java | 38 ++++++++++++++----- .../index/TestMultiPassIndexSplitter.java | 4 +- .../lucene/index/TestPKIndexSplitter.java | 4 +- 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java b/lucene/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java index b62c7a72b56..c2f86e78fa4 100644 --- a/lucene/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java +++ b/lucene/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java @@ -57,7 +57,7 @@ public class MultiPassIndexSplitter { * assigned in a deterministic round-robin fashion to one of the output splits. * @throws IOException */ - public void split(IndexReader input, Directory[] outputs, boolean seq) throws IOException { + public void split(Version version, IndexReader input, Directory[] outputs, boolean seq) throws IOException { if (outputs == null || outputs.length < 2) { throw new IOException("Invalid number of outputs."); } @@ -96,7 +96,7 @@ public class MultiPassIndexSplitter { } } IndexWriter w = new IndexWriter(outputs[i], new IndexWriterConfig( - Version.LUCENE_CURRENT, + version, null) .setOpenMode(OpenMode.CREATE)); System.err.println("Writing part " + (i + 1) + " ..."); @@ -106,6 +106,7 @@ public class MultiPassIndexSplitter { System.err.println("Done."); } + @SuppressWarnings("deprecation") public static void main(String[] args) throws Exception { if (args.length < 5) { System.err.println("Usage: MultiPassIndexSplitter -out -num [-seq] [