Merge pull request #671 from merk/completion-type-fix
Fix completion type
This commit is contained in:
commit
9fbc622929
|
@ -16,6 +16,13 @@ use FOS\ElasticaBundle\Configuration\TypeConfig;
|
||||||
|
|
||||||
class MappingBuilder
|
class MappingBuilder
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Skip adding default information to certain fields.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $skipTypes = array('completion');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds mappings for an entire index.
|
* Builds mappings for an entire index.
|
||||||
*
|
*
|
||||||
|
@ -85,12 +92,15 @@ class MappingBuilder
|
||||||
if (!isset($property['type'])) {
|
if (!isset($property['type'])) {
|
||||||
$property['type'] = 'string';
|
$property['type'] = 'string';
|
||||||
}
|
}
|
||||||
if (!isset($property['store'])) {
|
|
||||||
$property['store'] = true;
|
|
||||||
}
|
|
||||||
if (isset($property['properties'])) {
|
if (isset($property['properties'])) {
|
||||||
$this->fixProperties($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
|
type: integer
|
||||||
store: false
|
store: false
|
||||||
date: { boost: 5 }
|
date: { boost: 5 }
|
||||||
|
completion:
|
||||||
|
type: completion
|
||||||
title: { boost: 8, analyzer: my_analyzer }
|
title: { boost: 8, analyzer: my_analyzer }
|
||||||
content: ~
|
content: ~
|
||||||
comments:
|
comments:
|
||||||
|
|
Loading…
Reference in a new issue