diff --git a/docker-compose.yml b/docker-compose.yml index ef1a659b..c89d2239 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 \ No newline at end of file diff --git a/src/ElasticSearch/ElasticSearchPagedResultSetFactory.php b/src/ElasticSearch/ElasticSearchPagedResultSetFactory.php index ac14fa56..72efd87d 100644 --- a/src/ElasticSearch/ElasticSearchPagedResultSetFactory.php +++ b/src/ElasticSearch/ElasticSearchPagedResultSetFactory.php @@ -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'])) diff --git a/src/ElasticSearch/HasElasticSearchClient.php b/src/ElasticSearch/HasElasticSearchClient.php index 089a1e4c..72156f06 100644 --- a/src/ElasticSearch/HasElasticSearchClient.php +++ b/src/ElasticSearch/HasElasticSearchClient.php @@ -18,7 +18,7 @@ private function getDefaultParameters(): array { return [ 'index' => $this->indexName, - 'type' => $this->documentType, + // 'type' => $this->documentType, ]; } diff --git a/src/ElasticSearch/IndexationStrategy/BulkIndexationStrategy.php b/src/ElasticSearch/IndexationStrategy/BulkIndexationStrategy.php index e93374a5..9689e3ac 100644 --- a/src/ElasticSearch/IndexationStrategy/BulkIndexationStrategy.php +++ b/src/ElasticSearch/IndexationStrategy/BulkIndexationStrategy.php @@ -41,7 +41,7 @@ public function indexDocument( $this->queuedDocuments[] = [ 'index' => $indexName, - 'type' => $documentType, + // 'type' => $documentType, 'id' => $jsonDocument->getId(), 'body' => Json::decodeAssociatively($jsonDocument->getRawBody()), ]; diff --git a/src/ElasticSearch/IndexationStrategy/SingleFileIndexationStrategy.php b/src/ElasticSearch/IndexationStrategy/SingleFileIndexationStrategy.php index 56edabd0..7aff3b75 100644 --- a/src/ElasticSearch/IndexationStrategy/SingleFileIndexationStrategy.php +++ b/src/ElasticSearch/IndexationStrategy/SingleFileIndexationStrategy.php @@ -36,7 +36,7 @@ public function indexDocument( $this->elasticSearchClient->index( [ 'index' => $indexName, - 'type' => $documentType, + // 'type' => $documentType, 'id' => $id, 'body' => (array) $jsonDocument->getBody(), ] diff --git a/src/ElasticSearch/Operations/AbstractMappingOperation.php b/src/ElasticSearch/Operations/AbstractMappingOperation.php index 44610a43..79d80b8c 100644 --- a/src/ElasticSearch/Operations/AbstractMappingOperation.php +++ b/src/ElasticSearch/Operations/AbstractMappingOperation.php @@ -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) ), diff --git a/src/ElasticSearch/Operations/IndexRegions.php b/src/ElasticSearch/Operations/IndexRegions.php index 7fbfed07..a1e5314b 100644 --- a/src/ElasticSearch/Operations/IndexRegions.php +++ b/src/ElasticSearch/Operations/IndexRegions.php @@ -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), ] diff --git a/src/ElasticSearch/Operations/json/analyzer_autocomplete.json b/src/ElasticSearch/Operations/json/analyzer_autocomplete.json index ccdbfa25..a58c54d0 100644 --- a/src/ElasticSearch/Operations/json/analyzer_autocomplete.json +++ b/src/ElasticSearch/Operations/json/analyzer_autocomplete.json @@ -1,5 +1,5 @@ { - "template": "*", + "index_patterns": "*", "settings": { "analysis": { "filter": { diff --git a/src/ElasticSearch/Operations/json/analyzer_lowercase_exact_match.json b/src/ElasticSearch/Operations/json/analyzer_lowercase_exact_match.json index 66f5808a..61d5cdd4 100644 --- a/src/ElasticSearch/Operations/json/analyzer_lowercase_exact_match.json +++ b/src/ElasticSearch/Operations/json/analyzer_lowercase_exact_match.json @@ -1,5 +1,5 @@ { - "template": "*", + "index_patterns": "*", "settings": { "analysis": { "analyzer": { diff --git a/src/ElasticSearch/Operations/json/analyzer_lowercase_standard.json b/src/ElasticSearch/Operations/json/analyzer_lowercase_standard.json index 23d8630a..25155c27 100644 --- a/src/ElasticSearch/Operations/json/analyzer_lowercase_standard.json +++ b/src/ElasticSearch/Operations/json/analyzer_lowercase_standard.json @@ -1,5 +1,5 @@ { - "template": "*", + "index_patterns": "*", "settings": { "analysis": { "analyzer": { diff --git a/src/ElasticSearch/Operations/json/mapping_event.json b/src/ElasticSearch/Operations/json/mapping_event.json index 17d3a1c6..221b4b33 100644 --- a/src/ElasticSearch/Operations/json/mapping_event.json +++ b/src/ElasticSearch/Operations/json/mapping_event.json @@ -1,18 +1,18 @@ { "properties": { "@id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "@type": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -34,17 +34,17 @@ "type": "integer_range" }, "status": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "bookingAvailability": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "attendanceMode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -60,12 +60,12 @@ "type": "integer_range" }, "status": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "bookingAvailability": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" } @@ -73,13 +73,13 @@ }, "calendarType": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "workflowStatus": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -88,19 +88,19 @@ "type": "object", "properties": { "nl": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "fr": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "en": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "de": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -109,42 +109,42 @@ "type": "object", "properties": { "nl": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "fr": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "en": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "de": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } }, "mainLanguage": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "languages": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "completedLanguages": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "labels": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer", "fields": { @@ -155,18 +155,18 @@ }, "labels_free_text": { - "type": "string" + "type": "text" }, "terms": { "type": "object", "properties": { "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "label": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" } @@ -176,12 +176,12 @@ "type": "object", "properties": { "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "label": { - "type": "string" + "type": "text" } } }, @@ -199,7 +199,7 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "text" } } }, @@ -211,21 +211,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -234,21 +234,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -257,21 +257,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -280,21 +280,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -309,7 +309,7 @@ "type": "geo_point" }, "regions": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer", "fields": { @@ -332,7 +332,7 @@ }, "audienceType": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -348,22 +348,22 @@ "type": "object", "properties": { "@id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "@type": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "mainId": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -371,19 +371,19 @@ "type": "object", "properties": { "nl": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "fr": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "en": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "de": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -392,19 +392,19 @@ "type": "object", "properties": { "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "label": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" } } }, "labels": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" } @@ -415,17 +415,17 @@ "type": "object", "properties": { "@id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "@type": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -433,25 +433,25 @@ "type": "object", "properties": { "nl": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "fr": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "en": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "de": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } }, "labels": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" } @@ -474,13 +474,13 @@ }, "creator": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "contributors": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -493,7 +493,7 @@ "type": "object", "properties": { "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" } @@ -514,7 +514,7 @@ "type": "nested", "properties": { "event": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, diff --git a/src/ElasticSearch/Operations/json/mapping_organizer.json b/src/ElasticSearch/Operations/json/mapping_organizer.json index 3f53fda8..c0c8cc82 100644 --- a/src/ElasticSearch/Operations/json/mapping_organizer.json +++ b/src/ElasticSearch/Operations/json/mapping_organizer.json @@ -1,18 +1,18 @@ { "properties": { "@id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "@type": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -21,26 +21,26 @@ "type": "object", "properties": { "nl": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer", "fields": { "autocomplete": { - "type": "string", + "type": "text", "analyzer": "autocomplete_analyzer", "search_analyzer": "standard" } } }, "fr": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "en": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "de": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -50,19 +50,19 @@ "type": "object", "properties": { "nl": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "fr": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "en": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "de": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -72,26 +72,26 @@ "type": "object", "properties": { "nl": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "fr": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "en": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "de": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } }, "url" : { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer" }, @@ -106,21 +106,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -129,21 +129,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -152,21 +152,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -175,21 +175,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -208,7 +208,7 @@ "type": "geo_point" }, "regions": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer", "fields": { @@ -219,13 +219,13 @@ }, "creator": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "contributors": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -246,7 +246,7 @@ }, "labels": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer", "fields": { @@ -257,7 +257,7 @@ }, "workflowStatus": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, diff --git a/src/ElasticSearch/Operations/json/mapping_place.json b/src/ElasticSearch/Operations/json/mapping_place.json index 17a36416..b3400cea 100644 --- a/src/ElasticSearch/Operations/json/mapping_place.json +++ b/src/ElasticSearch/Operations/json/mapping_place.json @@ -1,18 +1,18 @@ { "properties": { "@id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "@type": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -34,12 +34,12 @@ "type": "integer_range" }, "status": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "bookingAvailability": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -55,12 +55,12 @@ "type": "integer_range" }, "status": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "bookingAvailability": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" } @@ -68,13 +68,13 @@ }, "calendarType": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "workflowStatus": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -83,19 +83,19 @@ "type": "object", "properties": { "nl": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "fr": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "en": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "de": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -104,42 +104,42 @@ "type": "object", "properties": { "nl": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "fr": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "en": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "de": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } }, "mainLanguage": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "languages": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "completedLanguages": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "labels": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer", "fields": { @@ -149,18 +149,18 @@ } }, "labels_free_text": { - "type": "string" + "type": "text" }, "terms": { "type": "object", "properties": { "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "label": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" } @@ -170,12 +170,12 @@ "type": "object", "properties": { "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "label": { - "type": "string" + "type": "text" } } }, @@ -196,21 +196,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -219,21 +219,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -242,21 +242,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -265,21 +265,21 @@ "type": "object", "properties": { "addressCountry": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "addressLocality": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "postalCode": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "streetAddress": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } @@ -294,7 +294,7 @@ "type": "geo_point" }, "regions": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer", "fields": { @@ -317,7 +317,7 @@ }, "audienceType": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -333,17 +333,17 @@ "type": "object", "properties": { "@id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "@type": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "id": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -351,25 +351,25 @@ "type": "object", "properties": { "nl": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "fr": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "en": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" }, "de": { - "type": "string", + "type": "text", "analyzer": "lowercase_standard_analyzer" } } }, "labels": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" } @@ -392,13 +392,13 @@ }, "creator": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, "contributors": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, @@ -408,7 +408,7 @@ }, "unique_address_identifier": { - "type": "string", + "type": "text", "analyzer": "lowercase_exact_match_analyzer", "search_analyzer": "lowercase_exact_match_analyzer" }, diff --git a/src/ElasticSearch/Region/GeoShapeQueryRegionService.php b/src/ElasticSearch/Region/GeoShapeQueryRegionService.php index 0a749be1..0f6a6067 100644 --- a/src/ElasticSearch/Region/GeoShapeQueryRegionService.php +++ b/src/ElasticSearch/Region/GeoShapeQueryRegionService.php @@ -71,13 +71,10 @@ public function getRegionIds(array $geoShape): array ); } - $total = $response['hits']['total']; + $total = $response['hits']['total']['value']; foreach ($response['hits']['hits'] as $hit) { - if ($hit['_type'] == 'region') { - $regionIds[] = new RegionId($hit['_id']); - } - + $regionIds[] = new RegionId($hit['_id']); $processedHits++; } diff --git a/tests/ElasticSearch/ElasticSearchDocumentRepositoryTest.php b/tests/ElasticSearch/ElasticSearchDocumentRepositoryTest.php index 259df754..82ccefe8 100644 --- a/tests/ElasticSearch/ElasticSearchDocumentRepositoryTest.php +++ b/tests/ElasticSearch/ElasticSearchDocumentRepositoryTest.php @@ -64,7 +64,7 @@ public function it_indexes_json_documents(): void $parameters = [ 'index' => $this->indexName, - 'type' => $this->documentType, + // 'type' => $this->documentType, 'id' => $id, 'body' => [ 'name' => 'STUK', @@ -87,7 +87,7 @@ public function it_deletes_documents_on_remove(): void $parameters = [ 'index' => $this->indexName, - 'type' => $this->documentType, + // 'type' => $this->documentType, 'id' => $id, ]; @@ -107,7 +107,7 @@ public function it_returns_stored_documents(): void $parameters = [ 'index' => $this->indexName, - 'type' => $this->documentType, + // 'type' => $this->documentType, 'id' => $id, ]; @@ -142,7 +142,7 @@ public function it_throws_a_document_gone_exception_when_loading_a_deleted_docum $parameters = [ 'index' => $this->indexName, - 'type' => $this->documentType, + // 'type' => $this->documentType, 'id' => $id, ]; @@ -173,7 +173,7 @@ public function it_returns_null_for_unknown_documents(): void $parameters = [ 'index' => $this->indexName, - 'type' => $this->documentType, + // 'type' => $this->documentType, 'id' => $id, ]; diff --git a/tests/ElasticSearch/ElasticSearchPagedResultSetFactoryTest.php b/tests/ElasticSearch/ElasticSearchPagedResultSetFactoryTest.php index 3b4979d5..f78c80e2 100644 --- a/tests/ElasticSearch/ElasticSearchPagedResultSetFactoryTest.php +++ b/tests/ElasticSearch/ElasticSearchPagedResultSetFactoryTest.php @@ -47,7 +47,10 @@ public function it_returns_a_paged_result_set_after_transforming_each_result(): { $response = [ 'hits' => [ - 'total' => 962, + 'total' => [ + 'value' => 962, + 'relation' => 'eq', + ], 'hits' => [ [ '_index' => 'udb3-core', @@ -169,7 +172,10 @@ public function it_ignores_aggregations_without_buckets(): void { $response = [ 'hits' => [ - 'total' => 962, + 'total' => [ + 'value' => 962, + 'relation' => 'eq', + ], 'hits' => [ [ '_index' => 'udb3-core', @@ -194,6 +200,7 @@ public function it_ignores_aggregations_without_buckets(): void 'aggregations' => [ 'total' => [ 'value' => 962, + 'relation' => 'eq', ], 'regions' => [ 'doc_count_error_upper_bound' => 0, @@ -275,7 +282,10 @@ public function it_uses_the_total_aggregation_for_the_total_count_instead_of_the { $response = [ 'hits' => [ - 'total' => 962, + 'total' => [ + 'value' => 962, + 'relation' => 'eq', + ], 'hits' => [ [ '_index' => 'udb3-core', diff --git a/tests/ElasticSearch/IndexationStrategy/BulkIndexationStrategyTest.php b/tests/ElasticSearch/IndexationStrategy/BulkIndexationStrategyTest.php index 76bca588..6893603c 100644 --- a/tests/ElasticSearch/IndexationStrategy/BulkIndexationStrategyTest.php +++ b/tests/ElasticSearch/IndexationStrategy/BulkIndexationStrategyTest.php @@ -82,7 +82,7 @@ public function it_queues_the_documents_and_indexes_them_in_bulk_when_the_auto_f [ 'index' => [ '_index' => $this->indexName, - '_type' => $this->documentType, + '_type' => null, // $this->documentType, '_id' => 'cff29f09-5104-4f0d-85ca-8d6cdd28849b', ], ], @@ -92,7 +92,7 @@ public function it_queues_the_documents_and_indexes_them_in_bulk_when_the_auto_f [ 'index' => [ '_index' => $this->indexName, - '_type' => $this->documentType, + '_type' => null, // $this->documentType, '_id' => '5cb3f31d-ffb4-4de5-86bd-852825d94ff2', ], ], @@ -102,7 +102,7 @@ public function it_queues_the_documents_and_indexes_them_in_bulk_when_the_auto_f [ 'index' => [ '_index' => $this->indexName, - '_type' => $this->documentType, + '_type' => null, // $this->documentType, '_id' => '014aef8c-0b63-4775-9ac6-68d880a11fc7', ], ], @@ -112,7 +112,7 @@ public function it_queues_the_documents_and_indexes_them_in_bulk_when_the_auto_f [ 'index' => [ '_index' => $this->indexName, - '_type' => $this->documentType, + '_type' => null, // $this->documentType, '_id' => '21dc5755-93c1-4443-9ee9-3ca0373a1107', ], ], @@ -122,7 +122,7 @@ public function it_queues_the_documents_and_indexes_them_in_bulk_when_the_auto_f [ 'index' => [ '_index' => $this->indexName, - '_type' => $this->documentType, + '_type' => null, // $this->documentType, '_id' => '8d429d11-ffdb-4c59-a530-792c5bf028df', ], ], @@ -167,7 +167,7 @@ public function it_can_be_flushed_on_command(): void [ 'index' => [ '_index' => $this->indexName, - '_type' => $this->documentType, + '_type' => null, // $this->documentType, '_id' => 'cff29f09-5104-4f0d-85ca-8d6cdd28849b', ], ], @@ -177,7 +177,7 @@ public function it_can_be_flushed_on_command(): void [ 'index' => [ '_index' => $this->indexName, - '_type' => $this->documentType, + '_type' => null, // $this->documentType, '_id' => '5cb3f31d-ffb4-4de5-86bd-852825d94ff2', ], ], @@ -187,7 +187,7 @@ public function it_can_be_flushed_on_command(): void [ 'index' => [ '_index' => $this->indexName, - '_type' => $this->documentType, + '_type' => null, // $this->documentType, '_id' => '014aef8c-0b63-4775-9ac6-68d880a11fc7', ], ], diff --git a/tests/ElasticSearch/IndexationStrategy/SingleFileIndexationStrategyTest.php b/tests/ElasticSearch/IndexationStrategy/SingleFileIndexationStrategyTest.php index b6bc2f9a..8353d6af 100644 --- a/tests/ElasticSearch/IndexationStrategy/SingleFileIndexationStrategyTest.php +++ b/tests/ElasticSearch/IndexationStrategy/SingleFileIndexationStrategyTest.php @@ -64,7 +64,7 @@ public function it_sends_the_document_directly_to_elasticsearch_for_indexation() ->with( [ 'index' => $this->indexName, - 'type' => $this->documentType, + // 'type' => $this->documentType, 'id' => 'cff29f09-5104-4f0d-85ca-8d6cdd28849b', 'body' => ['foo' => 'bar'], ] diff --git a/tests/ElasticSearch/Offer/ElasticSearchOfferSearchServiceTest.php b/tests/ElasticSearch/Offer/ElasticSearchOfferSearchServiceTest.php index 0c13c361..1a7f3173 100644 --- a/tests/ElasticSearch/Offer/ElasticSearchOfferSearchServiceTest.php +++ b/tests/ElasticSearch/Offer/ElasticSearchOfferSearchServiceTest.php @@ -56,7 +56,10 @@ public function it_returns_a_paged_result_set_for_the_given_search_parameters(): $response = [ 'hits' => [ - 'total' => 32, + 'total' => [ + 'value' => 32, + 'relation' => 'eq', + ], 'hits' => [ [ '_index' => 'udb3-core', @@ -64,7 +67,7 @@ public function it_returns_a_paged_result_set_for_the_given_search_parameters(): '_id' => '351b85c1-66ea-463b-82a6-515b7de0d267', '_source' => [ '@id' => 'http://foo.bar/events/351b85c1-66ea-463b-82a6-515b7de0d267', - '@type' => 'Event', + '@type' => 'event,place', // 'Event', 'regions' => ['foo', 'bar'], 'originalEncodedJsonLd' => '{}', ], @@ -75,7 +78,7 @@ public function it_returns_a_paged_result_set_for_the_given_search_parameters(): '_id' => 'bdc0f4ce-a211-463e-a8d1-d8b699fb1159', '_source' => [ '@id' => 'http://foo.bar/places/bdc0f4ce-a211-463e-a8d1-d8b699fb1159', - '@type' => 'Place', + '@type' => 'event,place', // 'Place', 'regions' => ['foo', 'bar'], 'originalEncodedJsonLd' => '{}', ], @@ -89,7 +92,7 @@ public function it_returns_a_paged_result_set_for_the_given_search_parameters(): ->with( [ 'index' => $this->indexName, - 'type' => $this->documentType, + // 'type' => $this->documentType, 'body' => [ '_source' => ['@id', '@type', 'originalEncodedJsonLd', 'regions'], 'from' => 0, @@ -110,7 +113,7 @@ public function it_returns_a_paged_result_set_for_the_given_search_parameters(): ->withBody( (object) [ '@id' => 'http://foo.bar/events/351b85c1-66ea-463b-82a6-515b7de0d267', - '@type' => 'Event', + '@type' => 'event,place', // 'Event', 'regions' => ['foo', 'bar'], 'originalEncodedJsonLd' => '{}', ] @@ -119,7 +122,7 @@ public function it_returns_a_paged_result_set_for_the_given_search_parameters(): ->withBody( (object) [ '@id' => 'http://foo.bar/places/bdc0f4ce-a211-463e-a8d1-d8b699fb1159', - '@type' => 'Place', + '@type' => 'event,place', // 'Place', 'regions' => ['foo', 'bar'], 'originalEncodedJsonLd' => '{}', ] diff --git a/tests/ElasticSearch/Operations/AbstractMappingTestCase.php b/tests/ElasticSearch/Operations/AbstractMappingTestCase.php index 9e8836bc..f2ab7f34 100644 --- a/tests/ElasticSearch/Operations/AbstractMappingTestCase.php +++ b/tests/ElasticSearch/Operations/AbstractMappingTestCase.php @@ -26,7 +26,7 @@ public function it_updates_the_mapping_of_the_given_document_type_with_the_expec ->with( [ 'index' => $indexName, - 'type' => $documentType, + // 'type' => $documentType, 'body' => $mappingBody, ] ); diff --git a/tests/ElasticSearch/Operations/CreateAutocompleteAnalyzerTest.php b/tests/ElasticSearch/Operations/CreateAutocompleteAnalyzerTest.php index 2c75f25f..d1ba0d1c 100644 --- a/tests/ElasticSearch/Operations/CreateAutocompleteAnalyzerTest.php +++ b/tests/ElasticSearch/Operations/CreateAutocompleteAnalyzerTest.php @@ -25,7 +25,7 @@ public function it_puts_a_new_or_updated_index_template_for_an_autocomplete_anal [ 'name' => 'autocomplete_analyzer', 'body' => [ - 'template' => '*', + 'index_patterns' => '*', 'settings' => [ 'analysis' => [ 'filter' => [ diff --git a/tests/ElasticSearch/Operations/CreateLowerCaseExactMatchAnalyzerTest.php b/tests/ElasticSearch/Operations/CreateLowerCaseExactMatchAnalyzerTest.php index 64aab094..7bba0e72 100644 --- a/tests/ElasticSearch/Operations/CreateLowerCaseExactMatchAnalyzerTest.php +++ b/tests/ElasticSearch/Operations/CreateLowerCaseExactMatchAnalyzerTest.php @@ -25,7 +25,7 @@ public function it_puts_a_new_or_updated_index_template_for_a_lowercase_exact_ma [ 'name' => 'lowercase_exact_match_analyzer', 'body' => [ - 'template' => '*', + 'index_patterns' => '*', 'settings' => [ 'analysis' => [ 'analyzer' => [ diff --git a/tests/ElasticSearch/Operations/IndexRegionsTest.php b/tests/ElasticSearch/Operations/IndexRegionsTest.php index c1374e81..57dde7b8 100644 --- a/tests/ElasticSearch/Operations/IndexRegionsTest.php +++ b/tests/ElasticSearch/Operations/IndexRegionsTest.php @@ -39,7 +39,7 @@ public function it_indexes_all_files_located_in_the_given_path_or_subdirectories [ 'index' => $index, 'id' => 'gem-antwerpen', - 'type' => 'region', + // 'type' => 'region', 'body' => Json::decodeAssociatively( file_get_contents(__DIR__ . '/data/regions/municipalities/gem-antwerpen.json') ), @@ -49,7 +49,7 @@ public function it_indexes_all_files_located_in_the_given_path_or_subdirectories [ 'index' => $index, 'id' => 'gem-leuven', - 'type' => 'region', + // 'type' => 'region', 'body' => Json::decodeAssociatively( file_get_contents(__DIR__ . '/data/regions/municipalities/gem-leuven.json') ), @@ -59,7 +59,7 @@ public function it_indexes_all_files_located_in_the_given_path_or_subdirectories [ 'index' => $index, 'id' => 'prov-vlaams-brabant', - 'type' => 'region', + // 'type' => 'region', 'body' => Json::decodeAssociatively( file_get_contents(__DIR__ . '/data/regions/provinces/prov-vlaams-brabant.json') ), diff --git a/tests/ElasticSearch/Organizer/ElasticSearchOrganizerSearchServiceTest.php b/tests/ElasticSearch/Organizer/ElasticSearchOrganizerSearchServiceTest.php index 8e6c7b51..9a7811d5 100644 --- a/tests/ElasticSearch/Organizer/ElasticSearchOrganizerSearchServiceTest.php +++ b/tests/ElasticSearch/Organizer/ElasticSearchOrganizerSearchServiceTest.php @@ -73,7 +73,10 @@ public function it_returns_a_paged_result_set_for_the_given_search_query(): void $response = [ 'hits' => [ - 'total' => 962, + 'total' => [ + 'value' => 962, + 'relation' => 'eq', + ], 'hits' => [ [ '_index' => $this->indexName, @@ -96,7 +99,7 @@ public function it_returns_a_paged_result_set_for_the_given_search_query(): void ->with( [ 'index' => $this->indexName, - 'type' => $this->documentType, + // 'type' => $this->documentType, 'body' => [ '_source' => ['@id', '@type', 'originalEncodedJsonLd', 'regions'], 'from' => 960,