We should consider to merge this module in search_api_solr 8.x-2.x and invite dcam as co-maintainer.

Comments

mkalkbrenner created an issue. See original summary.

drunken monkey’s picture

Yes, 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.

sylus’s picture

Agreed 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.

dcam’s picture

If 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.

mkalkbrenner’s picture

If 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

mkalkbrenner’s picture

The 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? :-)

dcam’s picture

I'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.

mkalkbrenner’s picture

drunken 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

sylus’s picture

Woot 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.

mkalkbrenner’s picture

I 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.

dcam’s picture

I 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.

mkalkbrenner’s picture

I 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.

mkalkbrenner’s picture

@dcam: The backend class offers callbacks that are similar to the hooks.

mkalkbrenner’s picture

Since 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.

mkalkbrenner’s picture

Since 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

dcam’s picture

@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.

mkalkbrenner’s picture

In my proposal I replaced "enabling the module" by "selecting the backend". Furthermore I see more advantages:

  • The new backend doesn't interfere with the multilingual backends.
  • Some of the newer features might need to be turned off for the "Any Schema Backend". That might be easier with a separate backend.
dcam’s picture

Fair enough. I'm going to take a look at it this evening.

mkalkbrenner’s picture

Status: Active » Fixed

I 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?

dcam’s picture

Wow, 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?

mkalkbrenner’s picture

@dcam: Sorry for the delay.

Do you mean that you want me to add documentation to the project docs?

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

dcam’s picture

Yeah, you're right. I have a little spare time this morning. I'll do that now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.