Closed (duplicate)
Project:
Apache Solr Search
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Feb 2009 at 15:24 UTC
Updated:
23 Apr 2009 at 12:58 UTC
Jump to comment: Most recent file
Comments
Comment #1
pwolanin commentednot really sure this is 100% right. I think this will break if there is a slash included in the keywords (which is allowed):
Note that the D6 search module uses: http://api.drupal.org/api/function/menu_tail_to_arg/6
While for D5:
http://api.drupal.org/api/function/search_get_keys/5
However, it' not clear that apachesolrsearch is correctly handing paths with slashes (and no spaces) at the moment.
E.g. this works:
?q=search/apachesolr_search/beer/+solr
this does not:
?q=search/apachesolr_search/beer/solr
Comment #2
drunken monkeyOh, you're right, that really won't work like this. :-/
Well, next try, this one is based on the fact, that in almost all cases the query will be part of the path, so by truncating the path from the position of the query should produce the path base. Only (?) when arguments would come from a different source, this method would break, in which case no blocks are returned.
OK, one more case in which it would become buggy: If there are other arguments coming after the one for the Solr query. I think this could theoretically be the case in some views. But since those don't work at all at the moment, this patch is still a great improvement.
If I'm right, that is.
Please test!
It seems to work for me.
Comment #3
drunken monkeyI came up with another case of failure, which could a bit more common: exposed views filters. Since these arguments don't get passed in $_GET['q'], this method won't work.
It should be relatively straight-forward to implement a way to take care of those: look at $_GET['QUERY_STRING'], explode() twice into an array of arrays containing keys and values, (sort out filters,) search for the keys in the values, then construct the base path and tell the facet blocks how to add the keys to it.
But even if we implement this just as a fallback-solution, it would considerably bloat up the now rather slim algorithm and it's disputable if this would be worth it.
In any case, slightly modified patch since the other produced errors when apachesolr_get_path_base('') was called.
Comment #4
Scott Reynolds commentedWas able to get it working by using an interface with an updated views implementation
http://drupal.org/node/254565#comment-1427950
Comment #5
David Lesieur commentedIt looks like this issue has been superseded. The Solr_Base_Query class now has a get_path() method.
And issue #337737: Re-Work get_path() so that the facet blocks can be used outside the search page tries to improve how the base path is set.