If you've got multiple solr environments configured on a site it's important to know which one to run a query against. apachesolr_search_run() can take an instance of DrupalApacheSolrService, but it's currently not being passed.

Patch that passes this to follow.

Comments

ianthomas_uk’s picture

Status: Active » Needs review
StatusFileSize
new2.35 KB
ianthomas_uk’s picture

Title: Pass DrupalApacheSolrService to apachesolr_search_run() » Add support for multiple solr enviroments by passing DrupalApacheSolrService to apachesolr_search_run()
StatusFileSize
new4.03 KB

I didn't realise it at the time, but the above patch depends on a custom module that I'm using and therefore isn't appropriate.

Here's a new patch that adds a field to the UI to specify the server to run a query on (while still allowing it to fall back to the default server).

The patch also includes the changes from http://drupal.org/files/apachesolr-panels-rows-958906-4.patch for http://drupal.org/node/958906 since otherwise the patches would conflict and an extra try/catch that sneaked in there by accident but I thought I might as well leave in.

nick_vh’s picture

This patch does apply cleanly

acbramley’s picture

Hi sorry it's taken a while for me to get to this, I've been so busy monitoring this project slipped my mind. It seems like you're adding more than just multi solr instance support in this patch?

ianthomas_uk’s picture

It includes the patch for http://drupal.org/node/958906 because a patch against head would have conflicted. I'll happily re-roll without that if you either don't want that change or commit it separately.

There's also an extra try/catch that I added as I was developing the patch and seemed a good thing so I left it in there. Likewise I can remove that or split it into a separate patch if needed.

acbramley’s picture

Yes please re roll with just the multi core functionality as there's a patch here that contains the row functionality, unless this patch provides the same functionality as yours, then we can close the other issue and commit this as a single patch.

Cheers

ianthomas_uk’s picture

Yes, this can be committed as a single patch.

The patch above is a combination of my changes and the patch from 958906 because they both change the same line of code.

acbramley’s picture

Status: Needs review » Closed (fixed)