incubator-droids-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r712511 - in /incubator/droids/trunk: ./ depot/solr/ droids-solr/ droids-solr/src/java/ droids-solr/src/main/ droids-solr/src/main/java/ droids-solr/src/main/java/org/apache/droids/solr/ droids-solr/src/main/resources/ droids-solr/src/test/...
Date Sun, 09 Nov 2008 16:49:50 GMT
Author: ryan
Date: Sun Nov  9 08:49:50 2008
New Revision: 712511

URL: http://svn.apache.org/viewvc?rev=712511&view=rev
Log:
move droids-solr out of depot into maven layout

Added:
    incubator/droids/trunk/droids-solr/   (props changed)
      - copied from r712507, incubator/droids/trunk/depot/solr/
    incubator/droids/trunk/droids-solr/src/main/
    incubator/droids/trunk/droids-solr/src/main/java/   (props changed)
      - copied from r712507, incubator/droids/trunk/depot/solr/src/java/
    incubator/droids/trunk/droids-solr/src/main/resources/
    incubator/droids/trunk/droids-solr/src/test/java/
    incubator/droids/trunk/droids-solr/src/test/java/org/   (props changed)
      - copied from r712507, incubator/droids/trunk/depot/solr/src/test/org/
    incubator/droids/trunk/droids-solr/src/test/resources/
Removed:
    incubator/droids/trunk/depot/solr/
    incubator/droids/trunk/droids-solr/DROIDS-README.txt
    incubator/droids/trunk/droids-solr/default.properties
    incubator/droids/trunk/droids-solr/ivy.xml
    incubator/droids/trunk/droids-solr/src/java/
    incubator/droids/trunk/droids-solr/src/test/org/
Modified:
    incubator/droids/trunk/droids-solr/src/main/java/org/apache/droids/solr/SolrHandler.java
    incubator/droids/trunk/pom.xml

Propchange: incubator/droids/trunk/droids-solr/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Nov  9 08:49:50 2008
@@ -0,0 +1,2 @@
+build
+lib

Propchange: incubator/droids/trunk/droids-solr/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: incubator/droids/trunk/droids-solr/src/main/java/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: incubator/droids/trunk/droids-solr/src/main/java/org/apache/droids/solr/SolrHandler.java
URL: http://svn.apache.org/viewvc/incubator/droids/trunk/droids-solr/src/main/java/org/apache/droids/solr/SolrHandler.java?rev=712511&r1=712507&r2=712511&view=diff
==============================================================================
--- incubator/droids/trunk/droids-solr/src/main/java/org/apache/droids/solr/SolrHandler.java
(original)
+++ incubator/droids/trunk/droids-solr/src/main/java/org/apache/droids/solr/SolrHandler.java
Sun Nov  9 08:49:50 2008
@@ -16,12 +16,15 @@
  */
 package org.apache.droids.solr;
 
+import java.io.IOException;
 import java.io.InputStream;
-import java.net.URL;
+import java.net.URI;
 
 import org.apache.droids.api.Handler;
 import org.apache.droids.api.Parse;
+import org.apache.droids.exception.DroidsException;
 import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.common.SolrInputDocument;
 
 
@@ -29,17 +32,23 @@
 
   private SolrServer solr;
 
-  public void handle(InputStream openStream, URL url, Parse parse) throws Exception 
+  public void handle(InputStream openStream, URI url, Parse parse) 
+    throws IOException, DroidsException 
   {
     SolrInputDocument doc = createSolrInputDocument(url, parse);
-    solr.add( doc );
+    try {
+      solr.add( doc );
+    } 
+    catch (SolrServerException e) {
+      throw new DroidsException( e );
+    }
   }
 
-  public SolrInputDocument createSolrInputDocument(URL url, Parse parse) 
+  public SolrInputDocument createSolrInputDocument(URI url, Parse parse) 
   { 
     SolrInputDocument doc = new SolrInputDocument();
     doc.setField( "id", url.getPath() );
-    doc.setField( "name", url.getFile() );
+    doc.setField( "name", url.toASCIIString() );
     doc.setField( "host", url.getHost() );
     doc.setField( "content", parse.getText() );
     return doc;

Propchange: incubator/droids/trunk/droids-solr/src/test/java/org/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: incubator/droids/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/droids/trunk/pom.xml?rev=712511&r1=712510&r2=712511&view=diff
==============================================================================
--- incubator/droids/trunk/pom.xml (original)
+++ incubator/droids/trunk/pom.xml Sun Nov  9 08:49:50 2008
@@ -134,6 +134,8 @@
     <module>droids-norobots</module>
     <module>droids-core</module>
     <module>depot/dynamic</module>
+    <module>droids-solr</module>
+
   </modules>
 
 </project>



Mime
View raw message