Problem/Motivation
This is a copy and paste from elastic_connector #3540361
Currently, the Opensearch Connector module only supports searching indexes that follows the data structure it created.
But, some organizations (especially larger ones) might want to provide a Search UI that is managed by Drupal and searches both the organization's main Drupal site and a number of legacy non-Drupal sites (i.e.: that haven't been migrated to Drupal yet).
#todo determine if opensearch can combine indexes like elasticsearch.
- Elasticsearch B.V.'s Elasticsearch-as-a-Service products offer several ways to combine indexes from multiple sites into a meta-index and/or crawl legacy, non-Drupal sites.
Being able to search an externally-created index would be desirable!
Search API does actually support searching an index that it didn't create and/or doesn't manage. In particular, the Search API Solr module provides 2 Search API datasource plugin implementations (src/Plugin/search_api/datasource/SolrDocument.php and src/Plugin/search_api/datasource/SolrMultisiteDocument.php). These datasource plugins make it possible to search externally-created Solr indexes using Search API's Views plugins.
Proposed resolution
Add a Search API datasource plugin.
Remaining tasks
- Write a merge request
- Review and feedback
- RTBC and feedback
- Commit
- Release
User interface changes
To be determined.
API changes
To be determined. Hopefully only API additions.
Data model changes
To be determined.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | os_view_page_result.png | 117.12 KB | robpowell |
| #4 | os_view_field_config.png | 108.7 KB | robpowell |
| #4 | os_fields.png | 104.43 KB | robpowell |
| #4 | archive_content_v2.json_.txt | 138 bytes | robpowell |
Issue fork search_api_opensearch-3563865
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
robpowellCreating a new datasource plugin is a blackbox for me. I am trying to go commit to commit for the changes in the elasticsearch_connector changes in 3540361.
This commit is my best attempt at matching #3540361's commit
Comment #3
robpowellHere is the commit that adds the datasource, connector, and typed data #3540361's commit
Comment #4
robpowellThis latest commit fixes some bad copy pasta and updates logic to make it work on my local. I have to debug more as it seems like I have to pass the index around more and when the machine name of the index is different than the real index name I get an error.
setup steps
Chopping block
There's some functionality added in the original issues patch that I don't think are necessary here and should probably remove to make the review process easier.
Unknowns and gotchas
Here are some oddities I don't quite understand that may or may not require code changes:
Changes from the original patch elastic_connector #3540361
Since I can't really provide a diff of the changes I thought I'd at call them out here.
Results
I now have a working Drupal -> OS integration for remote content that doesn't get purged. Attached are couple items to follow along.
Attached is my OS search result index, index field config, view field config.
Next steps
Comment #5
robpowellPushed some changes after testing with a single data source of OS document and multiple datasources (content & os document)