You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by sara hajili <ha...@gmail.com> on 2015/09/05 14:00:08 UTC

Fwd: atomic update in solr with pysolr(python client)

hi
have any idea about implement atomic update with pysolr.?
i found this in solrJ:
HttpSolrClient client = new HttpSolrClient("http://localhost:8983/solr");

// create the document
SolrInputDocument sdoc = new SolrInputDocument();
sdoc.addField("id","book1");
Map<String,Object> fieldModifier = new HashMap<>(1);
fieldModifier.put("add","Cyberpunk");
sdoc.addField("cat", fieldModifier);  // add the map as the field value

client.add( sdoc );  // send it to the solr server

client.close();  // shutdown client before we exit

how i implement this in pysolr?

conn = pysolr.Solr('http://localhost:8983/solr/post')

docs=[{'id':'post1','title':'this is a test','member_id':{"inc":12}}]

conn.add(docs)
this throw an error in :

member_id':{"inc":12}

any idea to implement atomic update?to increament just member_id field