Hi all,
I made a view a while ago with some exposed filters and with 'search terms' filter. The exposed filters are working, but there's a problem with my search terms filter. When i leave the input field open and apply the search, he gives me all records, that's oké. But when i give in a search term, that he must find, he give me no results. It's strange, because with my normal search box, that works. I recently updated my views version, but that didn't help. I'm also getting no errors. He's just giving me no results, equal which search term i give in.
Anyone a solution?
Thanks in advance!
Gunther
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | view-pagedisplay.jpg | 278.29 KB | guntherdevisch |
| #13 | view.gif | 16.56 KB | arvinsingla |
| #6 | view.jpg | 84.55 KB | guntherdevisch |
Comments
Comment #1
merlinofchaos commentedCan you cut & paste the query the view provides? (You can find this in the live preview information).
Comment #2
guntherdevisch commentedHi,
Below you can find a view that i'm using to test.
Thanks for your help,
Gunther
Comment #3
merlinofchaos commentedThat is the view export. I asked for the query.
Comment #4
guntherdevisch commentedOw sorry merlinofchaos,
Here it is:
Actually very simple, but when i give in my username in the search field, it doesn't appear.
Any ideas where it goes wrong?
Thanks,
Gunther
Comment #5
merlinofchaos commentedOdd, when you apply the search it should show you the new query in the preview. Hm. Not sure what to tell you there.
Comment #6
guntherdevisch commentedHi merlinofchaos,
Yes, it's very odd! My live preview works, but when i give in a search term on my page, it doesn't give me results. Only when it's not filled in.
In my attach you can find a screenshot of my view. Some words are dutch, but maybe it can help to find the problem.
Thanks for your time,
Gunther
Comment #7
merlinofchaos commentedOk, you're previewing the default display but the default display does not contain the exposed filter, because they are overridden on the page display.
Comment #8
guntherdevisch commentedMm, so you know what's wrong or?
Thanks!
Comment #9
merlinofchaos commentedTry previewing the display with the actual search widget...
Comment #10
guntherdevisch commentedSorry, but how can i do that? I'm quite new in Drupal.
Thanks,
Gunther
Comment #11
guntherdevisch commentedHi merlinofchaos,
Here you have another query, when i'm searching for my username. (i didn't know that you could test this too in the live preview)
Maybe there is something wrong with this query, because i'm getting no results.
Thanks!
Gunther
Comment #12
guntherdevisch commentedCan somebody help me? Merlinofchaos? Or someone else?
Thanks!
Gunther
Comment #13
arvinsingla commentedI'm having a similar problem on a view of users with an exposed search filter. No results are being generated when I search for any terms.
Here is the query before a search:
SELECT users.uid AS uid, users.name AS users_name, users.mail AS users_mail, users.login AS users_login FROM users users ORDER BY users_login DESCHere is a query when I put in a search term:
SELECT users.uid AS uid, SUM(search_index.score * search_total.count) AS score, users.name AS users_name, users.mail AS users_mail, users.login AS users_login FROM users users LEFT JOIN search_index search_index ON users.uid = search_index.sid LEFT JOIN search_total search_total ON search_index.word = search_total.word WHERE (search_index.word = 'shamelin') AND (search_index.type = 'users') GROUP BY search_index.sid, users_login, uid, users_name, users_mail HAVING COUNT(*) >= 1 ORDER BY users_login DESCI have also attached an image of the view. Let me know if you would like me to export my view as well. Any light you could shed on this would be great. Thanks!
Comment #14
guntherdevisch commentedHi,
I just installed the 6.x-2.6 version of views, but i'm still having the problem with my exposed search filter:(
@tkamen: Do you have the problem only when you expose the search filter on a list of users or?
Any help is welcome.
Thanks,
Gunther
Comment #15
mcrittenden commentedComment #16
CONFUSEDNOOB commentedi have same issue i can display mutliple fields for search they appear in block with drop downs all is perfect except the search will not show anything. very odd i think drupal needs a better search i am using 6.4
Comment #17
bonobo commentedGiven that this issue is about an exposed search filter, and that the search filters work very well, this can likely be traced to a couple things:
1. As merlinofchaos points out in #7 you need to preview the correct display.
2. Has cron run? If the search index has not been built, then the search will not return any results.
Comment #18
guntherdevisch commentedHi,
Thanks for your feedback.
I have tested my view in the live preview on my page display, but i'm getting no results.
Here's my query:
Here, i'm searching on a username, called 'test'. I also tried other usernames/usermails, but no results are given. Only when i leave the search-box empty, i'm getting all the results.
In the attachment, you can find a screenshot of my page display (note: my view is in dutch, hope you can understand).
I also tried updating my cron manually, but that didn't did the trick.
Thanks for the help.
Greets,
Gunther
Comment #19
derby commentedI am having the same problem with Exposed Search Filter on Views2.
After I run cron my search index table doesn't contain type = 'users'.
search_index.type = 'users'. This is false. Therefore no results are returned.
Why does the search indexing bypass the users?
Comment #20
simmoe commentedI have the same problem, really can't figure it out. Drupals own search form query for users doen't seem to use indexing at all: " SELECT name, uid, mail FROM users WHERE LOWER(name) LIKE LOWER('%test%') OR LOWER(mail) LIKE LOWER('%test%')
"
Simon
Comment #21
guntherdevisch commentedDoesn't anyone have a solution for this problem?
I think there's enough info here now, if not please say so.
Thanks,
Gunther
Comment #22
simmoe commentedAlternately does anyone know how to alter the query made by views on the search?
Best, Simon
Comment #23
mcrittenden commentedComment #24
guntherdevisch commentedHi,
I ran the query below in PhpMyAdmin, but i'm getting also no results. So i looked in the table search_index, but there i didn't found a search_index.word = 'test' or search_index.type = 'users'. I just found 'help' and 'node' as search_index types. Does somebody know why there are no 'users' types indexed?
Thanks,
Gunther
Comment #25
guntherdevisch commentedHi,
When i manually add the user to the search_index table, my (views) search works:)
Now i just have to automate this proces. Making sur that whenever a useraccount is created or adjust, the search_index is updated.
Anyone ideas where i can do that? In which script/module?
I'll keep you updated, when i have more news.
Thanks,
Gunther
Comment #26
guntherdevisch commentedHi guys,
I made it work! I tried the 'reindex'-module & 'profile-search'-module and then run my cron. I think the profile-search module did the trick!
So all who has the same problem as me, i suggest you try the modules i mentioned here above.
Greets,
Gunther
Comment #27
simmoe commentedHmm - strangely it still dosn't work for me though. I installed both reindex and profile-search (which seems to be called profile-plus, yea?) and ran cron - but still nothing happpens when i search users with views. Did i miss something maybe?
Best, Simon
Comment #28
simmoe commentedMaybe your trick was to manually add the 'user' to the search_index table? In that case it's still a bug, i guess. Or maybe some contrib module caused it in the first place - as far as i can interpret from the above the developers checking it out did not experience the problem?
Comment #29
guntherdevisch commentedHi Simon,
The second module i used, wasn't 'profile plus', but 'profile search', here's the link: http://drupal.org/project/profilesearch, run your cron afterwards.
Hopely it works now,
Greets,
Gunther
Comment #30
dawehnerRelated issue #574150: Remove search_index join to users table
Comment #31
simmoe commentedHey Gunther and Dereine -
I installed profile_search and now it works! Thanks alot.
There is still the small problem that you have to type entire words from i.e. the username or profile fields. Specifically i am making a phonebook search and it would be reasonable to show results even if the user only types the beginning of a name - so 'sim' would still return my user (simon). I guess this is a performance issue but the standard drupal usersearch returns results from 3 letters up - just like normal content searches. Maybe this should be posted elsewhere?
Anyway: thanks - this helps a lot
best,
Simon
Comment #32
ari-meetai commented@simmoe try the Finder module: http://drupal.org/project/finder
Basically what you got is that the index has to be updated with the new profile fields, hence the problem gets solved with profile_search. ~|~
Comment #33
Moniroaf commentedI made a view with some exposed filters and with 'search terms' filter. The exposed filters are working, but there's a problem with my search terms filter.
He's just giving me no results, equal which search term i give in.
am using it in D8
any solution ?
thanks