Fix completion type
This commit is contained in:
parent
d88d96bf55
commit
fad481d822
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,8 @@ fos_elastica:
|
|||
type: integer
|
||||
store: false
|
||||
date: { boost: 5 }
|
||||
completion:
|
||||
type: completion
|
||||
title: { boost: 8, analyzer: my_analyzer }
|
||||
content: ~
|
||||
comments:
|
||||
|
|
Loading…
Reference in a new issue