You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Scott Lindner (JIRA)" <ji...@apache.org> on 2014/05/07 09:47:22 UTC

[jira] [Commented] (SOLR-6046) Atomic Updates using a String[] for multiple values do not work unless you are using the BinaryRequestWriter

    [ https://issues.apache.org/jira/browse/SOLR-6046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13991559#comment-13991559 ] 

Scott Lindner commented on SOLR-6046:
-------------------------------------

So the issue here is with the following code in ClientUtils.java in the writeXML function:

{code}
            if (v instanceof Collection) {
              Collection values = (Collection) v;
              for (Object value : values) {
                writeVal(writer, boost, name, value, update);
                boost = 1.0f;
              }
            } else {
              writeVal(writer, boost, name, v, update);
              boost = 1.0f;
            }
{code}

Because only Collection is handled and not String[] so this falls back to toString().

> Atomic Updates using a String[] for multiple values do not work unless you are using the BinaryRequestWriter
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-6046
>                 URL: https://issues.apache.org/jira/browse/SOLR-6046
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.8
>            Reporter: Scott Lindner
>
> This is related to https://issues.apache.org/jira/browse/SOLR-6045, but somewhat in reverse.
> In this case I am using the OOB request/response writers and trying to use atomic updates.
> The following code for the field (see referenced jira for full code example) does not work:
> {code}
>         Map<String, String[]> fieldModifier = Maps.newHashMap();
>         fieldModifier.put("set", new String[] { "new_value1", "new_value2" });
>         sid.addField("field1", fieldModifier);
> {code}
> as it results in the index returning:
> {noformat}
> "field1": [
>           "[Ljava.lang.String;@162d4ea3"
>         ],
> {noformat}
> However if I modify the above code to use the BinaryRequestWriter then everything works just fine.
> Also, if I modify the above code to use a List<String> instead of a String[] then that works fine with the OOB RequestWriter as well.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org