Closed (fixed)
Project:
Apache Solr Views
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Feb 2012 at 18:35 UTC
Updated:
13 Jun 2012 at 08:41 UTC
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 commentedBumping this issue.
Is any of the maintainers giving support?
Julian Mancera
Comment #2
julianmancera commentedHi all,
I found an issue on my change above here is the final one
Julian Mancera
Comment #3
n20 commentedthanks for the quick fix... i had exactly the same problem.
Comment #4
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 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 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 commentedHi Nick,
Here is how to reproduce it
Regards,
Julian Mancera
Comment #9
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 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