manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1630885 - in /manifoldcf/trunk: CHANGES.txt connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
Date Fri, 10 Oct 2014 13:08:05 GMT
Author: kwright
Date: Fri Oct 10 13:08:05 2014
New Revision: 1630885

URL: http://svn.apache.org/r1630885
Log:
Fix for CONNECTORS-1066.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1630885&r1=1630884&r2=1630885&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Oct 10 13:08:05 2014
@@ -3,6 +3,11 @@ $Id$
 
 ======================= 2.0-dev =====================
 
+CONNECTORS-1066: Do not include blank or null fixed fields in Solr
+documents; also, provide facility to strip empty fields from general
+metadata in Metadata Adjuster.
+(Alessandro Benedetti, Shinichiro Abe, Karl Wright)
+
 CONNECTORS-1068: Enhancements for Document Filter transformation
 connector.
 (Karl Wright)

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java?rev=1630885&r1=1630884&r2=1630885&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
(original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
Fri Oct 10 13:08:05 2014
@@ -58,6 +58,7 @@ import org.apache.solr.common.SolrExcept
 import org.apache.solr.client.solrj.impl.HttpClientUtil;
 import org.apache.solr.common.SolrInputDocument;
 
+import org.apache.commons.lang.StringUtils;
 
 /**
 * Posts an input stream to SOLR
@@ -1008,7 +1009,7 @@ public class HttpPoster
       if ( fileNameAttributeName != null )
       {
         String fileName = document.getFileName();
-        if ( fileName != null )
+        if ( !StringUtils.isBlank(fileName) )
         {
           outputDoc.addField( fileNameAttributeName, fileName );
         }
@@ -1016,7 +1017,7 @@ public class HttpPoster
       if ( mimeTypeAttributeName != null )
       {
         String mimeType = document.getMimeType();
-        if ( mimeType != null )
+        if ( !StringUtils.isBlank(mimeType) )
         {
           outputDoc.addField( mimeTypeAttributeName, mimeType );
         }
@@ -1076,13 +1077,13 @@ public class HttpPoster
       if (fileNameAttributeName != null)
       {
         String fileName = document.getFileName();
-        if (fileName != null)
+        if (!StringUtils.isBlank(fileName))
           writeField(out,LITERAL+fileNameAttributeName,fileName);
       }
       if (mimeTypeAttributeName != null)
       {
         String mimeType = document.getMimeType();
-        if (mimeType != null)
+        if (!StringUtils.isBlank(mimeType))
           writeField(out,LITERAL+mimeTypeAttributeName,mimeType);
       }
           
@@ -1110,7 +1111,7 @@ public class HttpPoster
       //writeField(out,LITERAL+"stream_name",document.getFileName());
           
       // General hint for Tika
-      if (document.getFileName() != null)
+      if (!StringUtils.isBlank(document.getFileName()))
         writeField(out,"resource.name",document.getFileName());
           
       // Write the commitWithin parameter



Mime
View raw message