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,
Cause i cannot use view arguments as issue here for other user: Apache Solr View Argument Handlers Missing D7, and i cannot made it work as the D6 version, i made another solution that could be great to include in the module.
My solution is to include a hook as solr module do, to alter the query prior it is sended to the solr server. I send a patch with my solution.
Best
David
Comment | File | Size | Author |
---|---|---|---|
#3 | apachesolr_views-alter-hook-3.diff | 1.3 KB | david.gil |
apachesolr_views_query_inc.diff | 817 bytes | david.gil | |
Comments
Comment #1
nyleve101 CreditAttribution: nyleve101 commentedHi,
does this work with the current development release?
Hope you're well,
Evelyn
Comment #2
ygerasimov CreditAttribution: ygerasimov commentedI think this is no more needed as we execute query via apachesolr_do_query() so you can alter query with hook_apachesolr_query_alter() hook.
Also some of the handlers have been ported now.
Marking this issue as fixed.
Comment #3
david.gil CreditAttribution: david.gil commentedHi Yuriy,
i reopen this, and send a patch to the latest dev realese, but this time using hook_views_query_alter, as views do.
In the implementation of apachesolr_views in apachesolr_views_query we extend views_plugin_query that has an empty alter method implementation, but there is an implementation in views_plugin_query_default.
As you said we can hook the apache solr query, but there we have not any information about the views query being executed and i have a couple of use cases where that is needed to modify the query send to solr.
I send a patch.
Best
David
Comment #4
ygerasimov CreditAttribution: ygerasimov commentedThank you for the patch. Now I understand the idea. Committed.
Please next time make sure your patch can be applied on module's repo. See http://drupal.org/node/707484