Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oxy86/custom_tables_datasource
Drupal 10 module providing a simple implementation of a custom datasource for Drupal Search API. Our custom datasource plugin consumes data from custom tables inside the drupal database so that they can be indexed by the corresponding Search API index on any supported server (database, solr, etc).
https://github.com/oxy86/custom_tables_datasource
drupal drupal10 search search-api
Last synced: about 1 month ago
JSON representation
Drupal 10 module providing a simple implementation of a custom datasource for Drupal Search API. Our custom datasource plugin consumes data from custom tables inside the drupal database so that they can be indexed by the corresponding Search API index on any supported server (database, solr, etc).
- Host: GitHub
- URL: https://github.com/oxy86/custom_tables_datasource
- Owner: oxy86
- Created: 2024-02-19T01:33:49.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-20T10:20:47.000Z (12 months ago)
- Last Synced: 2024-11-14T15:20:51.521Z (3 months ago)
- Topics: drupal, drupal10, search, search-api
- Language: PHP
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Custom Tables Datasource for Drupal Search API
This Drupal 10 module provides a simple implementation of a custom datasource for
Drupal Search API.
Our custom datasource plugin consumes data from custom tables inside the drupal database
so that they can be indexed by the corresponding Search API index on any supported server (database, solr, etc).NOTE: You have to update the table definitions with your own in CustomEntity::getPropertyDefinitions() and CustomDataType::getPropertyDefinitions().
After you install the module, you have to select the Custom Tables Datasource in Search API -> Your index -> Datasources
After some data is updated, you can call the tracking manager service to update the index, like this:
```php
$tracking_manager = \Drupal::getContainer()->get('search_api.custom_tables_datasource.tracking_manager');
$tracking_manager->dataUpdate($updated_data);
```@see https://www.drupal.org/docs/8/modules/search-api/getting-started/adding-an-index
@see https://www.drupal.org/docs/8/modules/search-api/developer-documentation/providing-a-new-datasource-plugin
## Maintainer - Report an Issue
- [Dimitris Kalamaras (oxy86)](https://github.com/oxy86)