我在MySql中有一个大数据库,并尝试导入新核心中的所有数据。 我写了一个脚本,其中cUrl调用data-import命令
$url = 'http://localhost:8080/solr/products/dataimport';
$fields = array(
'debug' => false,
'commit' => true,
'command' => 'full-import',
'optimize' => false,
'indent' => true,
'rows' => $count,
'start' => $start,
'verbose' => false,
'clean' => $cleanSolr, // true at first time and false after it
'wt' => 'json',
);
$url = 'http://localhost:8080/solr/products/dataimport?' . http_build_query($fields);
error_log($url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
但是,clean = true
和clean = false