Added configuration options to support index-time document boosting
This commit is contained in:
parent
67a11a59ce
commit
70c629f857
|
@ -214,6 +214,7 @@ class Configuration
|
|||
->end()
|
||||
->append($this->getMappingsNode())
|
||||
->append($this->getSourceNode())
|
||||
->append($this->getBoostNode())
|
||||
->end()
|
||||
;
|
||||
|
||||
|
@ -295,4 +296,22 @@ class Configuration
|
|||
|
||||
return $node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the array node used for "_boost".
|
||||
*/
|
||||
protected function getBoostNode()
|
||||
{
|
||||
$builder = new TreeBuilder();
|
||||
$node = $builder->root('_boost');
|
||||
|
||||
$node
|
||||
->children()
|
||||
->scalarNode('name')->end()
|
||||
->scalarNode('null_value')->end()
|
||||
->end()
|
||||
;
|
||||
|
||||
return $node;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,6 +170,9 @@ class FOQElasticaExtension extends Extension
|
|||
if (isset($type['_source'])) {
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_source'] = $type['_source'];
|
||||
}
|
||||
if (isset($type['_boost'])) {
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_boost'] = $type['_boost'];
|
||||
}
|
||||
if (isset($type['mappings'])) {
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['properties'] = $type['mappings'];
|
||||
$typeName = sprintf('%s/%s', $indexName, $name);
|
||||
|
|
Loading…
Reference in a new issue