- Issue created by @FeyP
- Issue was unassigned.
- Status changed to Needs review
3 months ago 2:12pm 14 August 2024
When using remote entities, e.g. on a cross-site index, the processor will trigger exceptions, because the remote entity can't be retrieved:
Drupal\search_api\SearchApiException: The datasource with ID '192q7p--entity:node' could not be retrieved for index 'Main'. in Drupal\search_api\Entity\Index->getDatasource() (line 369 of modules/contrib/search_api/src/Entity/Index.php).
Stack trace:
#0 modules/contrib/search_api/src/Entity/Index.php(879): Drupal\search_api\Entity\Index->getDatasource()
#1 modules/contrib/search_api/src/Entity/Index.php(858): Drupal\search_api\Entity\Index->loadItemsMultiple()
#2 modules/contrib/search_api/src/Item/Item.php(203): Drupal\search_api\Entity\Index->loadItem()
#3 modules/contrib/search_api_attachments/src/Plugin/search_api/processor/FilesExtractor.php(202): Drupal\search_api\Item\Item->getOriginalObject()
One possible scenario, very roughly: Have at least two Drupal installations write to the same index. Set up Search API Attachments for at least one of the Drupals. In a full text search view, search for a term that will show results from the one of the other Drupals.
The processor doesn't have to work for remote entities, any required processing can/will be setup at the source. Catch the exception and return. This might seem odd, but it seems to be the "official" solution, as you can see for example here as well as in other processors shipped with Search API.
None.
None.
None.
Needs review
9.0
Code