1 | <?php |
||
23 | class IndexConfig |
||
24 | { |
||
25 | /** |
||
26 | * The name of the index for ElasticSearch. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | private $elasticSearchName; |
||
31 | |||
32 | /** |
||
33 | * The internal name of the index. May not be the same as the name used in ElasticSearch, |
||
34 | * especially if aliases are enabled. |
||
35 | * |
||
36 | * @var string |
||
37 | */ |
||
38 | private $name; |
||
39 | |||
40 | /** |
||
41 | * An array of settings sent to ElasticSearch when creating the index. |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | private $settings; |
||
46 | |||
47 | /** |
||
48 | * All types that belong to this index. |
||
49 | * |
||
50 | * @var TypeConfig[] |
||
51 | */ |
||
52 | private $types; |
||
53 | |||
54 | /** |
||
55 | * Indicates if the index should use an alias, allowing an index repopulation to occur |
||
56 | * without overwriting the current index. |
||
57 | * |
||
58 | * @var bool |
||
59 | */ |
||
60 | private $useAlias = false; |
||
61 | |||
62 | /** |
||
63 | * Constructor expects an array as generated by the Container Configuration builder. |
||
64 | * |
||
65 | * @param string $name |
||
66 | * @param TypeConfig[] $types |
||
67 | * @param array $config |
||
68 | */ |
||
69 | public function __construct($name, array $types, array $config) |
||
77 | |||
78 | /** |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getElasticSearchName() |
||
85 | |||
86 | /** |
||
87 | * @return string |
||
88 | */ |
||
89 | public function getName() |
||
93 | |||
94 | /** |
||
95 | * @return array |
||
96 | */ |
||
97 | public function getSettings() |
||
101 | |||
102 | /** |
||
103 | * @param string $typeName |
||
104 | * |
||
105 | * @return TypeConfig |
||
106 | * |
||
107 | * @throws \InvalidArgumentException |
||
108 | */ |
||
109 | public function getType($typeName) |
||
117 | |||
118 | /** |
||
119 | * @return \FOS\ElasticaBundle\Configuration\TypeConfig[] |
||
120 | */ |
||
121 | public function getTypes() |
||
125 | |||
126 | /** |
||
127 | * @return bool |
||
128 | */ |
||
129 | public function isUseAlias() |
||
133 | } |
||
134 |