Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit 3bf8023

Browse files
committed
Events and Logs indices cannot be created nor deleted
1 parent b4898b2 commit 3bf8023

File tree

3 files changed

+1
-162
lines changed

3 files changed

+1
-162
lines changed

.php_cs.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"php":"7.1.12-1+ubuntu16.04.1+deb.sury.org+1","version":"2.11.1:v2.11.1#ad94441c17b8ef096e517acccdbf3238af8a2da8","rules":{"blank_line_after_namespace":true,"braces":{"allow_single_line_closure":true},"class_definition":{"singleLine":true},"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_constants":true,"lowercase_keywords":true,"method_argument_space":true,"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":true,"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"binary_operator_spaces":true,"blank_line_after_opening_tag":true,"blank_line_before_statement":{"statements":["return"]},"cast_spaces":true,"class_attributes_separation":{"elements":["method"]},"concat_space":{"spacing":"none"},"declare_equal_normalize":true,"function_typehint_space":true,"include":true,"increment_style":true,"lowercase_cast":true,"magic_constant_casing":true,"native_function_casing":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_blank_lines_after_phpdoc":true,"no_empty_comment":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_extra_blank_lines":{"tokens":["curly_brace_block","extra","parenthesis_brace_block","square_brace_block","throw","use"]},"no_leading_import_slash":true,"no_leading_namespace_whitespace":true,"no_mixed_echo_print":{"use":"echo"},"no_multiline_whitespace_around_double_arrow":true,"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_around_offset":true,"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"no_unneeded_control_parentheses":true,"no_unneeded_curly_braces":true,"no_unneeded_final_method":true,"no_unused_imports":true,"no_whitespace_before_comma_in_array":true,"no_whitespace_in_blank_line":true,"normalize_index_brace":true,"object_operator_without_whitespace":true,"php_unit_fqcn_annotation":true,"phpdoc_align":{"tags":["method","param","property","return","throws","type","var"]},"phpdoc_annotation_without_dot":true,"phpdoc_indent":true,"phpdoc_inline_tag":true,"phpdoc_no_access":true,"phpdoc_no_alias_tag":true,"phpdoc_no_empty_return":true,"phpdoc_no_package":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true,"phpdoc_separation":true,"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_to_comment":true,"phpdoc_trim":true,"phpdoc_types":true,"phpdoc_var_without_name":true,"protected_to_private":true,"return_type_declaration":true,"semicolon_after_instruction":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_line_comment_style":{"comment_types":["hash"]},"single_quote":true,"space_after_semicolon":{"remove_in_empty_for_expressions":true},"standardize_increment":true,"standardize_not_equals":true,"ternary_operator_spaces":true,"trailing_comma_in_multiline_array":true,"trim_array_spaces":true,"unary_operator_spaces":true,"whitespace_after_comma_in_array":true,"yoda_style":true},"hashes":{"Tests\/Functional\/DependencyInjection\/ApisearchConfigurationTest.php":379272062,"Translator\/AggregationTranslator.php":2950948888,"ApisearchBundle.php":452340142,"Twig\/MethodAccessorExtension.php":1937766330,"Twig\/AggregationTranslationExtension.php":1168064907,"Twig\/UrlBuilderExtension.php":1238295593,"Command\/ImportIndexCommand.php":1722481554,"Command\/CreateIndexCommand.php":364387858,"Command\/ApisearchFormattedCommand.php":3372612923,"Command\/ResetIndexCommand.php":4289827141,"Command\/DeleteIndexCommand.php":872001448,"Command\/ApisearchCommand.php":1200461271,"Command\/WithAppRepositoryBucketCommand.php":3721529541,"Command\/AddTokenCommand.php":2707377316,"Command\/PrintTokensCommand.php":2265717038,"Command\/ExportIndexCommand.php":3751299339,"Command\/WithRepositoryBucketCommand.php":835091977,"Command\/DeleteTokenCommand.php":2469160876,"DependencyInjection\/CompilerPass\/TagCompilerPass.php":1857409043,"DependencyInjection\/CompilerPass\/WriteTransformerCompilerPass.php":3787221228,"DependencyInjection\/CompilerPass\/ExporterCompilerPass.php":3859400892,"DependencyInjection\/CompilerPass\/RepositoryCompilerPass.php":3492158054,"DependencyInjection\/CompilerPass\/ReadTransformerCompilerPass.php":407060565,"DependencyInjection\/ApisearchConfiguration.php":2562035961,"DependencyInjection\/ApisearchExtension.php":2861843414,"Command\/DeleteTokensCommand.php":2095195833}}
1+
{"php":"7.1.18-1+ubuntu18.04.1+deb.sury.org+1","version":"2.11.1:v2.11.1#ad94441c17b8ef096e517acccdbf3238af8a2da8","rules":{"blank_line_after_namespace":true,"braces":{"allow_single_line_closure":true},"class_definition":{"singleLine":true},"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_constants":true,"lowercase_keywords":true,"method_argument_space":true,"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":true,"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"binary_operator_spaces":true,"blank_line_after_opening_tag":true,"blank_line_before_statement":{"statements":["return"]},"cast_spaces":true,"class_attributes_separation":{"elements":["method"]},"concat_space":{"spacing":"none"},"declare_equal_normalize":true,"function_typehint_space":true,"include":true,"increment_style":true,"lowercase_cast":true,"magic_constant_casing":true,"native_function_casing":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_blank_lines_after_phpdoc":true,"no_empty_comment":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_extra_blank_lines":{"tokens":["curly_brace_block","extra","parenthesis_brace_block","square_brace_block","throw","use"]},"no_leading_import_slash":true,"no_leading_namespace_whitespace":true,"no_mixed_echo_print":{"use":"echo"},"no_multiline_whitespace_around_double_arrow":true,"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_around_offset":true,"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"no_unneeded_control_parentheses":true,"no_unneeded_curly_braces":true,"no_unneeded_final_method":true,"no_unused_imports":true,"no_whitespace_before_comma_in_array":true,"no_whitespace_in_blank_line":true,"normalize_index_brace":true,"object_operator_without_whitespace":true,"php_unit_fqcn_annotation":true,"phpdoc_align":{"tags":["method","param","property","return","throws","type","var"]},"phpdoc_annotation_without_dot":true,"phpdoc_indent":true,"phpdoc_inline_tag":true,"phpdoc_no_access":true,"phpdoc_no_alias_tag":true,"phpdoc_no_empty_return":true,"phpdoc_no_package":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true,"phpdoc_separation":true,"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_to_comment":true,"phpdoc_trim":true,"phpdoc_types":true,"phpdoc_var_without_name":true,"protected_to_private":true,"return_type_declaration":true,"semicolon_after_instruction":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_line_comment_style":{"comment_types":["hash"]},"single_quote":true,"space_after_semicolon":{"remove_in_empty_for_expressions":true},"standardize_increment":true,"standardize_not_equals":true,"ternary_operator_spaces":true,"trailing_comma_in_multiline_array":true,"trim_array_spaces":true,"unary_operator_spaces":true,"whitespace_after_comma_in_array":true,"yoda_style":true},"hashes":{"Twig\/MethodAccessorExtension.php":1937766330,"Twig\/AggregationTranslationExtension.php":1168064907,"Twig\/UrlBuilderExtension.php":1238295593,"DependencyInjection\/CompilerPass\/ExporterCompilerPass.php":3859400892,"DependencyInjection\/CompilerPass\/ReadTransformerCompilerPass.php":407060565,"DependencyInjection\/CompilerPass\/WriteTransformerCompilerPass.php":3787221228,"DependencyInjection\/CompilerPass\/RepositoryCompilerPass.php":3492158054,"DependencyInjection\/CompilerPass\/TagCompilerPass.php":1857409043,"DependencyInjection\/ApisearchExtension.php":2861843414,"DependencyInjection\/ApisearchConfiguration.php":2562035961,"ApisearchBundle.php":452340142,"Translator\/AggregationTranslator.php":2950948888,"Command\/ExportIndexCommand.php":3751299339,"Command\/ImportIndexCommand.php":1722481554,"Command\/PrintTokensCommand.php":2265717038,"Command\/DeleteTokensCommand.php":2095195833,"Command\/ApisearchCommand.php":3025110659,"Command\/ApisearchFormattedCommand.php":3372612923,"Command\/AddTokenCommand.php":2707377316,"Command\/WithRepositoryBucketCommand.php":835091977,"Command\/WithAppRepositoryBucketCommand.php":245049441,"Command\/DeleteTokenCommand.php":2469160876,"Command\/CreateIndexCommand.php":3612862136,"Command\/DeleteIndexCommand.php":2188655061,"Command\/ResetIndexCommand.php":4289827141,"Tests\/Functional\/DependencyInjection\/ApisearchConfigurationTest.php":379272062}}

Command/CreateIndexCommand.php

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,6 @@ protected function configure()
9494
InputOption::VALUE_NONE,
9595
'Store searchable metadata'
9696
)
97-
->addOption(
98-
'with-events',
99-
null,
100-
InputOption::VALUE_NONE,
101-
'Create events as well'
102-
)
103-
->addOption(
104-
'with-logs',
105-
null,
106-
InputOption::VALUE_NONE,
107-
'Create logs as well'
108-
)
10997
->addOption(
11098
'synonym',
11199
null,
@@ -157,22 +145,6 @@ protected function runCommand(InputInterface $input, OutputInterface $output)
157145
'Index is already created. Skipping.'
158146
);
159147
}
160-
161-
if ($input->getOption('with-events')) {
162-
$this->createEvents(
163-
$repository,
164-
$index,
165-
$output
166-
);
167-
}
168-
169-
if ($input->getOption('with-logs')) {
170-
$this->createLogs(
171-
$repository,
172-
$index,
173-
$output
174-
);
175-
}
176148
}
177149

178150
/**
@@ -189,56 +161,4 @@ protected function getSuccessMessage(
189161
): string {
190162
return 'Indices created properly';
191163
}
192-
193-
/**
194-
* Create events index.
195-
*
196-
* @param string $repositoryName
197-
* @param string $index
198-
* @param OutputInterface $output
199-
*/
200-
private function createEvents(
201-
string $repositoryName,
202-
string $index,
203-
OutputInterface $output
204-
) {
205-
try {
206-
$this
207-
->eventRepositoryBucket
208-
->findRepository($repositoryName, $index)
209-
->createIndex();
210-
} catch (ResourceNotAvailableException $exception) {
211-
$this->printInfoMessage(
212-
$output,
213-
$this->getHeader(),
214-
'Events index is already created. Skipping.'
215-
);
216-
}
217-
}
218-
219-
/**
220-
* Create logs index.
221-
*
222-
* @param string $repositoryName
223-
* @param string $index
224-
* @param OutputInterface $output
225-
*/
226-
private function createLogs(
227-
string $repositoryName,
228-
string $index,
229-
OutputInterface $output
230-
) {
231-
try {
232-
$this
233-
->logRepositoryBucket
234-
->findRepository($repositoryName, $index)
235-
->createIndex();
236-
} catch (ResourceNotAvailableException $exception) {
237-
$this->printInfoMessage(
238-
$output,
239-
$this->getHeader(),
240-
'Logs index is already created. Skipping.'
241-
);
242-
}
243-
}
244164
}

Command/DeleteIndexCommand.php

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use Apisearch\Repository\RepositoryBucket;
2323
use Symfony\Component\Console\Input\InputArgument;
2424
use Symfony\Component\Console\Input\InputInterface;
25-
use Symfony\Component\Console\Input\InputOption;
2625
use Symfony\Component\Console\Output\OutputInterface;
2726

2827
/**
@@ -79,18 +78,6 @@ protected function configure()
7978
'index',
8079
InputArgument::REQUIRED,
8180
'Index'
82-
)
83-
->addOption(
84-
'with-events',
85-
null,
86-
InputOption::VALUE_NONE,
87-
'Create events as well'
88-
)
89-
->addOption(
90-
'with-logs',
91-
null,
92-
InputOption::VALUE_NONE,
93-
'Create logs as well'
9481
);
9582
}
9683

@@ -129,22 +116,6 @@ protected function runCommand(InputInterface $input, OutputInterface $output)
129116
'Index not found. Skipping.'
130117
);
131118
}
132-
133-
if ($input->getOption('with-events')) {
134-
$this->deleteEvents(
135-
$repository,
136-
$index,
137-
$output
138-
);
139-
}
140-
141-
if ($input->getOption('with-logs')) {
142-
$this->deleteLogs(
143-
$repository,
144-
$index,
145-
$output
146-
);
147-
}
148119
}
149120

150121
/**
@@ -161,56 +132,4 @@ protected function getSuccessMessage(
161132
): string {
162133
return 'Indices deleted properly';
163134
}
164-
165-
/**
166-
* Delete events index.
167-
*
168-
* @param string $repository
169-
* @param string $index
170-
* @param OutputInterface $output
171-
*/
172-
protected function deleteEvents(
173-
string $repository,
174-
string $index,
175-
OutputInterface $output
176-
) {
177-
try {
178-
$this
179-
->eventRepositoryBucket
180-
->findRepository($repository, $index)
181-
->deleteIndex();
182-
} catch (ResourceNotAvailableException $exception) {
183-
$this->printInfoMessage(
184-
$output,
185-
$this->getHeader(),
186-
'Events index not found. Skipping.'
187-
);
188-
}
189-
}
190-
191-
/**
192-
* Delete logs index.
193-
*
194-
* @param string $repository
195-
* @param string $index
196-
* @param OutputInterface $output
197-
*/
198-
protected function deleteLogs(
199-
string $repository,
200-
string $index,
201-
OutputInterface $output
202-
) {
203-
try {
204-
$this
205-
->logRepositoryBucket
206-
->findRepository($repository, $index)
207-
->deleteIndex();
208-
} catch (ResourceNotAvailableException $exception) {
209-
$this->printInfoMessage(
210-
$output,
211-
$this->getHeader(),
212-
'Logs index not found. Skipping.'
213-
);
214-
}
215-
}
216135
}

0 commit comments

Comments
 (0)