diff --git a/composer.lock b/composer.lock index e41944f7640752c707a934b7562e9cd42f4e6ab3..d3a06dfcf1acce62b50c375ca7ed2d05710b3e27 100755 --- a/composer.lock +++ b/composer.lock @@ -58,16 +58,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.199.2", + "version": "3.199.3", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "edc87cdd32545eb443b2b11070cbcdc29ecc8d95" + "reference": "132a1148ebb63d04023837bcf9a36f49b308a0bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/edc87cdd32545eb443b2b11070cbcdc29ecc8d95", - "reference": "edc87cdd32545eb443b2b11070cbcdc29ecc8d95", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/132a1148ebb63d04023837bcf9a36f49b308a0bd", + "reference": "132a1148ebb63d04023837bcf9a36f49b308a0bd", "shasum": "" }, "require": { @@ -143,9 +143,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.199.2" + "source": "https://github.com/aws/aws-sdk-php/tree/3.199.3" }, - "time": "2021-10-22T18:14:43+00:00" + "time": "2021-10-25T18:17:28+00:00" }, { "name": "doctrine/annotations", @@ -2520,12 +2520,12 @@ "source": { "type": "git", "url": "https://github.com/subugoe/EMOBundle.git", - "reference": "7351187ec271b5579fdae9ab98a808ced26769b1" + "reference": "c53806b23dd7b10b0c61e0d26c2967c010a90275" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/subugoe/EMOBundle/zipball/7351187ec271b5579fdae9ab98a808ced26769b1", - "reference": "7351187ec271b5579fdae9ab98a808ced26769b1", + "url": "https://api.github.com/repos/subugoe/EMOBundle/zipball/c53806b23dd7b10b0c61e0d26c2967c010a90275", + "reference": "c53806b23dd7b10b0c61e0d26c2967c010a90275", "shasum": "" }, "require": { @@ -2563,7 +2563,7 @@ "issues": "https://github.com/subugoe/EMOBundle/issues", "source": "https://github.com/subugoe/EMOBundle/tree/master" }, - "time": "2021-10-24T18:27:33+00:00" + "time": "2021-10-26T14:39:42+00:00" }, { "name": "symfony/asset", @@ -6479,16 +6479,16 @@ "packages-dev": [ { "name": "composer/semver", - "version": "3.2.5", + "version": "3.2.6", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + "reference": "83e511e247de329283478496f7a1e114c9517506" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", + "reference": "83e511e247de329283478496f7a1e114c9517506", "shasum": "" }, "require": { @@ -6540,7 +6540,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.5" + "source": "https://github.com/composer/semver/tree/3.2.6" }, "funding": [ { @@ -6556,7 +6556,7 @@ "type": "tidelift" } ], - "time": "2021-05-24T12:41:47+00:00" + "time": "2021-10-25T11:34:17+00:00" }, { "name": "composer/xdebug-handler", diff --git a/solr/gfl/conf/schema.xml b/solr/gfl/conf/schema.xml index 195d14e4f25aa7e0a246e6f1bb963785515807b6..7478ca4ac1fafba788f0b22597da726a79e1760a 100755 --- a/solr/gfl/conf/schema.xml +++ b/solr/gfl/conf/schema.xml @@ -114,6 +114,7 @@ + diff --git a/src/Import/TEIToSolrImport.php b/src/Import/TEIToSolrImport.php index 0813dcb80e515f20fb88c2dffce0892083f9d7bb..5056e12b3d23c55e4b395bd5f80054c65aa188a6 100644 --- a/src/Import/TEIToSolrImport.php +++ b/src/Import/TEIToSolrImport.php @@ -94,6 +94,7 @@ class TEIToSolrImport implements ImporterInterface $notesUuids = []; $pagesSics = []; $pagesDates = []; + $pagesAllAnnotationIds = []; foreach ($pages as $key => $page) { if ($key > 0) { @@ -107,6 +108,7 @@ class TEIToSolrImport implements ImporterInterface $pagesNotesUuids[$pageIndex] = $this->editedTextService->getNotes(); $pagesDates[$pageIndex] = $this->editedTextService->getDates(); $pagesSics[$pageIndex] = $this->editedTextService->getSics(); + $pagesAllAnnotationIds[$pageIndex] = $this->editedTextService->getAllAnnotationIds(); $pageLevelEditedText[] = $editedDoc->saveHTML(); @@ -139,6 +141,7 @@ class TEIToSolrImport implements ImporterInterface $solrDocument->setPagesSegs($pagesSegs); $solrDocument->setPagesSics($pagesSics); $solrDocument->setPagesDates($pagesDates); + $solrDocument->setAllAnnotationIds($pagesAllAnnotationIds); return $solrDocument; } @@ -869,6 +872,7 @@ class TEIToSolrImport implements ImporterInterface $pagesNotesUuids = $solrDocument->getPagesNotesUuids(); $pagesSegs = $solrDocument->getPagesSegs(); $pagesDates = $solrDocument->getPagesDates(); + $pagesAllAnnotationIds = $solrDocument->getAllAnnotationIds(); $pagesSics = $solrDocument->getPagesSics(); @@ -1024,6 +1028,10 @@ class TEIToSolrImport implements ImporterInterface $childDoc->page_dates_ids = array_keys($pagesDates[$i]); } + if (isset($pagesAllAnnotationIds[$i]) && !empty(($pagesAllAnnotationIds[$i]))) { + $childDoc->page_all_annotation_ids = $pagesAllAnnotationIds[$i]; + } + $update->addDocument($childDoc); } } diff --git a/src/Model/SolrDocument.php b/src/Model/SolrDocument.php index 55920e10facdb007c7db6fa9b1211132492bbfa1..5cb5b4dc98e2397b05028a65ae1f4f9c116f2f75 100755 --- a/src/Model/SolrDocument.php +++ b/src/Model/SolrDocument.php @@ -13,6 +13,7 @@ class SolrDocument private array $pagesNotesUuids; private array $pagesSegs; private array $pagesSics; + private array $allAnnotationIds; private string $transcriptedText; public function getEditedText(): string @@ -60,6 +61,11 @@ class SolrDocument return $this->pagesSics; } + public function getAllAnnotationIds(): array + { + return $this->allAnnotationIds; + } + public function getTranscriptedText(): string { return $this->transcriptedText; @@ -128,6 +134,11 @@ class SolrDocument return $this; } + public function setAllAnnotationIds(array $allAnnotationIds): void + { + $this->allAnnotationIds = $allAnnotationIds; + } + public function setTranscriptedText(string $transcriptedText): SolrDocument { $this->transcriptedText = $transcriptedText; diff --git a/src/Service/EditedTextService.php b/src/Service/EditedTextService.php index 20190db0bf5e3fcb3c9fff98621a3b7caeabbb7f..8b12fe19292b4d0f42e4978808bc300c53f287fa 100644 --- a/src/Service/EditedTextService.php +++ b/src/Service/EditedTextService.php @@ -22,6 +22,7 @@ class EditedTextService extends CommonTransformService private array $notes = []; private array $segs = []; private array $sics = []; + private array $allAnnotationIds = []; public array $ignoreChildrenList = []; @@ -36,7 +37,9 @@ class EditedTextService extends CommonTransformService public function createUuid(): ?string { - return uuid_create(UUID_TYPE_RANDOM); + $uuid = uuid_create(UUID_TYPE_RANDOM); + $this->allAnnotationIds[] = $uuid; + return $uuid; } public function getDates(): array @@ -64,6 +67,11 @@ class EditedTextService extends CommonTransformService return $this->sics; } + public function getAllAnnotationIds(): array + { + return $this->allAnnotationIds; + } + protected function handleBibl(DOMNode $teiEl, HTMLDocument $doc): ?DOMNode { if ($teiEl->hasChildNodes() && 'ref' === $teiEl->childNodes[0]->nodeName) {