Hello,
I have created a solr backend extending SearchApiSolrBackend class.
Since Drupal\search_api_attachments\Plugin\search_api_attachments\SolrExtractor has the backends keys hardcoded, my backend won't show in the option list.
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = [];
$conditions = [
'status' => TRUE,
'backend' => [
'search_api_solr',
'search_api_solr_acquia',
'search_api_solr_acquia_multi_subs',
],
];
.......
Is there any logic that we can do here for showing it?
The only way I have found is to comment the 'backend' key out from the array.
Thanks in advance.
Comments
Comment #2
tuwebo commentedAdded patch that removes the backend condition, show any available backends will be shown in the option list.
Comment #3
tuwebo commentedSorry, I've forgot to change issue status.
Comment #4
mkalkbrennerSince Search API Solr introduced Connectors, the use-cases for implementeng own backends should be very rare.
For example the Acquia Search connector doesn't provide it's own backend anymore but a Connector plugin.
Anyway, hard-coding the backends here is a bad thing. At least that is a blocker for Search API Solr Multilingual.
Comment #5
mkalkbrennerI got the idea that you want to limit the selection to Solr based servers, and not database backends for example.
The right fix would be to load all servers and iterate over them to check if they implement Drupal\search_api_solr\SolrBackendInterface
Comment #6
mkalkbrennerComment #7
mkalkbrennerComment #8
tuwebo commentedHi @mkalkbrenner,
Thank you very much for the review. Exactly, what I ment (or tried to) is what you said in comment #5 #2809083-5: Allow backend configuration to select backends implementing SolrBackendInterface.
I confirm that patch in #7 works fine for me.
Thanks.
Comment #9
tuwebo commentedSorry, I din't mention my use case:
Don't know if this is the best solution, but I am able to select this backend with the patch #7 applied.
Comment #10
mkalkbrenneraccording to #8
Comment #12
izus commentedThanks all.
This is now merged and will be part of today's release ( first beta)