我是solr中的新手并且我一直在使用此线程进行原子更新
How do I update a document in Solr PHP?
基本上我正在做一个mysql查询然后在solr上更新文档
问题:如何在特定字段与字段匹配的情况下进行原子更新应该在if语句中匹配,如下所示:
MyDate = i.Products.OrderBy(x => x.Date).Select(x => x.Date).FirstOrDefault();
到目前为止,我的代码很乱:
if(solr(username.field) == 'john'))
{
//execute atomic update
}
答案 0 :(得分:0)
应该是
if(!empty($response->response->docs[$x]->username->values[$x]) == get_product($row['USERNAME']))
{
$doc = $response->response->docs[$x]->getInputDocument();
$second_doc->addField('point', $row['POINT']);
}
else
{
//do other update here
}
//$response->response->docs[$x]->username->values[$x] => get the usernames in the document