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.
I haven't found any way to have proper exposed filters for terms, entity ref, dates, etc. as far as i can see these are all text fields as opposed to their correct widgets such as select lists, date popup, etc.
Comments
Comment #1
doliveros CreditAttribution: doliveros commentedI'm having the same issue. I've been looking around, but can't seem to find a viable solution. Any help or direction would be greatly appreciated.
Comment #2
bleen CreditAttribution: bleen commentedThis adds numeric support for filters
Comment #3
bleen CreditAttribution: bleen commented... This patch includes the meat on the bone too.
Comment #4
bleen CreditAttribution: bleen commentednote that if you have multiple filters set AND at least one of them is numeric AND at least one of the numeric filters uses a range (between, not between, <, <=, >, >=) then you will get an error.
see #2031495: Multiple filters cause errors for more details
Comment #5
undertext CreditAttribution: undertext commentedHere is the patch that adds new filter handler for sm_vid* fields. User can now expose filter as select form. Needs some discussion.
Comment #6
undertext CreditAttribution: undertext commentedRemoving dpm() from patch.
Comment #7
undertext CreditAttribution: undertext commentedOne more time. Sorry =)
Comment #8
bleen CreditAttribution: bleen commentedThese two patches are not mutually exclusive. They should either be combined or considered in two different issues. One adds a generic "numeric" filter (#3) and one adds a filter specific to taxonomy terms(#7)
Comment #9
travismark CreditAttribution: travismark commented#7 seems working form e but when I click "Allow multiple selections" on the exposed filter..It is no longer giving results...
Comment #10
jarrodirwin CreditAttribution: jarrodirwin commentedAttached is an addition to the patch in #7.
I have added the ability to have the exposed filter options limited by the result set. This is a simple checkbox when setting up the exposed filter (Restrict exposed filter values).
Also, it was throwing errors when setting a default value on an exposed filter field. This is due to the #default_value value expecting a string not an array. I have made a tweak to ensure the value is passed as a string.
I know this patch is just for taxonomy terms however the functionality in patch #7 could actually be used to turn any field into a populated select box instead of just targeting sm_vid fields.
Comment #11
jarrodirwin CreditAttribution: jarrodirwin commentedOk, actually attached this time. Notes in #10
Comment #12
memoday CreditAttribution: memoday commentedI am having the same problem, but with interwiki filter module. The exposed text filters are plain text, hence iterwiki filter isn't supported. Which patch would resolve this issue?
Comment #13
BBCI was hoping I could use better exposed filters with this module to get some different options. #7 works and looks like a step in the right direction. However, it seems that if you select more than one term from a taxonomy, no results are returned.
Comment #14
a_godin CreditAttribution: a_godin commentedFor taxonomy terms as checkboxes, there may be a workaround ... it's not really elegant but it works.
Select the 'tm_vid_#_names' field associated with the content you want to search as an exposed filter, and click the option 'Grouped filters'.
In the table below, write the checkbox label you want and the value of the taxonomy term you're looking for. Do that for all the taxonomy terms in the vocabulary. Save the view.
Then, if you have entered more than 4 choices for the taxonomy terms, add the following code in a custom module to transform your exposed taxonomy terms into checkboxes :
Also, apply this patch from views bug report https://www.drupal.org/node/1986306 so you don't get the error "An illegal choice has been detected. Please contact your site administrator." when you navigate through the pager and you haven't checked one of your exposed taxonomy terms : https://www.drupal.org/files/views-fix-exposed-multiple-checkbox-filter-...
Hope this helps someone !
Comment #15
heacu CreditAttribution: heacu commentedNote that #3 is actually broken. It is missing the file: handlers/apachesolr_views_handler_filter_numeric.inc
Comment #16
MiroslavBanov CreditAttribution: MiroslavBanov commentedYes, it appears to modify apachesolr_views_query for some reason, rather than extending the class in a newly created file.
I think though that the idea of #3 is a better candidate for being added to the module, than the next patches.
Comment #17
MiroslavBanov CreditAttribution: MiroslavBanov commentedJust to clarify my previous post: my issue with the patches #5, #6, #7, #11 is that they target taxonomy term filters specifically.
Comment #18
bleen CreditAttribution: bleen commented@miroslavbanov .... can we move ahead with #3 than? Is there anything that needs work there?
Comment #19
MiroslavBanov CreditAttribution: MiroslavBanov commented@bleen18
There is - see comments #15, #16
Comment #20
mariacha1 CreditAttribution: mariacha1 commentedFYI, I moved the work done in #5, 6, 7, and 11 to its own task, since it looks like this task is leaning toward numeric filters.
https://www.drupal.org/node/2394943
Comment #21
surendramohan CreditAttribution: surendramohan commentedhello guys, any further update on "numeric" support for full text search exposed filter?
The patch suggested at #3 can't be applied at the moment due to the missing handler reported at #15 and #16.
Comment #22
MickL CreditAttribution: MickL commentedAny news on this 2 year old, very important, issue? :(
Or any workaround?
Comment #23
MickL CreditAttribution: MickL commentedExposed filters select do work for taxonomy terms, when applying following patch:
#2394943: Allow exposed term filters to show as dropdown
But still not working for