added index_analyzer and search_analyzer type options
This commit is contained in:
parent
836481aff7
commit
ae80e3e4f3
|
@ -77,6 +77,8 @@ class Configuration
|
|||
->end()
|
||||
->arrayNode('type_prototype')
|
||||
->children()
|
||||
->scalarNode('index_analyzer')->end()
|
||||
->scalarNode('search_analyzer')->end()
|
||||
->arrayNode('persistence')
|
||||
->validate()
|
||||
->ifTrue(function($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['listener']); })
|
||||
|
@ -153,6 +155,8 @@ class Configuration
|
|||
->prototype('array')
|
||||
->treatNullLike(array())
|
||||
->children()
|
||||
->scalarNode('index_analyzer')->end()
|
||||
->scalarNode('search_analyzer')->end()
|
||||
->arrayNode('persistence')
|
||||
->validate()
|
||||
->ifTrue(function($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['listener']); })
|
||||
|
|
|
@ -168,16 +168,20 @@ class FOQElasticaExtension extends Extension
|
|||
$typeDef->setFactoryMethod('getType');
|
||||
$container->setDefinition($typeId, $typeDef);
|
||||
if (isset($type['_source'])) {
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_source'] = $type['_source'];
|
||||
|
||||
}
|
||||
if (isset($type['mappings'])) {
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['properties'] = $type['mappings'];
|
||||
$typeName = sprintf('%s/%s', $indexName, $name);
|
||||
$this->typeFields[$typeName] = array_keys($type['mappings']);
|
||||
unset($type['mappings']);
|
||||
}
|
||||
if (isset($type['persistence'])) {
|
||||
$this->loadTypePersistenceIntegration($type['persistence'], $container, $typeDef, $indexName, $name);
|
||||
unset($type['persistence']);
|
||||
}
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name] = array_merge(
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name], $type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue