incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r956976 - /incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java
Date Tue, 22 Jun 2010 18:56:49 GMT
Author: kwright
Date: Tue Jun 22 18:56:49 2010
New Revision: 956976

URL: http://svn.apache.org/viewvc?rev=956976&view=rev
Log:
Hack, to make sure 'id' metadata doesn't conflict with the LCF 'id'.  The 'id' metadata now
gets mapped to 'lcf_metadata_id'.  This hack will be cleaned up with CONNECTORS-49.

Modified:
    incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java

Modified: incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java?rev=956976&r1=956975&r2=956976&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java
(original)
+++ incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java
Tue Jun 22 18:56:49 2010
@@ -68,6 +68,7 @@ public class HttpPoster
 
   private static final String LITERAL = "literal.";
   private static final String NOTHING = "__NOTHING__";
+  private static final String ID_METADATA = "lcf_metadata_id";
     
   private int buffersize = 32768;  // default buffer size
   double sizeCoefficient = 0.0005;    // 20 ms additional timeout per 2000 bytes, pulled
out of my butt
@@ -966,6 +967,8 @@ public class HttpPoster
                 {
                   String fieldName = (String)iter.next();
                   Object[] values = document.getField(fieldName);
+		  if (fieldName.toLowerCase().equals("id"))
+		    fieldName = ID_METADATA;
                   // We only handle strings right now!!!
                   int k = 0;
                   while (k < values.length)
@@ -1022,6 +1025,8 @@ public class HttpPoster
                 {
                   String fieldName = (String)iter.next();
                   Object[] values = document.getField(fieldName);
+		  if (fieldName.toLowerCase().equals("id"))
+		    fieldName = ID_METADATA;
                   // We only handle strings right now!!!
                   int k = 0;
                   while (k < values.length)



Mime
View raw message