Skip to content

Commit 5c84023

Browse files
authored
Merge pull request #18 from ensi-platform/task-105512-v8
#105512 (v8) Переход на клиента elasticsearch 8
2 parents 4ac2aea + e71ba15 commit 5c84023

File tree

11 files changed

+95
-1011
lines changed

11 files changed

+95
-1011
lines changed

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: run-tests
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [v7, v8]
66
pull_request:
7-
branches: [master]
7+
branches: [v7, v8]
88

99
jobs:
1010
test:

.huskyrc.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,18 @@ $records = ElasticQuery::getQueryLog();
266266
ElasticQuery::disableQueryLog();
267267
```
268268

269+
## Environment Variables
270+
Below see the environment variables that you can configure with the default values,
271+
Hosts should be comma seperated string of hosts with protocol prefix and port suffix, e.g. `http://localhost:9200,http://localhost:9201`
272+
273+
```dotenv
274+
ELASTICSEARCH_HOSTS=https://localhost:9200'
275+
ELASTICSEARCH_RETRIES=2
276+
ELASTICSEARCH_USERNAME=admin
277+
ELASTICSEARCH_PASSWORD=admin
278+
ELASTICSEARCH_SSL_VERIFICATION=true,
279+
```
280+
269281
## Contributing
270282

271283
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"require": {
1717
"php": "^8.0",
18-
"elasticsearch/elasticsearch": "^7.13",
18+
"elasticsearch/elasticsearch": "^8.0",
1919
"illuminate/support": "^8.0||^9.0",
2020
"webmozart/assert": "^1.11"
2121
},
@@ -40,10 +40,12 @@
4040
"cs": "php-cs-fixer fix --config .php-cs-fixer.php",
4141
"test": "vendor/bin/phpunit",
4242
"test-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html coverage"
43-
4443
},
4544
"config": {
46-
"sort-packages": true
45+
"sort-packages": true,
46+
"allow-plugins": {
47+
"php-http/discovery": true
48+
}
4749
},
4850
"extra": {
4951
"laravel": {

config/config.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,10 @@
66
* Elasticsearch hosts in format http[s]://[user][:pass]@hostname[:9200]
77
*/
88
'hosts' => explode(',', env('ELASTICSEARCH_HOSTS')),
9-
]
9+
10+
'retries' => env('ELASTICSEARCH_RETRIES', 1),
11+
'username' => env('ELASTICSEARCH_USERNAME', ''),
12+
'password' => env('ELASTICSEARCH_PASSWORD', ''),
13+
'ssl_verification' => env('ELASTICSEARCH_SSL_VERIFICATION', false),
14+
],
1015
];

0 commit comments

Comments
 (0)