User search only allows you to search for users names. It would be really awesome if it allowed us to use keywords to search for information users entered in their profiles.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | profile_01.patch | 2 KB | sanduhrs |
User search only allows you to search for users names. It would be really awesome if it allowed us to use keywords to search for information users entered in their profiles.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | profile_01.patch | 2 KB | sanduhrs |
Comments
Comment #1
pietro commentedre-assinging to profile.module since in order to get this done ones needs to implement hook_search in profile.module.
a simple implementation foloows:
Comment #2
dublin drupaller commentednice one pietro..
how do you apply that? do you just replace/insert the entire profile_search functio in the profile module?
Dub
Comment #3
kbahey commentedHi Dub
You just copy that function to profile.module, there isn't any existing one.
I did that, and it does work. Nice work Pietro.
However, it needs more features, for example, and AND / OR on multiple fields (e.g. Country = Canada AND industry = IT)
Nice start though.
Comment #4
kbahey commentedRelated discussion http://drupal.org/node/32382
Comment #5
kbahey commentedIgnore that link above. Here is the correct link http://drupal.org/node/8407
Comment #6
scd67 commentedIf you add 'GROUP BY {users}.uid' at the end of the sql statement, you can trip the result set down to only listing a username once, even if they have the term in their profile multiple times.
Comment #7
asimmonds commentedDon't change the title, it changes for the whole thread
Comment #8
ahoeben commentedWould it be possible to have the result of the search operation be more like the result of profile_browse()?
Thinking out loud: how hard does the _search hook break if it doesn't get an array of [title, link]
Comment #9
ahoeben commentedThis adds the public fields of the profiles to the search results:
Two three caveats:
Comment #10
smilodon commented...
Will this work with trip_search module as well ???
The default search module is not enought for me, so i use trip_search.
Comment #11
sanduhrsin reply to #9.
There was a typo in the first SQL Statment, throwing errors at me.
Nonetheless, thanks a lot, this is exactly what I needed.
A patch against Drupal4.7beta4 is attached.
Comment #12
robertdouglass commentedtracking.
Comment #13
JohnG-1 commentedI too would be interested in getting this to work with trip_search and 4.6.5
Comment #14
Tobias Maier commented1. tracking
2. version...
Comment #15
dobson commentedI have modified my profile.module to include checkboxes as a field type (http://drupal.org/node/47744). The checkboxes are stored in the database as a string:
s:LEN:"KEY";s:LEN:"VAL";
where 'VAL' == 'KEY' if option is selected. I think that's just how PHP packs the checkboxes array returned from the form. So my SQL becomes something horrific, although it works well enough so far (no users yet :) To select all profiles which have selected the checkbox option 'fast cars' or 'green people', I do this:
(I am interested in your thoughts on HOW bad this will suck with thirty fields being searched over thousands of users...)
I need to do some age discrimination now (eg users from 25-34 yrs old). I guess there are two ways to do this:
1) If I modify the SQL to do something intelligent using min and max values set in search form?
2) If I add a field to the user form and it is not handled by some module before user module saves the user, then it is written to 'data' field in the user table. Is it possible to have it written to a user table field?
I guess this is an SQL question then. :(
Comment #16
Steven commenteddobson: please open a forum topic or separate issue for this.
There is another issue with a patch at: http://drupal.org/node/28325 .
Comment #17
robert castelo commentedOoops, didn't see anyone was working on this, so I just coded my own version:
http://drupal.org/node/58788
Now working on how results are displayed - options for display order and concatenating fields and adding new labels:
e.g.
Name: John Smith
Instead of
First Name: John
Last Name: smith
Comment #18
Joeluvnyc commentedi am on a PC. where do i go to implement this php code to make the user profiles searchable?
thank you for any help.
Comment #19
Joeluvnyc commentedWhere in profile.module do i place your code? and can i use any text editor to make the change?
thank you