Fix completion type

This commit is contained in:
Tim Nagel 2014-07-23 20:00:14 +10:00
parent d88d96bf55
commit fad481d822
2 changed files with 15 additions and 3 deletions

View file

@ -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;
}
}
}
}

View file

@ -60,6 +60,8 @@ fos_elastica:
type: integer
store: false
date: { boost: 5 }
completion:
type: completion
title: { boost: 8, analyzer: my_analyzer }
content: ~
comments: