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've created a View with an exposed filter Search: Search Terms. If I enter multiple terms in the exposed filter field, the search returns normal results. If I enter multiple terms AND there is a SORT enabled (Random), the search returns no results.
This issue is similar to #362830: Search filter breaks for multiple word searches when view has a sort for a previous version of Views.
Thanks for any help!
Comments
Comment #1
dawehnerYou could make us a favor by describing what you really did, see http://drupal.org/node/571990
Comment #2
zdean CreditAttribution: zdean commentedI'm not sure what you're asking. I've outlined the steps to produce the problem:
1. create View
2. expose filter Search: Search Terms
3. set Sort Criteria to Random
4. search for content using multiple terms
5. No results displayed
Alternatively:
1. turn off Sort
2. repeat search with multiple terms
3. search works fine.
What else do you need me to describe?
Comment #3
esmerel CreditAttribution: esmerel commentedComment #4
jacobmn CreditAttribution: jacobmn commentedI'll just throw in for others searching this that I also had the same issue. As soon as I added a Global: Random sort I would no longer be able to search on multiple terms using the Search Terms filter. Took a while to find, but this patch that user gapple put out for one of the D7 versions works for the 6.x-3.x version:
https://drupal.org/node/1986490
I edited views/handlers/views_handler_sort_random.inc and swapped out line 21 with the code provided in the aforementioned post. Fixed the problem beautifully.
Would be great if the next dev version had this patch included - I'm sure others have run into the same issue.
Comment #4.0
jacobmn CreditAttribution: jacobmn commentedreplaced "returns no terms" with 'returns no results'
Comment #5
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe Drupal 6 branch is no longer supported, please check with the D6LTS project if you need further support. For more information as to why this issue was closed, please see issue #3030347: Plan to clean process issue queue