Support from Acquia helps fund testing for Drupal Acquia logo

Comments

q0rban’s picture

Status: Active » Needs work
FileSize
4.31 KB

So, everything here seems to be working, except that on my localhost, urls in results from the site in which the search originated show the base url as 'default', ie http://default/foo/bar. I can't figure out why this is happening, it's as if it's looking at the dir that the settings.php file is in.

q0rban’s picture

Status: Needs work » Needs review

Ok, this is only happening to me locally, when I push this to a server, it works fine, however it is to be noted that the sites I'm testing with on the server are Drupal multisites, so the directory they are in is the actual domain name of the site. Therefore the whole 'default' thing may still be an issue on sites where settings.php is located in sites/default. More testing needed.

q0rban’s picture

Take 2, fixes paging and overall cleans up the patch (as in less changing).

slip’s picture

Nice work q0rban! I'm using the solr multisite module w/ your patch.

I've updated the patch. My version has your changes + a few fixes for breadcrumbs, the admin interface (s/apachesolr_index_updated(time());/apachesolr_index_set_last_updated(time());/) and the current search block.

robertDouglass’s picture

Reroll. Untested.

robertDouglass’s picture

Why is search_view re-implemented?

 /**
+ * Re-implementation of search_view().
+ */
+function apachesolr_multisitesearch_view($type = NULL) {
...
robertDouglass’s picture

FileSize
4.76 KB

This is the patch that I'm using and testing. It's removed the re-implementation of search_view.

robertDouglass’s picture

FileSize
4.75 KB

Just fixed the whitespace issue.

robertDouglass’s picture

FileSize
12.04 KB

Here's the latest that I'm using.

wmostrey’s picture

Status: Needs review » Reviewed & tested by the community

Robert's patch in #9 is a great starting point for 6.x-2.x-dev. Tested it extensively and it works.

robertDouglass’s picture

FileSize
13.71 KB

Now with spelling suggestions and snippet highlighting.

wmostrey’s picture

Re #11: Tested with two basic sites running Solr, no Nutch involved.

  • Snippet highlighting works, but I'm seeing no spelling suggestions.
  • I'm only seeing results from the local site, not from any other indexed site (although they are recognized in admin/settings/apachesolr/multisite-filters).
  • I'm not seeing any of the multisite filter blocks like 'Apache Solr Multisite Search: Current search' or 'Apache Solr Multisite Search: Filter by site'.
wmostrey’s picture

Status: Reviewed & tested by the community » Needs work

Search results from all sites appear with the patch in #5, but not with the one in #11.

wmostrey’s picture

Assigned: q0rban » Unassigned
Status: Needs work » Needs review
FileSize
10.49 KB

Here's the version we're currently using.

jpmckinney’s picture

Note that #11 (and #14) contains a useful snippet from #990254: Doesn't work with spellchecker and suggestions

jpmckinney’s picture

jpmckinney’s picture

jpmckinney’s picture

#11 and #14 differ in that in #11 apachesolr_multisitesearch_view delegates to apachesolr_search_view, but #14 instead re-implements apachesolr_search_view. #14 is right, because apachesolr_search_view will not call apachesolr_multisitesearch_search, which we want it to do.

I don't know why #11 removes the apachesolr_multisitesearch_has_searched() check from apachesolr_multisitesearch_block. #11 adds a $caller parameter to apachesolr_multisitesearch_search, but it seems to do so uselessly, as nothing calls apachesolr_multisitesearch_search with a third parameter (in fact, in #11 I don't think anything calls apachesolr_multisitesearch_search). I don't know why #11 adds a second condition here:

+  if (empty($query->multisite) && $caller != 'apachesolr_multisitesearch') {

Future patches should not contain regressions mentioned in #12 and #13.

pwolanin’s picture

Should we have a 6.x-2.x branch? Not sure it will/should ever have more than a -dev release.

wmostrey’s picture

I'm all for adding a 6.x-2.x release. We at Telenet will be using and supporting this version on multiple production sites.

pwolanin’s picture

Feel free to make the branch, but again, I consider 6.x-2.x pretty much EOL.

wmostrey’s picture

I know, which I think is a shame...

I don't have commit access to this project.

jpmckinney’s picture

I'll create the branch and review the patch in the next two weeks.

pwolanin’s picture

Well, the goal is to make a 6.x-3.x that's compatible with 7.x-1.x. I'd expect that here also, and ideally most of the important 6.x-2.x feature will exist in some form there.

jpmckinney’s picture

FileSize
22.88 KB

Incremental diff to the patch in #14.

I think it's safe to use apachesolr_search_language_name to theme the language facet.

I've brought a bunch of functions in line with their apachesolr 6.x-2.x counterparts and added @see comments where appropriate:

* apachesolr_multisitesearch_enabled_facets_form
* apachesolr_multisitesearch_view
* apachesolr_multisitesearch_execute
* apachesolr_multisitesearch_has_searched
* apachesolr_multisitesearch_block
* apachesolr_multisitesearch_enabled_facets

Got rid of apachesolr_multisitesearch_basic_params and instead appended to the fl param in apachesolr_multisitesearch_apachesolr_modify_query.

Got rid of apachesolr_multisitesearch_process_response and instead changed link, type, and user in apachesolr_multisitesearch_apachesolr_process_results.

jpmckinney’s picture

Brought apachesolr_multisitesearch_form_search_form_alter in sync with apachesolr module.

Change:

$response = apachesolr_static_response_cache(NULL, 'apachesolr_search')

to

$response = apachesolr_static_response_cache(NULL, 'apachesolr_multisearch')

Change:

apachesolr_current_query()

to:

apachesolr_current_query(NULL, 'apachesolr_multisearch')

Got rid of empty($form_state['post']) check as it doesn't exist in apachesolr.

I think the current code may behave badly with apachesolr_search_browse.

I can't bring apachesolr_multisitesearch_add_facet_params in sync without implementing a multisearch version of apachesolr_get_facet_definitions

jpmckinney’s picture

FileSize
24.41 KB
jpmckinney’s picture

FileSize
26.09 KB

Here's a patch that can be applied against a fresh git checkout.

jpmckinney’s picture

Status: Needs review » Needs work
FileSize
27.12 KB

Brought apachesolr_multisitesearch_currentsearch in sync with apachesolr module.

There is a ton of duplication of code here from the apachesolr module, and most of it is due to the fact that we re-implement the facet system. Why can't we reuse apachesolr's facet system? Do we really need these parallel systems? It adds a big maintenance burden on this module and makes it a few hundred lines longer.

As mentioned above, I can't bring apachesolr_multisitesearch_add_facet_params in sync without implementing a multisearch version of apachesolr_get_facet_definitions. Also, the current code will behave badly with apachesolr_search_browse. I'm postponing any more personal work on this module until I understand why we implement a parallel facet system.

pwolanin’s picture

@jpmckinney - the ad-hoc design of the facet system and the duplication it leads to is part of why we're putting so much effort into using the more abstracted Facet API module for 7.x, with a planned/hoped 6.x-3.x backport.

wmostrey’s picture

Peter,

Could we get a 2.x-dev release, based on #14 to start patching against? I used that version as a starting point for the D7 version at #1006994: Port Apache Solr Multisite Search to Drupal 7.

Feel free to add me as a co-maintainer so I can manage both (as mentioned in #21). I know 2.0 is pretty much EOL but it's still much used, and it's a great version between the upcoming 7 and a future back-ported 6.3.

wmostrey’s picture

Status: Needs work » Closed (duplicate)

Marking as a duplicate of #1006994: Port Apache Solr Multisite Search to Drupal 7 (which now has a patch to test) since 6.2 is EOL.

As per the roadmap we'll fix the Drupal 7 version first, and then back-port to 6.3.