Bug #1294
closedProfile Field Search by College Not Working Correctly
Added by Matt Gold about 13 years ago. Updated almost 13 years ago.
0%
Description
Today, when we presented at CCNY, we showed the audience how clicking on a link like "City College" in a member's profile would bring back a list of people from that institution. However, it did that and more -- it brought back a list of people from City College, City Tech, and other schools. I'm not sure whether the issue is just with City College or whether it is more widespread.
Related issues
Updated by Boone Gorges about 13 years ago
- Status changed from Assigned to Reporter Feedback
it brought back a list of people from City College, City Tech, and other schools
I'm willing to bet it was only City College and City Tech. The reason is that the phrase City College appears in "New York City College of Technology". Outside of totally rebuilding the way that BuddyPress search works, it'll be impossible to filter out false positives like this.
A short term fix is to change the CCNY option in the College profile field to City College of New York (or something else that will not create the same false positives). However, I'm pretty sure that this will not change the setting for existing members, which means that the problem will persist for existing menus, and also there will be a fracturing of CCNY results (since searches for "City College of New York" will not match "City College" results). An option here is to write a script that will rewrite all fields currently reading "City College" to "City College of New York"; this will have to be custom-written, as nothing exists in BuddyPress to make this work.
A different kind of fix is to modify BuddyPress search more fundamentally so that it only returns exact matches. But this may open up a can of worms, since generally we do not want search results to return exact matches - it'd break search in most cases. There are ways around this, too (implementing a flag for exact searches), which would then have to be integrated into the custom profile filters plugin I wrote for the Commons.
Depending on how you want to go forward, we can talk about how to fit this ticket into a milestone. If you want to go with my first suggestion (changing the text "City College" to something else), it can be done any time - no milestone required. If you additionally want a script to rewrite all existing City College entries, it can be done for 1.2.5. If you want BP search to be more fundamentally rewritten, it will have to wait until after the 1.3 release.
See also #652. A similar issue will arise there.
Updated by Matt Gold about 13 years ago
Thanks, Boone.
"A different kind of fix is to modify BuddyPress search more fundamentally so that it only returns exact matches. But this may open up a can of worms, since generally we do not want search results to return exact matches - it'd break search in most cases."
Isn't an exact search exactly what we want for a profile field like College, which has pre-defined choices? Unless we consciously fracture the choices in the way you mention above, shouldn't everyone at NYCCT have "New York City College of Technology" listed as their college?
Is there a way to have a exact match for certain fields, like College, but not others?
Updated by Boone Gorges about 13 years ago
Isn't an exact search exactly what we want for a profile field like College?
Not for search. For filtering, you probably do, but technically this BP linking feature is not a filter, but a simple search. For search, you generally do not want exact matches.
shouldn't everyone at NYCCT have "New York City College of Technology" listed as their college?
They do. They're not the problem - City College, which is a partial match of New York City College of Technology - is the problem.
Is there a way to have a exact match for certain fields, like College, but not others?
No. But that's what I meant when I suggested "implementing a flag for exact searches". This is an extensive modification of BuddyPress.
Updated by Matt Gold about 13 years ago
Okay. What seems best and easiest to me is to rename either City College or City Tech (City Tech could become NYC College of Technology) and then replace the older appellation on relevant user profiles with the new one. What do you think?
Updated by Boone Gorges about 13 years ago
- Status changed from Reporter Feedback to Assigned
I agree that this is the easiest way to go. I'm leaving it under the 1.2.5 milestone so it doesn't get lost, though it won't require any mods to the codebase. I'll do it sometime tomorrow.
Updated by Boone Gorges about 13 years ago
- Status changed from Assigned to Resolved
- Target version changed from 1.2.5 to Not tracked
OK, here's what I did. In the production database:
update wp_bp_xprofile_data set value = 'NYC College of Technology' where value = 'New York City College of Technology';
Then I changed the City Tech dropdown in Dashboard > BuddyPress > Profile Field Setup to read 'NYC College of Technology'.
It works pretty well. A search on 'City College' will still pull up people who have discussed 'New York City College of Technology' elsewhere in their profiles: http://commons.gc.cuny.edu/members/?s=City%20College
True filters are sort of a different subject, and should probably be covered by #652 and other tickets. Closing this one as resolved.
Updated by Matt Gold almost 13 years ago
- Status changed from Resolved to Assigned
Tested this on the new filtering system and it appeared to me that clicking "City College" brought up many NYCCT people. Is that just because the cdev database hasn't been updated in the way that you describe updating the production database above?
Updated by Boone Gorges almost 13 years ago
- Status changed from Assigned to Resolved
Is that just because the cdev database hasn't been updated in the way that you describe updating the production database above?
Yes