Merge pull request #203 from micjohnson/patch-3
Adding _routing to type configuration
This commit is contained in:
commit
bfb0f823c1
|
@ -248,6 +248,7 @@ class Configuration
|
||||||
->append($this->getMappingsNode())
|
->append($this->getMappingsNode())
|
||||||
->append($this->getSourceNode())
|
->append($this->getSourceNode())
|
||||||
->append($this->getBoostNode())
|
->append($this->getBoostNode())
|
||||||
|
->append($this->getRoutingNode())
|
||||||
->end()
|
->end()
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -374,4 +375,22 @@ class Configuration
|
||||||
|
|
||||||
return $node;
|
return $node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the array node used for "_routing".
|
||||||
|
*/
|
||||||
|
protected function getRoutingNode()
|
||||||
|
{
|
||||||
|
$builder = new TreeBuilder();
|
||||||
|
$node = $builder->root('_routing');
|
||||||
|
|
||||||
|
$node
|
||||||
|
->children()
|
||||||
|
->scalarNode('required')->end()
|
||||||
|
->scalarNode('path')->end()
|
||||||
|
->end()
|
||||||
|
;
|
||||||
|
|
||||||
|
return $node;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,6 +174,9 @@ class FOQElasticaExtension extends Extension
|
||||||
if (isset($type['_boost'])) {
|
if (isset($type['_boost'])) {
|
||||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_boost'] = $type['_boost'];
|
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_boost'] = $type['_boost'];
|
||||||
}
|
}
|
||||||
|
if (isset($type['_routing'])) {
|
||||||
|
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_routing'] = $type['_routing'];
|
||||||
|
}
|
||||||
if (isset($type['mappings'])) {
|
if (isset($type['mappings'])) {
|
||||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['properties'] = $type['mappings'];
|
$this->indexConfigs[$indexName]['config']['mappings'][$name]['properties'] = $type['mappings'];
|
||||||
$typeName = sprintf('%s/%s', $indexName, $name);
|
$typeName = sprintf('%s/%s', $indexName, $name);
|
||||||
|
|
Loading…
Reference in a new issue