-
Notifications
You must be signed in to change notification settings - Fork 3
/
Configuration.php
56 lines (51 loc) · 2.48 KB
/
Configuration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
declare(strict_types=1);
namespace Valantic\ElasticaBridgeBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('valantic_elastica_bridge');
$treeBuilder->getRootNode()
->children()
->arrayNode('client')
->children()
->scalarNode('dsn')->defaultValue('http://localhost:9200')->info('The DSN to connect to the Elasticsearch cluster.')->end()
->booleanNode('should_add_sentry_breadcrumbs')->defaultFalse()->info('If true, breadcrumbs are added to Sentry for every request made to Elasticsearch via Elastica.')->end()
->end()
->end()
->arrayNode('indexing')
->addDefaultsIfNotSet()
->children()
->integerNode('lock_timeout')->defaultValue(5 * 60)->info('To prevent overlapping indexing jobs. Set to a value higher than the slowest index. Value is specified in seconds.')->end()
->booleanNode('should_skip_failing_documents')->defaultFalse()->info('If true, when a document fails to be indexed, it will be skipped and indexing continue with the next document. If false, indexing that index will be aborted.')->end()
->end()
->end()
->arrayNode('events')
->addDefaultsIfNotSet()
->children()
->arrayNode('auto_save')->info('Define whether auto-save events should trigger a refresh of the element in the corresponding indices.')
->addDefaultsIfNotSet()
->children()
->booleanNode('asset')->defaultTrue()->end()
->booleanNode('data_object')->defaultTrue()->end()
->booleanNode('document')->defaultTrue()->end()
->end()
->end()
->arrayNode('version_only')->info('Define whether saveVersionOnly events should trigger a refresh of the element in the corresponding indices.')
->addDefaultsIfNotSet()
->children()
->booleanNode('asset')->defaultTrue()->end()
->booleanNode('data_object')->defaultTrue()->end()
->booleanNode('document')->defaultTrue()->end()
->end()
->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
}
}