Inside of apachesolr_search_search is some code that gets values from the $_GET and arg(1) which makes it hard to override those values.
I'm trying to have search respond at the URL of "example.com/explore/keywords here" and in my callback I do:
$results = search_data($keys, $type);
Later on, though, the code gets upset at:
$results = apachesolr_search_execute($keys, $filters, $solrsort, 'search/'. arg(1), $page);
I could change my URL to be "explore/apachesolr_search" but that is ugly. I could use url_rewrite_inbound/outbound, but that's also ugly/painful/not-performance helpful.
So, I changed apachesolr_search.module to read:
$results = apachesolr_search_execute($keys, $filters, $solrsort, 'search/apachesolr_search', $page);
And that works fine. I guess an alternative is to just call apachesolr_search_execute directly. Is that the better solution to this problem?
Comments
Comment #1
gregglesAnother example of this problem is in the fact blocks. When you use them on a url other than search/apachesolr_search they point to the wrong address.
I know I could rebuild those myself - just curious whether that is the "right way" to do it or we should make solr work in more places.
Comment #2
jpmckinney commentedComment #3
jpmckinney commentedSupport for custom URLs is a feature.
Comment #4
jpmckinney commentedComment #5
drupalninja99 commentedsame deal...changing the solr url is really annoying
Comment #6
pwolanin commentednot adding to 6.x at this point
Comment #7
gregglesIs this not relevant for 7.x branch?
Comment #8
jpmckinney commentedThere is significantly less hardcoding in 7.x and it is much easier to do there.