Commit 747a3ea7 authored by Bas de Nooijer's avatar Bas de Nooijer

Merge pull request #188 from andrelemos/develop

Upgrade to beat the rule of solr ...
parents c2eb9af5 5115cef0
...@@ -199,7 +199,7 @@ class Document extends AbstractDocument implements DocumentInterface ...@@ -199,7 +199,7 @@ class Document extends AbstractDocument implements DocumentInterface
*/ */
public function setField($key, $value, $boost = null, $modifier = null) public function setField($key, $value, $boost = null, $modifier = null)
{ {
if ($value === null) { if ($value === null && $modifier == null) {
$this->removeField($key); $this->removeField($key);
} else { } else {
$this->fields[$key] = $value; $this->fields[$key] = $value;
......
...@@ -169,6 +169,9 @@ class RequestBuilder extends BaseRequestBuilder ...@@ -169,6 +169,9 @@ class RequestBuilder extends BaseRequestBuilder
$xml = '<field name="' . $name . '"'; $xml = '<field name="' . $name . '"';
$xml .= $this->attrib('boost', $boost); $xml .= $this->attrib('boost', $boost);
$xml .= $this->attrib('update', $modifier); $xml .= $this->attrib('update', $modifier);
if($value === null){
$xml .= $this->attrib('null', 'true');
}
$xml .= '>' . htmlspecialchars($value, ENT_NOQUOTES, 'UTF-8'); $xml .= '>' . htmlspecialchars($value, ENT_NOQUOTES, 'UTF-8');
$xml .= '</field>'; $xml .= '</field>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment