From 94f06c6eeab35246055028c601a5c4ef0cb33101 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Tue, 12 Jul 2022 14:24:31 +0200 Subject: [PATCH 1/3] IBX-3116: Changed content section identifier to string field --- .../ContentFieldMapper/BlockDocumentsBaseContentFields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php b/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php index f649ec76..ff48084f 100644 --- a/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php +++ b/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php @@ -166,7 +166,7 @@ public function mapFields(Content $content) new Field( 'content_section_identifier', $section->identifier, - new FieldType\IdentifierField() + new FieldType\StringField() ), new Field( 'content_section_name', From 9d665367d9e6599b395efb721ea3ddbbdc91cef5 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Tue, 12 Jul 2022 16:51:33 +0200 Subject: [PATCH 2/3] IBX-3116: Updated section Solr representation --- lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php | 2 +- lib/Query/Common/SortClauseVisitor/SectionIdentifier.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php b/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php index 11329f48..fab6fc5e 100644 --- a/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php +++ b/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php @@ -32,7 +32,7 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null) ' OR ', array_map( static function (string $value) { - return 'content_section_identifier_id:"' . $value . '"'; + return 'content_section_identifier_s:"' . $value . '"'; }, (array) $criterion->value ) diff --git a/lib/Query/Common/SortClauseVisitor/SectionIdentifier.php b/lib/Query/Common/SortClauseVisitor/SectionIdentifier.php index a939d30e..ccd9c6c5 100644 --- a/lib/Query/Common/SortClauseVisitor/SectionIdentifier.php +++ b/lib/Query/Common/SortClauseVisitor/SectionIdentifier.php @@ -35,6 +35,6 @@ public function canVisit(SortClause $sortClause) */ public function visit(SortClause $sortClause) { - return 'content_section_identifier_id' . $this->getDirection($sortClause); + return 'content_section_identifier_s' . $this->getDirection($sortClause); } } From ac4cbbee34b2e974f328901ad0f638617a29bf48 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Thu, 14 Jul 2022 16:36:05 +0200 Subject: [PATCH 3/3] IBX-3116: Made `IdentifierField` 'raw' --- .../ContentFieldMapper/BlockDocumentsBaseContentFields.php | 2 +- lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php | 2 +- lib/Query/Common/SortClauseVisitor/SectionIdentifier.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php b/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php index ff48084f..e57a243a 100644 --- a/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php +++ b/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php @@ -166,7 +166,7 @@ public function mapFields(Content $content) new Field( 'content_section_identifier', $section->identifier, - new FieldType\StringField() + new FieldType\IdentifierField(['raw' => true]) ), new Field( 'content_section_name', diff --git a/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php b/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php index fab6fc5e..11329f48 100644 --- a/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php +++ b/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php @@ -32,7 +32,7 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null) ' OR ', array_map( static function (string $value) { - return 'content_section_identifier_s:"' . $value . '"'; + return 'content_section_identifier_id:"' . $value . '"'; }, (array) $criterion->value ) diff --git a/lib/Query/Common/SortClauseVisitor/SectionIdentifier.php b/lib/Query/Common/SortClauseVisitor/SectionIdentifier.php index ccd9c6c5..a939d30e 100644 --- a/lib/Query/Common/SortClauseVisitor/SectionIdentifier.php +++ b/lib/Query/Common/SortClauseVisitor/SectionIdentifier.php @@ -35,6 +35,6 @@ public function canVisit(SortClause $sortClause) */ public function visit(SortClause $sortClause) { - return 'content_section_identifier_s' . $this->getDirection($sortClause); + return 'content_section_identifier_id' . $this->getDirection($sortClause); } }