Adding support for enabling timestamps
This commit is contained in:
parent
d33c5d0ece
commit
4ee81dc010
|
@ -299,6 +299,7 @@ class Configuration implements ConfigurationInterface
|
|||
->append($this->getRoutingNode())
|
||||
->append($this->getParentNode())
|
||||
->append($this->getAllNode())
|
||||
->append($this->getTimestampNode())
|
||||
->end()
|
||||
;
|
||||
|
||||
|
@ -647,4 +648,23 @@ class Configuration implements ConfigurationInterface
|
|||
|
||||
return $node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the array node used for "_timestamp"
|
||||
*/
|
||||
protected function getTimestampNode()
|
||||
{
|
||||
$builder = new TreeBuilder();
|
||||
$node = $builder->root('_timestamp');
|
||||
|
||||
$node
|
||||
->children()
|
||||
->scalarNode('enabled')->defaultValue(true)->end()
|
||||
->scalarNode('path')->end()
|
||||
->scalarNode('format')->end()
|
||||
->end()
|
||||
;
|
||||
|
||||
return $node;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -246,6 +246,9 @@ class FOSElasticaExtension extends Extension
|
|||
if (isset($type['_all'])) {
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_all'] = $type['_all'];
|
||||
}
|
||||
if (isset($type['_timestamp'])) {
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_timestamp'] = $type['_timestamp'];
|
||||
}
|
||||
if (!empty($type['dynamic_templates'])) {
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['dynamic_templates'] = array();
|
||||
foreach ($type['dynamic_templates'] as $templateName => $templateData) {
|
||||
|
|
Loading…
Reference in a new issue