Return-Path: Delivered-To: apmail-incubator-connectors-commits-archive@minotaur.apache.org Received: (qmail 19116 invoked from network); 22 Jun 2010 18:57:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Jun 2010 18:57:38 -0000 Received: (qmail 68740 invoked by uid 500); 22 Jun 2010 18:57:38 -0000 Delivered-To: apmail-incubator-connectors-commits-archive@incubator.apache.org Received: (qmail 68693 invoked by uid 500); 22 Jun 2010 18:57:38 -0000 Mailing-List: contact connectors-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: connectors-dev@incubator.apache.org Delivered-To: mailing list connectors-commits@incubator.apache.org Received: (qmail 68686 invoked by uid 99); 22 Jun 2010 18:57:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 18:57:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 18:57:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 792272388980; Tue, 22 Jun 2010 18:56:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: connectors-commits@incubator.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100622185649.792272388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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)