Skip to content

Commit 283ad5e

Browse files
author
Simonas Šerlinskas
committed
small updates and fixes
1 parent cc93c87 commit 283ad5e

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

DependencyInjection/Compiler/MappingPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class MappingPass implements CompilerPassInterface
2323
{
2424
/**
2525
* {@inheritdoc}
26+
* @throws \Exception
2627
*/
2728
public function process(ContainerBuilder $container)
2829
{

Mapping/DocumentParser.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use ONGR\ElasticsearchBundle\Annotation\Embedded;
1818
use ONGR\ElasticsearchBundle\Annotation\HashMap;
1919
use ONGR\ElasticsearchBundle\Annotation\MetaField;
20-
use ONGR\ElasticsearchBundle\Annotation\Nested;
20+
use ONGR\ElasticsearchBundle\Annotation\NestedType;
2121
use ONGR\ElasticsearchBundle\Annotation\ParentDocument;
2222
use ONGR\ElasticsearchBundle\Annotation\Property;
2323
use ONGR\ElasticsearchBundle\Exception\MissingDocumentAnnotationException;
@@ -30,8 +30,8 @@ class DocumentParser
3030
const PROPERTY_ANNOTATION = 'ONGR\ElasticsearchBundle\Annotation\Property';
3131
const EMBEDDED_ANNOTATION = 'ONGR\ElasticsearchBundle\Annotation\Embedded';
3232
const DOCUMENT_ANNOTATION = 'ONGR\ElasticsearchBundle\Annotation\Document';
33-
const OBJECT_ANNOTATION = 'ONGR\ElasticsearchBundle\Annotation\Object';
34-
const NESTED_ANNOTATION = 'ONGR\ElasticsearchBundle\Annotation\Nested';
33+
const OBJECT_ANNOTATION = 'ONGR\ElasticsearchBundle\Annotation\ObjectType';
34+
const NESTED_ANNOTATION = 'ONGR\ElasticsearchBundle\Annotation\NestedType';
3535

3636
// Meta fields
3737
const ID_ANNOTATION = 'ONGR\ElasticsearchBundle\Annotation\Id';
@@ -398,8 +398,8 @@ private function registerAnnotations()
398398
'Document',
399399
'Property',
400400
'Embedded',
401-
'Object',
402-
'Nested',
401+
'ObjectType',
402+
'NestedType',
403403
'Id',
404404
'ParentDocument',
405405
'Routing',
@@ -547,7 +547,7 @@ private function getProperties(\ReflectionClass $reflectionClass, $properties =
547547
// HashMap object
548548
if ($type instanceof HashMap) {
549549
$map = array_replace_recursive($map, [
550-
'type' => Nested::NAME,
550+
'type' => NestedType::NAME,
551551
'dynamic' => true,
552552
]);
553553
}
@@ -595,7 +595,7 @@ private function getObjectMapping($className, $directory)
595595
default:
596596
throw new \LogicException(
597597
sprintf(
598-
'%s should have @Object or @Nested annotation to be used as embeddable object.',
598+
'%s should have @ObjectType or @NestedType annotation to be used as embeddable object.',
599599
$className
600600
)
601601
);

Resources/doc/mapping.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ namespace AppBundle\Document;
275275
use ONGR\ElasticsearchBundle\Annotation as ES;
276276
277277
/**
278-
* @ES\Object
278+
* @ES\ObjectType
279279
*/
280280
class CategoryObject
281281
{
@@ -399,7 +399,7 @@ namespace AppBundle\Document;
399399
use ONGR\ElasticsearchBundle\Annotation as ES;
400400
401401
/**
402-
* @ES\Object
402+
* @ES\ObjectType
403403
*/
404404
class VariantObject
405405
{
@@ -434,9 +434,9 @@ Insert action will look like this:
434434

435435
> There is no bounds to define other objects within objects.
436436

437-
> Nested types can be defined the same way as objects, except `@ES\Nested` annotation must be used.
437+
> Nested types can be defined the same way as objects, except `@ES\NestedType` annotation must be used.
438438

439-
The difference between `@ES\Embedded` and `@ES\Nested` is in the way that the Elasticsearch indexes them.
439+
The difference between `@ES\Embedded` and `@ES\NestedType` is in the way that the Elasticsearch indexes them.
440440
While the values of the fields in embedded objects are extracted and put into the same array with all the other
441441
values of other embedded objects in the same field, during the indexation process, the values of the fields of
442442
nested objects stored separately. This introduces differences when querying and filtering the index.

Result/Converter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace ONGR\ElasticsearchBundle\Result;
1313

1414
use Doctrine\Common\Collections\Collection;
15-
use ONGR\ElasticsearchBundle\Annotation\Nested;
16-
use ONGR\ElasticsearchBundle\Annotation\Object;
15+
use ONGR\ElasticsearchBundle\Annotation\NestedType;
16+
use ONGR\ElasticsearchBundle\Annotation\ObjectType;
1717
use ONGR\ElasticsearchBundle\Mapping\MetadataCollector;
1818
use ONGR\ElasticsearchBundle\Service\Manager;
1919

@@ -104,8 +104,8 @@ public function assignArrayToObject(array $array, $object, array $aliases)
104104
$value = new \DateTime($value);
105105
}
106106
break;
107-
case Object::NAME:
108-
case Nested::NAME:
107+
case ObjectType::NAME:
108+
case NestedType::NAME:
109109
if ($aliases[$name]['multiple']) {
110110
$value = new ObjectIterator($this, $value, $aliases[$name]);
111111
} else {

Service/ManagerFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function createManager($managerName, $connection, $analysis, $managerConf
102102

103103
$client = ClientBuilder::create();
104104
$client->setHosts($connection['hosts']);
105-
$client->setTracer($this->tracer);
105+
$this->tracer && $client->setTracer($this->tracer);
106106

107107
if ($this->logger && $managerConfig['logger']['enabled']) {
108108
$client->setLogger($this->logger);

0 commit comments

Comments
 (0)