Drupal solr: Update specific document directly to solr index.
Problem: How to update specific solr index document. Requirement: Drupal 7.x Search API Solr Search Solr server should enabled and running(Version 4.9 or more) CURL Solution: $update = array( 'id' => '',// Document id "field_name" => array( 'set' => ''//Value ) ); $update = json_encode(array($update)); $ch = curl_init('http://localhost:8983/solr/collection1/update?commit=true'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $update); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); $output = json_decode(curl_exec($ch)); $responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($responseCode == 200) { echo 'SOLR: Updated successfully for id:' . $doc_id . ' (query time: ' . $output->responseHeader->QTime . 'ms).<br>'; } else...