Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

III-5962 Elastic search 8 investigation #282

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,28 @@ services:
aliases:
- elasticsearch.uitdatabank.dev

elasticsearch8:
image: docker.elastic.co/elasticsearch/elasticsearch:8.13.2
container_name: es8.uitdatabank
hostname: 'udb3-es8'
environment:
- xpack.security.enabled=false
- discovery.type=single-node
ports:
- '9208:9200'
volumes:
- 'udb3-es8:/elasticsearch/data'
networks:
uitdatabank:
aliases:
- elasticsearch.uitdatabank.dev

networks:
uitdatabank:
driver: bridge

volumes:
udb3-es:
driver: local
udb3-es8:
driver: local
2 changes: 1 addition & 1 deletion src/ElasticSearch/ElasticSearchPagedResultSetFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function createPagedResultSet(int $perPage, array $response): PagedResult
{
$this->responseValidator->validate($response);

$total = $response['hits']['total'];
$total = $response['hits']['total']['value'];

$results = array_map(
fn (array $result): JsonDocument => (new JsonDocument($result['_id']))
Expand Down
2 changes: 1 addition & 1 deletion src/ElasticSearch/HasElasticSearchClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private function getDefaultParameters(): array
{
return [
'index' => $this->indexName,
'type' => $this->documentType,
// 'type' => $this->documentType,
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function indexDocument(

$this->queuedDocuments[] = [
'index' => $indexName,
'type' => $documentType,
// 'type' => $documentType,
'id' => $jsonDocument->getId(),
'body' => Json::decodeAssociatively($jsonDocument->getRawBody()),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function indexDocument(
$this->elasticSearchClient->index(
[
'index' => $indexName,
'type' => $documentType,
// 'type' => $documentType,
'id' => $id,
'body' => (array) $jsonDocument->getBody(),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protected function updateMapping(string $indexName, string $documentType, string
$this->client->indices()->putMapping(
[
'index' => $indexName,
'type' => $documentType,
// 'type' => $documentType,
'body' => Json::decodeAssociatively(
file_get_contents($mappingFilePath)
),
Expand Down
2 changes: 1 addition & 1 deletion src/ElasticSearch/Operations/IndexRegions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function run(string $indexName, string $pathToScan, string $fileNameRegex
$this->client->index(
[
'index' => $indexName,
'type' => 'region',
// 'type' => 'region',
'id' => $id,
'body' => Json::decodeAssociatively($json),
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"template": "*",
"index_patterns": "*",
"settings": {
"analysis": {
"filter": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"template": "*",
"index_patterns": "*",
"settings": {
"analysis": {
"analyzer": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"template": "*",
"index_patterns": "*",
"settings": {
"analysis": {
"analyzer": {
Expand Down
Loading
Loading