camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject camel git commit: Upgrade to Lucene 4.10.2
Date Wed, 03 Dec 2014 00:55:07 GMT
Repository: camel
Updated Branches:
  refs/heads/master aad1837a7 -> 596b11dc8


Upgrade to Lucene 4.10.2

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/596b11dc
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/596b11dc
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/596b11dc

Branch: refs/heads/master
Commit: 596b11dc85abd77e529080b111ce4b65c9e82529
Parents: aad1837
Author: Babak Vahdat <bvahdat@apache.org>
Authored: Wed Dec 3 01:54:42 2014 +0100
Committer: Babak Vahdat <bvahdat@apache.org>
Committed: Wed Dec 3 01:54:42 2014 +0100

----------------------------------------------------------------------
 .../apache/camel/component/lucene/LuceneConfiguration.java    | 4 ++--
 .../java/org/apache/camel/component/lucene/LuceneIndexer.java | 2 +-
 .../org/apache/camel/component/lucene/LuceneSearcher.java     | 4 ++--
 .../component/lucene/LuceneIndexAndQueryProducerTest.java     | 7 +++----
 .../camel/processor/lucene/LuceneQueryProcessorTest.java      | 5 ++---
 parent/pom.xml                                                | 6 +++---
 6 files changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/596b11dc/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneConfiguration.java
b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneConfiguration.java
index d76a6ee..fc19119 100644
--- a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneConfiguration.java
+++ b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneConfiguration.java
@@ -35,7 +35,7 @@ public class LuceneConfiguration {
     private File indexDirectory;
     private Analyzer analyzer;
     private int maxHits;
-    private Version luceneVersion = Version.LUCENE_46; 
+    private Version luceneVersion = Version.LUCENE_4_10_2; 
 
     public LuceneConfiguration() {
     }
@@ -65,7 +65,7 @@ public class LuceneConfiguration {
         indexDirectory = component.resolveAndRemoveReferenceParameter(
                 parameters, "indexDir", File.class, new File("file:///./indexDirectory"));
         analyzer = component.resolveAndRemoveReferenceParameter(
-                parameters, "analyzer", Analyzer.class, new StandardAnalyzer(luceneVersion));
+                parameters, "analyzer", Analyzer.class, new StandardAnalyzer());
 
         setMaxHits(component.getAndRemoveParameter(parameters, "maxHits", Integer.class,
10));
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/596b11dc/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
----------------------------------------------------------------------
diff --git a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
index 561758d..a335398 100644
--- a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
+++ b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
@@ -144,7 +144,7 @@ public class LuceneIndexer {
     private void openIndexWriter() throws IOException {
         IndexWriterConfig indexWriterConfig;
         // use create or append so we can reuse existing index if already exists
-        indexWriterConfig = new IndexWriterConfig(Version.LUCENE_46, getAnalyzer()).setOpenMode(OpenMode.CREATE_OR_APPEND);
+        indexWriterConfig = new IndexWriterConfig(Version.LUCENE_4_10_2, getAnalyzer()).setOpenMode(OpenMode.CREATE_OR_APPEND);
         indexWriter = new IndexWriter(niofsDirectory, indexWriterConfig);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/596b11dc/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneSearcher.java
----------------------------------------------------------------------
diff --git a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneSearcher.java
b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneSearcher.java
index b9aac5d..0d249be 100644
--- a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneSearcher.java
+++ b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneSearcher.java
@@ -59,7 +59,7 @@ public class LuceneSearcher {
     }
     
     public Hits search(String searchPhrase, int maxNumberOfHits) throws Exception {
-        return search(searchPhrase, maxNumberOfHits, Version.LUCENE_4_9);
+        return search(searchPhrase, maxNumberOfHits, Version.LUCENE_4_10_2);
     }
 
     public Hits search(String searchPhrase, int maxNumberOfHits, Version luceneVersion) throws
Exception {
@@ -83,7 +83,7 @@ public class LuceneSearcher {
     private int doSearch(String searchPhrase, int maxNumberOfHits, Version luceneVersion)
throws NullPointerException, ParseException, IOException {
         LOG.trace("*** Search Phrase: {} ***", searchPhrase);
 
-        QueryParser parser = new QueryParser(luceneVersion, "contents", analyzer);
+        QueryParser parser = new QueryParser("contents", analyzer);
         Query query = parser.parse(searchPhrase);
         TopScoreDocCollector collector = TopScoreDocCollector.create(maxNumberOfHits, true);
         indexSearcher.search(query, collector);

http://git-wip-us.apache.org/repos/asf/camel/blob/596b11dc/components/camel-lucene/src/test/java/org/apache/camel/component/lucene/LuceneIndexAndQueryProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-lucene/src/test/java/org/apache/camel/component/lucene/LuceneIndexAndQueryProducerTest.java
b/components/camel-lucene/src/test/java/org/apache/camel/component/lucene/LuceneIndexAndQueryProducerTest.java
index 591c1c9..665c762 100644
--- a/components/camel-lucene/src/test/java/org/apache/camel/component/lucene/LuceneIndexAndQueryProducerTest.java
+++ b/components/camel-lucene/src/test/java/org/apache/camel/component/lucene/LuceneIndexAndQueryProducerTest.java
@@ -30,7 +30,6 @@ import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.lucene.analysis.core.SimpleAnalyzer;
 import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.util.Version;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -53,11 +52,11 @@ public class LuceneIndexAndQueryProducerTest extends CamelTestSupport
{
         JndiRegistry registry = new JndiRegistry(createJndiContext());
         registry.bind("std", new File("target/stdindexDir"));
         registry.bind("load_dir", new File("src/test/resources/sources"));
-        registry.bind("stdAnalyzer", new StandardAnalyzer(Version.LUCENE_46));
+        registry.bind("stdAnalyzer", new StandardAnalyzer());
         registry.bind("simple", new File("target/simpleindexDir"));
-        registry.bind("simpleAnalyzer", new SimpleAnalyzer(Version.LUCENE_46));
+        registry.bind("simpleAnalyzer", new SimpleAnalyzer());
         registry.bind("whitespace", new File("target/whitespaceindexDir"));
-        registry.bind("whitespaceAnalyzer", new WhitespaceAnalyzer(Version.LUCENE_46));
+        registry.bind("whitespaceAnalyzer", new WhitespaceAnalyzer());
         return registry;
     }
     

http://git-wip-us.apache.org/repos/asf/camel/blob/596b11dc/components/camel-lucene/src/test/java/org/apache/camel/processor/lucene/LuceneQueryProcessorTest.java
----------------------------------------------------------------------
diff --git a/components/camel-lucene/src/test/java/org/apache/camel/processor/lucene/LuceneQueryProcessorTest.java
b/components/camel-lucene/src/test/java/org/apache/camel/processor/lucene/LuceneQueryProcessorTest.java
index 657ab30..8f0f85c 100644
--- a/components/camel-lucene/src/test/java/org/apache/camel/processor/lucene/LuceneQueryProcessorTest.java
+++ b/components/camel-lucene/src/test/java/org/apache/camel/processor/lucene/LuceneQueryProcessorTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.processor.lucene.support.Hits;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.util.Version;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -53,7 +52,7 @@ public class LuceneQueryProcessorTest extends CamelTestSupport {
     
     @Test
     public void testPhraseSearcher() throws Exception {
-        final StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_46);
+        final StandardAnalyzer analyzer = new StandardAnalyzer();
         MockEndpoint mockSearchEndpoint = getMockEndpoint("mock:searchResult");
         
         context.stop();
@@ -97,7 +96,7 @@ public class LuceneQueryProcessorTest extends CamelTestSupport {
     
     @Test
     public void testWildcardSearcher() throws Exception {
-        final WhitespaceAnalyzer analyzer = new WhitespaceAnalyzer(Version.LUCENE_46);
+        final WhitespaceAnalyzer analyzer = new WhitespaceAnalyzer();
         MockEndpoint mockSearchEndpoint = getMockEndpoint("mock:searchResult");
         
         context.stop();

http://git-wip-us.apache.org/repos/asf/camel/blob/596b11dc/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index d4c7dae..424a1d9 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -295,8 +295,8 @@
     <!-- virtual dependency only used by Eclipse m2e -->
     <lifecycle-mapping-version>1.0.0</lifecycle-mapping-version>
     <log4j-version>1.2.17</log4j-version>
-    <lucene-bundle-version>4.9.0_1</lucene-bundle-version>
-    <lucene-version>4.9.0</lucene-version>
+    <lucene-bundle-version>4.10.2_1</lucene-bundle-version>
+    <lucene-version>4.10.2</lucene-version>
     <lucene-version-range>[4.5,5)</lucene-version-range>
     <lightcouch-version>0.1.3</lightcouch-version>
     <lightcouch-bundle-version>0.1.3_1</lightcouch-bundle-version>
@@ -2304,7 +2304,7 @@
         <artifactId>commons-httpclient</artifactId>
         <version>${httpclient-version}</version>
       </dependency>
-     <dependency>
+      <dependency>
         <groupId>xalan</groupId>
         <artifactId>xalan</artifactId>
         <version>${xalan-version}</version>


Mime
View raw message