I upgraded to the latest ApacheSolr version and I found the following problems:
* OpenSearch no longer creates a proper RSS feed. (Path changed to http://mysite/apache_solr/)
* OpenSearch doesn't expose an RSS feed to a search without strings which can be a standard for ApacheSolr (older issue)

Comments

shaneonabike’s picture

As an update I think that if you install ApacheSolr then hte path is actually http://mysite/apachesolr_search/ but otherwise it defaults to the path specified above

Anonymous’s picture

Component: Code » Third-party modules integration
Status: Active » Postponed (maintainer needs more info)

The path used on Drupal.org is http://drupal.org/search/apachesolr_search/.

I am not sure what you mean by if you install ApacheSolr then the path is actually http://mysite/apachesolr_search/; if ApacheSolr is not installed, then the Apache Solr Search Integration module should not even work. The module is then not supposed to be installed without ApacheSolr.

shaneonabike’s picture

Sorry I got all muddled up in my original message kiam.

What I meant was that I suspect if you don't install Views3 then the default ApacheSolr is the path http://mysite/apache_solr/* rather than http:///apachesolr_sort/*

On the site that I am working on we aren't actually changing the ApacheSolr path this is what is used by the latest ApacheSolr module (w/o Views3). An example of this can be found here - http://library.ole.org/search/apache_solr/test

I'm not sure I have a solution here either then testing for both cases?

I also noticed that in your opensearch you are only checking for filters, but not checking for sort by criteria. This could be a really awesome addition to your great module.

Your original code:

/**
 * Implementation of hook_form_alter
 */
function opensearch_form_alter(&$form, $form_state, $form_id) {
  // Only checking for filters attribute
  if ($form_id == 'search_form' && (arg(2) || (arg(1) == 'apachesolr_search' && $_GET['filters']))) {
    // for pagination etc.
    $get = drupal_query_string_encode($_GET, array('q'));
    $form['basic']['inline']['rss'] = array('#type' => 'markup', '#value' => 
theme('xml_icon', url('opensearch/'. arg(1) .'/'. urlencode(search_get_keys()), array('query' => trim($get)?$get:NULL))));
  }
}

My suggested modification:

/**
 * Implementation of hook_form_alter
 *
 * Overriding opensearch behaviour to A) allow RSS on main page B) to change icon being output
 */
function ole_general_form_alter(&$form, $form_state, $form_id) {
    // Checking for any q value (i.e. filter, solrsort, etc)
    $get = drupal_query_string_encode($_GET, array('q'));
    if ($form_id == 'search_form' && (arg(2) || ($search == 'apachesolr_search' && !empty($get)))) {
      // for pagination etc.
      $get = drupal_query_string_encode($_GET, array('q'));
      $form['basic']['inline']['rss'] = array('#type' => 'markup', '#value' => theme('xml_icon', url('opensearch/'. arg(1) .'/'. urlencode(search_get_keys()), array('query' => trim($get)?$get:NULL))));
  }
}

Note: I simply grabbed all the q values and determined if that is empty or not. If it isn't empty then apachesolr must be taking on either a filter, sort, etc. Not entirely sure whether this is the best code to handle this situation.

shaneonabike’s picture

Status: Postponed (maintainer needs more info) » Active

Just updating the status sorry

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

What I meant was that I suspect if you don't install Views3 then the default ApacheSolr is the path http://mysite/apache_solr/* rather than http:///apachesolr_sort/*

The URL used from all the modules implementing the search hook to return search results is always http://example.com/search/<module_name>. AFAIK, such URL doesn't change when you install Views 3, which doesn't handle those URLs; it is possible that you assign those URLs to a view, but that is a different case.

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Fixed

The cause of this issue was probably the one reported in #829644: Open search triggers search on search landing page; as the other issue report is marked as fixed, I am marking as fixed this issue too.

Status: Fixed » Closed (fixed)

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