Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We should consider to merge this module in search_api_solr 8.x-2.x and invite dcam as co-maintainer.
Comments
Comment #2
drunken monkeyYes, I'm all for that. It seems the necessary code is small enough to make no large impact, but it's very handy to have within the module so people can reliably find the functionality.
Comment #3
sylus CreditAttribution: sylus commentedAgreed with this as well, have been using search_api_solr_datasource quite successfully with views + panels + facets in the past few weeks with zero issues.
Comment #4
dcam CreditAttribution: dcam commentedIf you two think it would be worthwhile to roll this into Search API Solr, then I'm ok with it. With the work that @drunken_monkey put into it today I think it will be much closer to being ready for that to happen. I'll do a thorough review of the changes he's proposed after work tonight, but I can tell from looking through them that they fix a lot of things that I've thought about changing.
If you want to make me a co-maintainer when that happens, that would be awesome. I'm more than willing to continue being responsible for it and to help out with other issues.
Comment #5
mkalkbrennerIf we dive into the details and advanced features it seems to make more and more sense to move the code to search_api_solr, maybe as sub-module.
I suggest that you create such a big patch once you finished the current iteration with @drunken_monkey
Comment #6
mkalkbrennerThe 8.x-2.x branch of Search API Solr Search is available now. So I suggest to go ahead.
If everybody agrees, I recommend that we don't do it as a patch but as a git merge. Just like we successfully did it for Search API Multilingual Solr Search.
@dcam: Ready for co-maintaining? :-)
Comment #7
dcam CreditAttribution: dcam commentedI'm still honored that you're considering this as a submodule. The truth is that I haven't put any time into it since May. I shifted gears during the summer and started working hard on the other modules that I already maintain. There was one in particular that I'd neglected for a while and has required a lot of my contribution time. I realize that's probably not welcome news from the standpoint of integrating the datasource as a submodule, but hopefully it demonstrates that I'm trying to be a responsible maintainer.
@drunken_monkey's pull request is still outstanding and someone else opened a new bug report on Friday that I wasn't able to debug over the weekend. I think that I should probably resolve those two issues before the merge, unless you feel that there's a pressing need to do it sooner. I imagine there isn't, but let me know if you feel otherwise. I think that I can wrap up that work by the end of the week.
Comment #8
mkalkbrennerdrunken monkey and myself agreed that this module makes a lot of sense :-)
But just like proven by the last bug report on github, this module will always be kind of "behind" if it's not part of Search API Solr Search.
That would change if we merge it as sub-module.
If you find some time, it would be nice if you can document a test case. A (complete) solr config for testing would be great, too.
I can offer to turn that into phpunit tests.
@drunken monkey: Can you update your PR to be applyable again.
https://github.com/dcameron/search_api_solr_datasource
Comment #9
sylus CreditAttribution: sylus commentedWoot really excited to see this make its way as have been using the github repo + drunken_monkey's patch and have created about 10 cores linked to CKAN leveraging search api solr datasource.
I can help with the review once this gets merged.
If possible if can mention any additional changes on top of what was in dev + drunken_monkeys patch.
Comment #10
mkalkbrennerI already merged the code and the PR locally :-)
But I consider to create a new Backend instead of implementing hooks in search_api_solr_datasource.module.
Comment #11
dcam CreditAttribution: dcam commentedI considered creating a new backend. I rejected the idea back in the Spring because doing so required me to override some very long and complicated methods from the default Solr backend just to make minor changes to functionality. I believed that a lot of technical debt would be incurred, requiring me to keep large amounts of code up to date with changes in the base class. I think SearchApiSolrBackend::search() was the method causing the most concern. Ultimately, I didn't implement alter hooks because they were the easier thing to do or because I'm stuck in our procedural code past; I did it to prevent future problems.
I haven't looked at the Solr backend class in a while, so I don't know if those classes have be refactored with smaller methods. I'll check it out and see if the situation has changed. If not, perhaps I could propose changes that would make it easier for me to override the code that has to be altered to make it possible to get results from non-search-api indexes.
Comment #12
mkalkbrennerI uploaded a first draft to #2913199: Merge Search API Solr Datasource.
BTW the final "patch" would be merge that keeps all the git history and reflects all authors and credits.
Comment #13
mkalkbrenner@dcam: The backend class offers callbacks that are similar to the hooks.
Comment #14
mkalkbrennerSince there is no fatal error I directly pushed the merge to https://github.com/mkalkbrenner/search_api_solr/tree/8.x-2.x
I hope that eases the discussion and enables forks for further PRs.
Comment #15
mkalkbrennerSince the existing tests are still green after the merge I didn't horribly break anything ;-)
https://travis-ci.org/mkalkbrenner/search_api_solr/builds/282489131
Comment #16
dcam CreditAttribution: dcam commented@mkalkbrenner: I know. I looked at those too. Extending the backend meant adding an extra setup step - picking the right backend to use. I thought it might be more usable if I just implemented the hooks. I'll admit it could be a minor concern, but that was the reason for my choice.
Comment #17
mkalkbrennerIn my proposal I replaced "enabling the module" by "selecting the backend". Furthermore I see more advantages:
Comment #18
dcam CreditAttribution: dcam commentedFair enough. I'm going to take a look at it this evening.
Comment #19
mkalkbrennerI now tried the feature for the first time. It worked out of the box as I tried to search a different D8 multilingual context - I'm impressed!
So I decided to push the code to drupal.org right away and to declare #2913199: Merge Search API Solr Datasource as fixed!
Congratulations to @dcam for your first 40 commits ;-)
Nevertheless I already realized a lot of things that need to be improved. But that should be done in separate issues. As well as a set of tests.
@dcam: Could you add some notes on the project pages?
Comment #20
dcam CreditAttribution: dcam commentedWow, thank you! This is a big day for me. I appreciate the support that you and @drunken monkey have given to this project.
Do you mean that you want me to add documentation to the project docs?
Comment #21
mkalkbrenner@dcam: Sorry for the delay.
No. I mean that the merge should be mentioned at https://www.drupal.org/sandbox/dcam/2867828 and https://github.com/dcameron/search_api_solr_datasource
Comment #22
dcam CreditAttribution: dcam commentedYeah, you're right. I have a little spare time this morning. I'll do that now.