Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
When working with facets the view path for facet filtering link is not being set in the Sorl Base Query. The this happens in the line 93 of the apachesolr_views_query.inc
$query = new SolrBaseQuery('apachesolr', $solr, $params, $solrsort, '');
It should be fixed as follows:
$query = new SolrBaseQuery('apachesolr', $solr, $params, $solrsort, 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
Comments
Comment #1
julianmancera CreditAttribution: julianmancera commentedBumping this issue.
Is any of the maintainers giving support?
Julian Mancera
Comment #2
julianmancera CreditAttribution: julianmancera commentedHi all,
I found an issue on my change above here is the final one
Julian Mancera
Comment #3
N20 CreditAttribution: N20 commentedthanks for the quick fix... i had exactly the same problem.
Comment #4
janakiram CreditAttribution: janakiram commentedi have done the changes but now i am ending up with slashes //, every time u narrow down the filters u add up with a /..
http://localhost/books///?f[0]=im_field_cushop%3A12
http://localhost/books/////
Comment #5
julianmancera CreditAttribution: julianmancera commentedHi janakiram,
Currently I don´t have a clean fix for this issue, we will need to submit a ticket on the apachesolr module for a quick fix
You should change the function getPath in the Solr_Base_Query.php file to add a conditional so we supress the extra slashes
Regards,
Julian Mancera
Comment #6
julianmancera CreditAttribution: julianmancera commentedHere is the ticket so you can follow
http://drupal.org/node/1538244
Regards,
Julian Mancera
Comment #7
Nick_vhI was hoping to see a use case on how to replicate a problem that would be fixed by this patch. Is there anything like that? or could you write up a small guide that helps us understand why this is needed?
Comment #8
julianmancera CreditAttribution: julianmancera commentedHi Nick,
Here is how to reproduce it
Regards,
Julian Mancera
Comment #9
topham CreditAttribution: topham commentedI modified comment #2 (http://drupal.org/node/1428630#comment-5677664) to rtrim($request[0],'/') with success. This eliminates the need to modify solr_base_query.php.
(solr_base_query can append all the slashes it wants, as long was we remove trailing slashes from $request[0] first we are golden).
Comment #10
ygerasimov CreditAttribution: ygerasimov commentedThanks for pointing out the problem in construction of SolrBaseQuery. I think we should simply pass current_path() value there.
There was another problem when fulltext search used facets get link with keyword added in the end.
I have committed custom ApachesolrViewsSolrBaseQuery that removes this problem. Welcome to test.
Please reopen this issue if still have any problems.
Commit f837a6c