portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r1086464 - in /portals/jetspeed-2/portal/trunk: ./ components/jetspeed-search/ components/jetspeed-search/src/main/java/org/apache/jetspeed/search/lucene/ components/jetspeed-search/src/test/java/org/apache/jetspeed/search/ components/jetsp...
Date Tue, 29 Mar 2011 02:08:39 GMT
Author: woonsan
Date: Tue Mar 29 02:08:39 2011
New Revision: 1086464

URL: http://svn.apache.org/viewvc?rev=1086464&view=rev
Log:
JS2-1246: Adding solr dependencies. solr-core for (default) embedded solr engine; solr-solrj
for client api.
Also, downgrade lucene from 3.0 to 2.9 because solr depends on 2.9.

Added:
    portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/
    portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/TestPortletRegistrySearch.java
      - copied, changed from r1086461, portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/TestPortletRegistrySearch.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/TestSearch.java
      - copied, changed from r1086461, portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/TestSearch.java
Removed:
    portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/TestPortletRegistrySearch.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/TestSearch.java
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-search/pom.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/main/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java
    portals/jetspeed-2/portal/trunk/pom.xml

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-search/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-search/pom.xml?rev=1086464&r1=1086463&r2=1086464&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-search/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-search/pom.xml Tue Mar 29 02:08:39
2011
@@ -71,6 +71,14 @@
       <artifactId>lucene-core</artifactId>
     </dependency>
     <dependency>
+      <artifactId>solr-solrj</artifactId>
+      <groupId>org.apache.solr</groupId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.solr</groupId>
+      <artifactId>solr-core</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/main/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/main/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java?rev=1086464&r1=1086463&r2=1086464&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/main/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/main/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java
Tue Mar 29 02:08:39 2011
@@ -120,7 +120,7 @@ public class SearchEngineImpl implements
         
         if (analyzer == null) 
         {
-            analyzer = new StandardAnalyzer(Version.LUCENE_30);
+            analyzer = new StandardAnalyzer(Version.LUCENE_29);
         }
         
         this.optimizeAfterUpdate = optimzeAfterUpdate;
@@ -320,7 +320,7 @@ public class SearchEngineImpl implements
             indexReader = IndexReader.open(directory);
             searcher = new IndexSearcher(indexReader);
             
-            QueryParser queryParser = new QueryParser(Version.LUCENE_30, defaultFieldName,
analyzer);
+            QueryParser queryParser = new QueryParser(Version.LUCENE_29, defaultFieldName,
analyzer);
             Query query = queryParser.parse(queryString);
             TopDocs topDocs = searcher.search(query, topHitsCount);
             
@@ -546,8 +546,9 @@ public class SearchEngineImpl implements
                 addFieldsToDocument(doc, fields, TEXT);
                 
                 List<String> syntheticField = new ArrayList<String>();
-                for (Fieldable fieldable : doc.getFields())
+                for (Object obj : doc.getFields())
                 {
+                    Fieldable fieldable = (Fieldable) obj;
                     String value = fieldable.stringValue();
                     if (value != null)
                     {

Copied: portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/TestPortletRegistrySearch.java
(from r1086461, portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/TestPortletRegistrySearch.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/TestPortletRegistrySearch.java?p2=portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/TestPortletRegistrySearch.java&p1=portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/TestPortletRegistrySearch.java&r1=1086461&r2=1086464&rev=1086464&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/TestPortletRegistrySearch.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/TestPortletRegistrySearch.java
Tue Mar 29 02:08:39 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jetspeed.search;
+package org.apache.jetspeed.search.lucene;
 
 import java.util.Arrays;
 import java.util.HashMap;
@@ -24,6 +24,11 @@ import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.apache.commons.collections.MultiHashMap;
+import org.apache.jetspeed.search.AbstractObjectHandler;
+import org.apache.jetspeed.search.BaseParsedObject;
+import org.apache.jetspeed.search.ParsedObject;
+import org.apache.jetspeed.search.SearchEngine;
+import org.apache.jetspeed.search.SearchResults;
 import org.apache.jetspeed.search.handlers.HandlerFactoryImpl;
 import org.apache.jetspeed.search.lucene.SearchEngineImpl;
 import org.apache.jetspeed.test.JetspeedTestCase;
@@ -78,7 +83,7 @@ public class TestPortletRegistrySearch e
         mapping.put("java.util.HashMap", MapObjectHandler.class.getName());
         HandlerFactoryImpl hfi = new HandlerFactoryImpl(mapping);
         directory = new RAMDirectory();
-        analyzer = new StandardAnalyzer(Version.LUCENE_30);
+        analyzer = new StandardAnalyzer(Version.LUCENE_29);
         searchEngine = new SearchEngineImpl(directory, analyzer, true, hfi);
     }
     

Copied: portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/TestSearch.java
(from r1086461, portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/TestSearch.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/TestSearch.java?p2=portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/TestSearch.java&p1=portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/TestSearch.java&r1=1086461&r2=1086464&rev=1086464&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/TestSearch.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-search/src/test/java/org/apache/jetspeed/search/lucene/TestSearch.java
Tue Mar 29 02:08:39 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jetspeed.search;
+package org.apache.jetspeed.search.lucene;
 
 import java.io.File;
 import java.net.URL;
@@ -24,6 +24,9 @@ import java.util.Iterator;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.apache.jetspeed.search.ParsedObject;
+import org.apache.jetspeed.search.SearchEngine;
+import org.apache.jetspeed.search.SearchResults;
 import org.apache.jetspeed.search.handlers.HandlerFactoryImpl;
 import org.apache.jetspeed.search.lucene.SearchEngineImpl;
 import org.apache.jetspeed.test.JetspeedTestCase;
@@ -56,7 +59,7 @@ public class TestSearch extends Jetspeed
         super(name);
         
         try {
-            jetspeedHomePage = getClass().getResource("jetspeed-1.txt");
+            jetspeedHomePage = getClass().getResource("/org/apache/jetspeed/search/jetspeed-1.txt");
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -64,7 +67,7 @@ public class TestSearch extends Jetspeed
         indexRoot = new File(getBaseDir()+INDEX_DIRECTORY);
         
         directory = new RAMDirectory();
-        analyzer = new StandardAnalyzer(Version.LUCENE_30);
+        analyzer = new StandardAnalyzer(Version.LUCENE_29);
     }
     
     /**
@@ -118,8 +121,8 @@ public class TestSearch extends Jetspeed
     {
         assertNotNull("Created URL to Jetspeed Home Page",  jetspeedHomePage);
         assertTrue("Adding to index", searchEngine.add(jetspeedHomePage));
-        assertTrue("Adding to index", searchEngine.add(getClass().getResource("supporting.txt")));
-        assertTrue("Adding to index", searchEngine.add(getClass().getResource("portals.txt")));
+        assertTrue("Adding to index", searchEngine.add(getClass().getResource("/org/apache/jetspeed/search/supporting.txt")));
+        assertTrue("Adding to index", searchEngine.add(getClass().getResource("/org/apache/jetspeed/search/portals.txt")));
     }
     
     /**

Modified: portals/jetspeed-2/portal/trunk/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/pom.xml?rev=1086464&r1=1086463&r2=1086464&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/pom.xml Tue Mar 29 02:08:39 2011
@@ -264,7 +264,8 @@
     
     <jdom.version>1.1</jdom.version>
     <log4j.version>1.2.14</log4j.version>
-    <lucene.version>3.0.2</lucene.version>
+    <lucene.version>2.9.3</lucene.version>
+    <solr.version>1.4.1</solr.version>
     <myfaces.version>1.1.5</myfaces.version>
     <ojb.version>1.0.3</ojb.version>
     <org.apache.derby.version>10.3.2.1</org.apache.derby.version>
@@ -780,6 +781,19 @@
         <artifactId>lucene-core</artifactId>
         <version>${lucene.version}</version>
       </dependency>
+      
+      <dependency>
+        <artifactId>solr-solrj</artifactId>
+        <groupId>org.apache.solr</groupId>
+        <version>${solr.version}</version>
+      </dependency>
+      
+      <dependency>
+        <groupId>org.apache.solr</groupId>
+        <artifactId>solr-core</artifactId>
+        <version>${solr.version}</version>
+      </dependency>
+      
       <dependency>
         <groupId>oro</groupId>
         <artifactId>oro</artifactId>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message