As the title says, I'd very much like to get rid of the SolrPhpClient dependency before I make a stable release. We override most of the stuff anyways, so this only adds unnecessary complexity both for us and the user.

Comments

nick_vh’s picture

If I were you, I'd steal the classes of apachesolr. They are tested and robust.

drunken monkey’s picture

Title: Get rid of SolrPhpClient dependency » Remove the SolrPhpClient dependency
Status: Active » Needs review
StatusFileSize
new200.7 KB

If I were you, I'd steal the classes of apachesolr. They are tested and robust.

Not as easy as it sounds, but yes, that's what I did. Would have loved to get rid of the flood of copyright notices but in the end I just didn't have the time to write my own solution.

So, here it is, my first try at implementing this. I took the chance to do some major refactoring while I was at it, e.g., moving all include files into the includes/ directory. So, after applying the patch, please execute update.php (or at least clear the cache – the DB update adds a cache table, which isn't really used for normal functionality) immediately!

And, generally, please test and review! This is pretty complex, so I'd like to have some eyes on it before I commit.

drunken monkey’s picture

And here is another one, with a SearchApiSolrField::getRaw() method added for good measure.

minoroffense’s picture

When I patch that against the latest dev the patch applies fine. But when I enable the module, I get the following:

D php: LogicException: Function '_search_api_solr_autoload' not found (function '_search_api_solr_autoload' not found or invalid function name) in      [error]
spl_autoload_register() (line 63 of /var/www/html/drupal/sites/biotalent/modules/contrib/search_api_solr/search_api_solr.install).
Cannot modify header information - headers already sent by (output started at /usr/share/pear/drush/includes/output.inc:37) bootstrap.inc:1212           [warning]
LogicException: Function '_search_api_solr_autoload' not found (function '_search_api_solr_autoload' not found or invalid function name) in spl_autoload_register() (line 63 of /var/www/html/drupal/sites/biotalent/modules/contrib/search_api_solr/search_api_solr.install).
Drush command terminated abnormally due to an unrecoverable error.

This is from a fresh install of search api. I'm using the latest dev copies of search_api and search_api_solr

minoroffense’s picture

Oh, I ran

drush en search_api_solr
drunken monkey’s picture

Thanks a lot for helping me test, and thanks for spotting that error. Seems I forgot to remove the reference to that function in the install hook. Attached is a corrected patch. Please test again!

minoroffense’s picture

I'll be working on a Search API config for a client tomorrow. I'll give the patch a shot then.

spotzero’s picture

I've only done basic testing with a search view, however everything looks good and seems to be working.

Indexing, reindexing, clearing the index, and searching (with filtering and sorting) all worked for me.

I didn't test the install, but the update hook works.

drunken monkey’s picture

Status: Needs review » Fixed

OK, thanks for testing!
Committed.

cpliakas’s picture

Great work, guys!

Status: Fixed » Closed (fixed)

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