Contextual filters do not get added to the query.
apachesolr_views_query->build() does not include the filters created by apachesolr_views_handler_argument.
Code such as
if (isset($this->params['filters'])) {
$params['fq'] = $this->params['filters'];
}adds them but that will interfere with
if (!empty($conditions_string)) {
$params['fq'] = $conditions_string;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | use_arguments-1750952-18.patch | 1.66 KB | miroslavbanov |
| #13 | use_arguments-1750952-13.patch | 1.06 KB | itamar |
| #8 | use_arguments-1750952-8.patch | 1.12 KB | roynilanjan |
| #1 | use_arguments-1750952-1.patch | 598 bytes | theapi |
Comments
Comment #1
theapi commentedI've attached a patch to use the arguments set by apachesolr_views_handler_argument.
It want have an effect if $conditions_string is set.
Comment #2
sylus commentedPatch works great thanks @PeterC, Contextual arguments with Apache Solr + Views FTW!
Comment #3
f16viper commentedPatch works fine - it made my day to finally have conditional filters working again - thanks heaps
Comment #4
mindbat commentedPatch didn't work for me on version 7.x-1.0-beta1.
Contextual filters seem to be ignored altogether in the Apache Solr-based view.
Comment #5
heacu commentedhi,
i just tried this patch with version 7.x-1.0-beta2, and it worked for me.
ed
Comment #6
rjbrown99 commentedPatch here, changing status.
Comment #7
roynilanjan commentedPatch works fine ... is there any possibility to use Equivalent of "OR"(of a sql)
basically filter array consists all the arguments it behaves like "AND"(of a sql)
Please let me know
Comment #8
roynilanjan commentedthere is still need some work with this patch although it works only for contextual filter but with Filter criteria & contextual filter together will not work (although it's default function of view) .. this patch can solve the issue.
Please have a test & let me know
Comment #9
babruix commentedYes, last patch works as well, checked against 7.x-1.0-beta2.
Thanks!
Comment #10
drdam commentedYes, last patch works as well, checked against 7.x-1.0-beta2.
Thanks!
Comment #11
marc angles commented#8 appply and works on 7.x-1.0-beta2
Comment #12
acidpotato commented#8 works for me as well. Can this be added to 7.x.1.x-Dev?
Comment #13
itamar commentedThe patch from #8 might cause a notice when
params['filters']is not set. Here's a re-roll with a slight cleanup.Comment #14
technikh commented#13 applies and works well.
Comment #15
technikh commentedIf there are more than one view in a single page, use https://drupal.org/node/1766254#comment-7721963
Comment #16
miroslavbanov commentedConfirm that #13 works fine for me.
Comment #17
miroslavbanov commentedOn second thought, I don't like how the contextual filters are using a separate add_filter function. They should be using add_where, same as regular filters. This is how database views work, too.
Comment #18
miroslavbanov commentedHere's a new patch as per #17
Comment #20
miroslavbanov commented