Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 07BF2D732 for ; Thu, 15 Nov 2012 14:50:16 +0000 (UTC) Received: (qmail 52768 invoked by uid 500); 15 Nov 2012 14:50:13 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 52339 invoked by uid 500); 15 Nov 2012 14:50:13 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 52308 invoked by uid 99); 15 Nov 2012 14:50:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2012 14:50:12 +0000 Date: Thu, 15 Nov 2012 14:50:12 +0000 (UTC) From: "Luis Cappa Banda (JIRA)" To: dev@lucene.apache.org Message-ID: <2088644407.119464.1352991012298.JavaMail.jiratomcat@arcas> In-Reply-To: <315836691.118771.1352980692142.JavaMail.jiratomcat@arcas> Subject: =?utf-8?Q?[jira]_[Commented]_(SOLR-4080)_SolrJ:_CloudSolrServer_atomic_?= =?utf-8?Q?updates_doesn=C2=B4t_work_with_List?= =?utf-8?Q?s/Arrays_(Objects,_in_general).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-4080?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13498= 055#comment-13498055 ]=20 Luis Cappa Banda commented on SOLR-4080: ---------------------------------------- I=C2=B4ve noticed that the same occurrs using HttpSolrServer. However, if y= ou set to HttpSolrServer instance the following Writers it works: HttpSolrServer solrServer =3D new HttpSolrServer(...); solrServer.setParser(new BinaryResponseParser()); solrServer.setRequestWriter(new BinaryRequestWriter()); I=C2=B4ve tried to find a way to set those Writers via CloudServer or via L= BHttpSolrServer but I found nothing. =20 > SolrJ: CloudSolrServer atomic updates doesn=C2=B4t work with Lists/Arrays= (Objects, in general). > -------------------------------------------------------------------------= ------------------ > > Key: SOLR-4080 > URL: https://issues.apache.org/jira/browse/SOLR-4080 > Project: Solr > Issue Type: Bug > Components: SolrCloud > Affects Versions: 4.0 > Environment: Solr 4.0 with SolrCloud deployed with two SolrServer= s with shards=3D1. solr-solrj artifact version 4.0.0 is used to execute ato= mic update operations. > Reporter: Luis Cappa Banda > > Atomic updates with a CloudServer object instance doesn=C2=B4t work prope= rly.=20 > - Code snippet: > // CloudSolrSever instance. > LBHttpSolrServer lbSolrServer =3D new LBHttpSolrServer(solrEndpoints); > CloudSolrServer cloudSolrServer =3D new CloudSolrServer(zookeeperEndpoint= s, lbSolrServer); > // SolrInputDocument to update:=20 > SolrInputDocument do =3D ne SolrInputDocument(); > doc.addField("id", "myId"); > Map> operation =3D new HashMap>= (); > operation.put("set", [[a list of String elements]]); // I want a set ope= ration to override field values. > doc.addField("fieldName", operation); > // Atomic update operation. > cloudSolrServer.add(doc);=20 > - Result: > doc: { > id: "myId", > fieldName: [ "{set=3Dvalues}" > ], > ... > } > - Changing map from snippet like Map operation =3D new HashMap() instead = of Map> operation =3D new HashMap= >() obtains the following result after the atomic update: > doc: { > id: "myId", > fieldName: ["[Value1, Value2]" > ], > ... > } > - Also, the old value is never erased, and instead of a "set" operation a= n "add" operation happens. > CONCLUSION: during an atomic update with CloudSolrServer the List/Array/O= bject value passed is being processed with just a toString() method. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org