0

I've created a watson rank and retrieve collection. I was able to add a document and I can search it, but it was a test document. How do I delete it?

This is what I want to delete:

// add a document
var doc = { id : 1234, title_t : 'Hello', text_field_s: 'some text' };
solrClient.add(doc, function(err) {
  if(err) {
    console.log('Error indexing document: ' + err);
  } else {
    console.log('Indexed a document.');
    solrClient.commit(function(err) {
      if(err) {
        console.log('Error committing change: ' + err);
      } else {
        console.log('Successfully commited changes.');
      }
    });
  }
});
user269964
  • 159
  • 11

1 Answers1

0
solrClient.deleteByID(1234, function(err) {
    solrClient.commit(function (err) {
        // obviously add error-handling
    });
});
dalelane
  • 2,746
  • 1
  • 24
  • 27