update:
$solr = new Solarium\Client($config);
$update = $solr->createUpdate();
$data = ['要更新到solr的数据'];
$doc = $update->createDocument();
foreach($data as $key => $value){
$doc->$key = $value;
}
$update->addDocument($doc);
$update->addCommit();
$result = $solr->update($update);
select:
$solr = new Solarium\Client($config);
$query = $solr->createSelect();
$search_time = date('YmdHis', time()-90*24*3600);
$condition .= ' AND create_time:['.$search_time.' TO * ]';
$query->setQuery($condition);
$query->setFields(['id']);
$query->addSort($sort_key, $sort_asc?$query::SORT_ASC:$query::SORT_DESC);
$result = $solr->select($query);//查询的结果
$numFound = $result->getNumFound();//查询到的记录条数
delete:
$solr = new Solarium\Client($config);
$update = $solr->createUpdate();
$update->addDeleteById($id);//通过id
//$update->addDeleteQuery($q);//通过查询条件
$update->addCommit();
$result = $solr->update($update);