diff --git a/Index/MappingBuilder.php b/Index/MappingBuilder.php index f3474be..fc67420 100644 --- a/Index/MappingBuilder.php +++ b/Index/MappingBuilder.php @@ -16,6 +16,13 @@ use FOS\ElasticaBundle\Configuration\TypeConfig; class MappingBuilder { + /** + * Skip adding default information to certain fields. + * + * @var array + */ + private $skipTypes = array('completion'); + /** * Builds mappings for an entire index. * @@ -85,12 +92,15 @@ class MappingBuilder if (!isset($property['type'])) { $property['type'] = 'string'; } - if (!isset($property['store'])) { - $property['store'] = true; - } if (isset($property['properties'])) { $this->fixProperties($property['properties']); } + if (in_array($property['type'], $this->skipTypes)) { + continue; + } + if (!isset($property['store'])) { + $property['store'] = true; + } } } } diff --git a/Tests/Functional/app/Basic/config.yml b/Tests/Functional/app/Basic/config.yml index 3552b3d..607e3cc 100644 --- a/Tests/Functional/app/Basic/config.yml +++ b/Tests/Functional/app/Basic/config.yml @@ -60,6 +60,8 @@ fos_elastica: type: integer store: false date: { boost: 5 } + completion: + type: completion title: { boost: 8, analyzer: my_analyzer } content: ~ comments: