Skip to content

Commit

Permalink
Merged branch '2.0' into 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed May 26, 2020
2 parents a5991db + 5b8f0eb commit 4afad97
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"php": "^7.3",
"ezsystems/ezplatform-kernel": "~1.0.0@dev",
"ezsystems/ezplatform-kernel": "~1.0.3@dev",
"netgen/query-translator": "^1.0.2",
"symfony/http-kernel": "^5.0",
"symfony/dependency-injection": "^5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function mapFields(Content $content)
new Field(
'content_remote_id',
$contentInfo->remoteId,
new FieldType\IdentifierField()
new FieldType\RemoteIdentifierField()
),
new Field(
'content_modification_date',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function mapFields(Content $content)
$fields[] = new Field(
'location_remote_id',
$locationData['remote_ids'],
new FieldType\MultipleIdentifierField()
new FieldType\MultipleRemoteIdentifierField()
);
$fields[] = new Field(
'location_path_string',
Expand All @@ -97,7 +97,7 @@ public function mapFields(Content $content)
$fields[] = new Field(
'main_location_remote_id',
$mainLocation->remoteId,
new FieldType\IdentifierField()
new FieldType\RemoteIdentifierField()
);
$fields[] = new Field(
'main_location_visible',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function mapFields(Location $location)
new Field(
'remote_id',
$location->remoteId,
new FieldType\IdentifierField()
new FieldType\RemoteIdentifierField()
),
new Field(
'parent_id',
Expand Down
16 changes: 3 additions & 13 deletions lib/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
* @version //autogentag//
*/
namespace EzSystems\EzPlatformSolrSearchEngine;

Expand Down Expand Up @@ -481,16 +479,8 @@ public function supports(int $capabilityFlag): bool
*/
public function deleteTranslation(int $contentId, string $languageCode): void
{
$idPrefix = $this->mapper->generateContentDocumentId($contentId, $this->sanitizeInput($languageCode));

$this->gateway->deleteByQuery("_root_:{$idPrefix}*");
}

/**
* Sanitize string before injecting into Search Engine query
*/
protected function sanitizeInput(string $input): string
{
return preg_replace('([^A-Za-z0-9/]+)', '', $input);
$this->gateway->deleteByQuery(
"content_id_id:{$contentId} AND meta_indexed_language_code_s:{$languageCode}"
);
}
}

0 comments on commit 4afad97

Please sign in to comment.