You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Luis Cappa Banda (JIRA)" <ji...@apache.org> on 2012/11/15 12:58:12 UTC

[jira] [Created] (SOLR-4080) SolrJ: CloudSolrServer atomic updates doesn´t work with Lists/Arrays (Objects, in general).

Luis Cappa Banda created SOLR-4080:
--------------------------------------

             Summary: SolrJ: CloudSolrServer atomic updates doesn´t 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 SolrServers with shards=1. solr-solrj artifact version 4.0.0 is used to execute atomic update operations.
            Reporter: Luis Cappa Banda


Atomic updates with a CloudServer object instance doesn´t work properly. 

- Code snippet:

// CloudSolrSever instance.
LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);

// SolrInputDocument to update: 
SolrInputDocument do = ne SolrInputDocument();
doc.addField("id", "myId");

Map<String, List<String>> operation = new HashMap<String, List<String>>();
operation.put("set", [[a list of String elements]]);  // I want a set operation to override field values.
doc.addField("fieldName", operation);

// Atomic update operation.
cloudSolrServer.add(doc); 


- Result:

doc: {
    id: "myId",
    fieldName: [ "{set=values}"
    ],

    ...
}

- Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() 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 an "add" operation happens.


CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object 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 administrators
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


[jira] [Updated] (SOLR-4080) SolrJ: CloudSolrServer atomic updates doesn´t work with Lists/Arrays (Objects, in general).

Posted by "Luis Cappa Banda (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luis Cappa Banda updated SOLR-4080:
-----------------------------------

    Description: 
Atomic updates with a CloudSolrServer object instance doesn´t work properly. 

- Code snippet:

// CloudSolrSever instance.
LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);

// SolrInputDocument to update: 
SolrInputDocument do = ne SolrInputDocument();
doc.addField("id", "myId");

Map<String, List<String>> operation = new HashMap<String, List<String>>();
operation.put("set", [[a list of String elements]]);  // I want a set operation to override field values.
doc.addField("fieldName", operation);

// Atomic update operation.
cloudSolrServer.add(doc); 


- Result:

doc: {
    id: "myId",
    fieldName: [ "{set=values}"
    ],

    ...
}

- Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() 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 an "add" operation happens.


CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object value passed is being processed with just a toString() method.



  was:
Atomic updates with a CloudServer object instance doesn´t work properly. 

- Code snippet:

// CloudSolrSever instance.
LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);

// SolrInputDocument to update: 
SolrInputDocument do = ne SolrInputDocument();
doc.addField("id", "myId");

Map<String, List<String>> operation = new HashMap<String, List<String>>();
operation.put("set", [[a list of String elements]]);  // I want a set operation to override field values.
doc.addField("fieldName", operation);

// Atomic update operation.
cloudSolrServer.add(doc); 


- Result:

doc: {
    id: "myId",
    fieldName: [ "{set=values}"
    ],

    ...
}

- Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() 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 an "add" operation happens.


CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object value passed is being processed with just a toString() method.



    
> SolrJ: CloudSolrServer atomic updates doesn´t 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 SolrServers with shards=1. solr-solrj artifact version 4.0.0 is used to execute atomic update operations.
>            Reporter: Luis Cappa Banda
>
> Atomic updates with a CloudSolrServer object instance doesn´t work properly. 
> - Code snippet:
> // CloudSolrSever instance.
> LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
> CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);
> // SolrInputDocument to update: 
> SolrInputDocument do = ne SolrInputDocument();
> doc.addField("id", "myId");
> Map<String, List<String>> operation = new HashMap<String, List<String>>();
> operation.put("set", [[a list of String elements]]);  // I want a set operation to override field values.
> doc.addField("fieldName", operation);
> // Atomic update operation.
> cloudSolrServer.add(doc); 
> - Result:
> doc: {
>     id: "myId",
>     fieldName: [ "{set=values}"
>     ],
>     ...
> }
> - Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() 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 an "add" operation happens.
> CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object 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 administrators
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


[jira] [Comment Edited] (SOLR-4080) SolrJ: CloudSolrServer atomic updates doesn´t work with Lists/Arrays (Objects, in general).

Posted by "Luis Cappa Banda (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498055#comment-13498055 ] 

Luis Cappa Banda edited comment on SOLR-4080 at 11/15/12 2:50 PM:
------------------------------------------------------------------

I´ve noticed that the same occurs using HttpSolrServer. However, if you set to HttpSolrServer instance the following Writers it works:

HttpSolrServer solrServer = new HttpSolrServer(...);
solrServer.setParser(new BinaryResponseParser());
solrServer.setRequestWriter(new BinaryRequestWriter());


I´ve tried to find a way to set those Writers via CloudServer or via LBHttpSolrServer but I found nothing.


                
      was (Author: luiscappa):
    I´ve noticed that the same occurrs using HttpSolrServer. However, if you set to HttpSolrServer instance the following Writers it works:

HttpSolrServer solrServer = new HttpSolrServer(...);
solrServer.setParser(new BinaryResponseParser());
solrServer.setRequestWriter(new BinaryRequestWriter());


I´ve tried to find a way to set those Writers via CloudServer or via LBHttpSolrServer but I found nothing.


                  
> SolrJ: CloudSolrServer atomic updates doesn´t 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 SolrServers with shards=1. solr-solrj artifact version 4.0.0 is used to execute atomic update operations.
>            Reporter: Luis Cappa Banda
>
> Atomic updates with a CloudServer object instance doesn´t work properly. 
> - Code snippet:
> // CloudSolrSever instance.
> LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
> CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);
> // SolrInputDocument to update: 
> SolrInputDocument do = ne SolrInputDocument();
> doc.addField("id", "myId");
> Map<String, List<String>> operation = new HashMap<String, List<String>>();
> operation.put("set", [[a list of String elements]]);  // I want a set operation to override field values.
> doc.addField("fieldName", operation);
> // Atomic update operation.
> cloudSolrServer.add(doc); 
> - Result:
> doc: {
>     id: "myId",
>     fieldName: [ "{set=values}"
>     ],
>     ...
> }
> - Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() 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 an "add" operation happens.
> CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object 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 administrators
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


[jira] [Comment Edited] (SOLR-4080) SolrJ: CloudSolrServer atomic updates doesn´t work with Lists/Arrays (Objects, in general).

Posted by "Luis Cappa Banda (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500983#comment-13500983 ] 

Luis Cappa Banda edited comment on SOLR-4080 at 11/20/12 10:46 AM:
-------------------------------------------------------------------

Creating a CloudSolrServer and setting it this custom LBHttpSolrServer solves the problem:


import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.impl.LBHttpSolrServer;

package com.example.custom.solr;

import java.net.MalformedURLException;

public class BinaryLBHttpSolrServer extends LBHttpSolrServer {

	private static final long serialVersionUID = 3905956120804659445L;
	
    public BinaryLBHttpSolrServer(String[] endpoints) throws MalformedURLException {
    	super(endpoints);
    }

    @Override
    protected HttpSolrServer makeServer(String server) throws MalformedURLException {
        HttpSolrServer solrServer = super.makeServer(server);
        solrServer.setRequestWriter(new BinaryRequestWriter());
        return solrServer;
    }
}

                
      was (Author: luiscappa):
    Creating a CloudSolrServer and setting it this custom LBHttpSolrServer the problem is resolved:


import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.impl.LBHttpSolrServer;

package com.example.custom.solr;

import java.net.MalformedURLException;

public class BinaryLBHttpSolrServer extends LBHttpSolrServer {

	private static final long serialVersionUID = 3905956120804659445L;
	
    public BinaryLBHttpSolrServer(String[] endpoints) throws MalformedURLException {
    	super(endpoints);
    }

    @Override
    protected HttpSolrServer makeServer(String server) throws MalformedURLException {
        HttpSolrServer solrServer = super.makeServer(server);
        solrServer.setRequestWriter(new BinaryRequestWriter());
        return solrServer;
    }
}

                  
> SolrJ: CloudSolrServer atomic updates doesn´t 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 SolrServers with shards=1. solr-solrj artifact version 4.0.0 is used to execute atomic update operations.
>            Reporter: Luis Cappa Banda
>
> Atomic updates with a CloudSolrServer object instance doesn´t work properly. 
> - Code snippet:
> // CloudSolrSever instance.
> LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
> CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);
> // SolrInputDocument to update: 
> SolrInputDocument do = ne SolrInputDocument();
> doc.addField("id", "myId");
> Map<String, List<String>> operation = new HashMap<String, List<String>>();
> operation.put("set", [[a list of String elements]]);  // I want a set operation to override field values.
> doc.addField("fieldName", operation);
> // Atomic update operation.
> cloudSolrServer.add(doc); 
> - Result:
> doc: {
>     id: "myId",
>     fieldName: [ "{set=values}"
>     ],
>     ...
> }
> - Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() 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 an "add" operation happens.
> CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object 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 administrators
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


[jira] [Updated] (SOLR-4080) SolrJ: CloudSolrServer atomic updates doesn´t work with Lists/Arrays (Objects, in general).

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yonik Seeley updated SOLR-4080:
-------------------------------

    Fix Version/s: 4.1
    
> SolrJ: CloudSolrServer atomic updates doesn´t 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 SolrServers with shards=1. solr-solrj artifact version 4.0.0 is used to execute atomic update operations.
>            Reporter: Luis Cappa Banda
>            Assignee: Yonik Seeley
>             Fix For: 4.1
>
>
> Atomic updates with a CloudSolrServer object instance doesn´t work properly. 
> - Code snippet:
> // CloudSolrSever instance.
> LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
> CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);
> // SolrInputDocument to update: 
> SolrInputDocument do = ne SolrInputDocument();
> doc.addField("id", "myId");
> Map<String, List<String>> operation = new HashMap<String, List<String>>();
> operation.put("set", [[a list of String elements]]);  // I want a set operation to override field values.
> doc.addField("fieldName", operation);
> // Atomic update operation.
> cloudSolrServer.add(doc); 
> - Result:
> doc: {
>     id: "myId",
>     fieldName: [ "{set=values}"
>     ],
>     ...
> }
> - Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() 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 an "add" operation happens.
> CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object 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 administrators
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


[jira] [Commented] (SOLR-4080) SolrJ: CloudSolrServer atomic updates doesn´t work with Lists/Arrays (Objects, in general).

Posted by "Luis Cappa Banda (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500983#comment-13500983 ] 

Luis Cappa Banda commented on SOLR-4080:
----------------------------------------

Creating a CloudSolrServer and setting it this custom LBHttpSolrServer the problem is resolved:


import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.impl.LBHttpSolrServer;

package com.example.custom.solr;

import java.net.MalformedURLException;

public class BinaryLBHttpSolrServer extends LBHttpSolrServer {

	private static final long serialVersionUID = 3905956120804659445L;
	
    public BinaryLBHttpSolrServer(String[] endpoints) throws MalformedURLException {
    	super(endpoints);
    }

    @Override
    protected HttpSolrServer makeServer(String server) throws MalformedURLException {
        HttpSolrServer solrServer = super.makeServer(server);
        solrServer.setRequestWriter(new BinaryRequestWriter());
        return solrServer;
    }
}

                
> SolrJ: CloudSolrServer atomic updates doesn´t 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 SolrServers with shards=1. solr-solrj artifact version 4.0.0 is used to execute atomic update operations.
>            Reporter: Luis Cappa Banda
>
> Atomic updates with a CloudSolrServer object instance doesn´t work properly. 
> - Code snippet:
> // CloudSolrSever instance.
> LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
> CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);
> // SolrInputDocument to update: 
> SolrInputDocument do = ne SolrInputDocument();
> doc.addField("id", "myId");
> Map<String, List<String>> operation = new HashMap<String, List<String>>();
> operation.put("set", [[a list of String elements]]);  // I want a set operation to override field values.
> doc.addField("fieldName", operation);
> // Atomic update operation.
> cloudSolrServer.add(doc); 
> - Result:
> doc: {
>     id: "myId",
>     fieldName: [ "{set=values}"
>     ],
>     ...
> }
> - Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() 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 an "add" operation happens.
> CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object 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 administrators
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


[jira] [Commented] (SOLR-4080) SolrJ: CloudSolrServer atomic updates doesn´t work with Lists/Arrays (Objects, in general).

Posted by "Luis Cappa Banda (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498055#comment-13498055 ] 

Luis Cappa Banda commented on SOLR-4080:
----------------------------------------

I´ve noticed that the same occurrs using HttpSolrServer. However, if you set to HttpSolrServer instance the following Writers it works:

HttpSolrServer solrServer = new HttpSolrServer(...);
solrServer.setParser(new BinaryResponseParser());
solrServer.setRequestWriter(new BinaryRequestWriter());


I´ve tried to find a way to set those Writers via CloudServer or via LBHttpSolrServer but I found nothing.


                
> SolrJ: CloudSolrServer atomic updates doesn´t 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 SolrServers with shards=1. solr-solrj artifact version 4.0.0 is used to execute atomic update operations.
>            Reporter: Luis Cappa Banda
>
> Atomic updates with a CloudServer object instance doesn´t work properly. 
> - Code snippet:
> // CloudSolrSever instance.
> LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
> CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);
> // SolrInputDocument to update: 
> SolrInputDocument do = ne SolrInputDocument();
> doc.addField("id", "myId");
> Map<String, List<String>> operation = new HashMap<String, List<String>>();
> operation.put("set", [[a list of String elements]]);  // I want a set operation to override field values.
> doc.addField("fieldName", operation);
> // Atomic update operation.
> cloudSolrServer.add(doc); 
> - Result:
> doc: {
>     id: "myId",
>     fieldName: [ "{set=values}"
>     ],
>     ...
> }
> - Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() 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 an "add" operation happens.
> CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object 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 administrators
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


[jira] [Assigned] (SOLR-4080) SolrJ: CloudSolrServer atomic updates doesn´t work with Lists/Arrays (Objects, in general).

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yonik Seeley reassigned SOLR-4080:
----------------------------------

    Assignee: Yonik Seeley
    
> SolrJ: CloudSolrServer atomic updates doesn´t 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 SolrServers with shards=1. solr-solrj artifact version 4.0.0 is used to execute atomic update operations.
>            Reporter: Luis Cappa Banda
>            Assignee: Yonik Seeley
>             Fix For: 4.1
>
>
> Atomic updates with a CloudSolrServer object instance doesn´t work properly. 
> - Code snippet:
> // CloudSolrSever instance.
> LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
> CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);
> // SolrInputDocument to update: 
> SolrInputDocument do = ne SolrInputDocument();
> doc.addField("id", "myId");
> Map<String, List<String>> operation = new HashMap<String, List<String>>();
> operation.put("set", [[a list of String elements]]);  // I want a set operation to override field values.
> doc.addField("fieldName", operation);
> // Atomic update operation.
> cloudSolrServer.add(doc); 
> - Result:
> doc: {
>     id: "myId",
>     fieldName: [ "{set=values}"
>     ],
>     ...
> }
> - Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() 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 an "add" operation happens.
> CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object 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 administrators
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