gsf/node-solr — Issue #16: commit after add in sample
Author: SergeyKashulin
Created: 2012-03-06 12:46:16+00:00
State: open

var client = solr.createClient();
var doc = {
id: '1',
title_t: 'Foo bar',
text_t: 'Fizz buzz frizzle'
};
var callback = function(err, response) {
if (err) throw err;
console.log('Document added');
client.commit();
};
client.add(doc1, callback);
client.add(doc2, callback);