|
@@ -514,8 +514,7 @@ discard block |
|
|
block discarded – undo |
|
514
|
514
|
// this goes to elastica service |
|
515
|
515
|
$this->service->remove($this->owner); |
|
516
|
516
|
} |
|
517
|
|
- } |
|
518
|
|
- catch (\Elastica\Exception\NotFoundException $e) { |
|
|
517
|
+ } catch (\Elastica\Exception\NotFoundException $e) { |
|
519
|
518
|
trigger_error("Deleted document " . $this->owner->ClassName . " (" . $this->owner->ID . |
|
520
|
519
|
") not found in search index.", E_USER_NOTICE); |
|
521
|
520
|
} |
|
@@ -533,7 +532,9 @@ discard block |
|
|
block discarded – undo |
|
533
|
532
|
$fields = \Config::inst()->get(get_class($this->owner), 'searchable_fields'); |
|
534
|
533
|
|
|
535
|
534
|
// fallback to default method |
|
536
|
|
- if(!$fields) user_error('The field $searchable_fields must be set for the class ' . $this->owner->ClassName); |
|
|
535
|
+ if(!$fields) { |
|
|
536
|
+ user_error('The field $searchable_fields must be set for the class ' . $this->owner->ClassName); |
|
|
537
|
+ } |
|
537
|
538
|
|
|
538
|
539
|
// get the values of these fields |
|
539
|
540
|
$elasticaMapping = $this->fieldsToElasticaConfig($fields); |
|
@@ -554,7 +555,9 @@ discard block |
|
|
block discarded – undo |
|
554
|
555
|
|
|
555
|
556
|
$relClass = $has_lists[$methodName]; |
|
556
|
557
|
$fields = \Config::inst()->get($relClass, 'searchable_fields'); |
|
557
|
|
- if(!$fields) user_error('The field $searchable_fields must be set for the class ' . $relClass); |
|
|
558
|
+ if(!$fields) { |
|
|
559
|
+ user_error('The field $searchable_fields must be set for the class ' . $relClass); |
|
|
560
|
+ } |
|
558
|
561
|
$rewrite = $this->fieldsToElasticaConfig($fields); |
|
559
|
562
|
|
|
560
|
563
|
// mark as a method, the resultant fields are correct |
|
@@ -562,7 +565,9 @@ discard block |
|
|
block discarded – undo |
|
562
|
565
|
} else if(isset($has_ones[$methodName])) { |
|
563
|
566
|
$relClass = $has_ones[$methodName]; |
|
564
|
567
|
$fields = \Config::inst()->get($relClass, 'searchable_fields'); |
|
565
|
|
- if(!$fields) user_error('The field $searchable_fields must be set for the class ' . $relClass); |
|
|
568
|
+ if(!$fields) { |
|
|
569
|
+ user_error('The field $searchable_fields must be set for the class ' . $relClass); |
|
|
570
|
+ } |
|
566
|
571
|
$rewrite = $this->fieldsToElasticaConfig($fields); |
|
567
|
572
|
|
|
568
|
573
|
// mark as a method, the resultant fields are correct |