1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 17:52:43 +01:00
phorge-phorge/src/applications/people
epriestley 9a1d59ad5b Separate sever-side typeahead queries into "prefix" and "content" phases
Summary:
Ref T8510. When users type "platypus" into a typeahead, they want "Platypus Playground" to be a higher-ranked match than "AAA Platypus", even though the latter is alphabetically first.

Specifically, the rule is: results which match the query as a prefix of the result text should rank above results which do not.

I believe we now always get this right on the client side. However, WMF has at least one case (described in T8510) where we do not get it right on the server side, and thus the user sees the wrong result.

The remaining issue is that if "platypus" matches more than 100 results, the result "Platypus Playground" may not appear in the result set at all, beacuse there are 100 copies of "AAA Platypus 1", "AAA Platypus 2", etc., first. So even though the client will apply the correct sort, it doesn't have the result the user wants and can't show it to them.

To fix this, split the server-side query into two phases:

  - In the first phase, the "prefix" phase, we find results that **start with** "platypus".
  - In the second phase, the "content" phase, we find results that contain "platypus" anywhere.

We skip the "prefix" phase if the user has not typed a query (for example, in the browse view).

Test Plan:
This is a lot of stuff, but the new ranking here puts projects which start with "w" at the top of the list. Lower down the list, you can see some projects which contain "w" but do not appear at the top (like "Serious Work").

{F1913931}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8510

Differential Revision: https://secure.phabricator.com/D16838
2016-11-10 08:54:59 -08:00
..
application Make "Core Applications" more reasonable 2016-08-12 07:57:59 -07:00
cache Fix several issues with email-related global preferences 2016-06-14 12:35:31 -07:00
capability People - refine permissions on creating new users 2015-02-05 16:47:09 -08:00
conduit Add a modern user.search Conduit API method 2016-05-22 05:54:31 -07:00
config Move FontIcon calls to Icon 2016-01-28 08:48:45 -08:00
controller Move "Calendar" above "Badges" on user profiles 2016-11-02 13:13:45 -07:00
customfield Make it more clear that red dots next to usernames mean Calendar availability 2016-11-02 13:45:43 -07:00
editor Use new modular temporary auth token constants in one-time login and password reset flows 2016-03-16 09:33:24 -07:00
engine Remove calendar panel in profile and make calendar box header a link to user's calendar 2016-05-23 11:32:56 -07:00
engineextension New People Hovercards 2016-02-11 15:41:55 -08:00
extension Convert user profile images into a standard cache 2016-06-05 08:52:15 -07:00
garbagecollector Provide bin/garbage for interacting with garbage collection 2015-10-02 09:17:24 -07:00
icon Add additional icons for User Profiles 2016-01-31 20:09:06 +00:00
lipsum Improve bin/lipsum UX 2015-12-24 09:06:35 -08:00
markup On @username mentions in remarkup, show the "busy" dot color 2016-11-07 14:57:32 -08:00
phid Allow users to mark themselves as "Available", "Busy" or "Away" while attending an event 2016-11-04 16:55:44 -07:00
policyrule Move some files around 2015-11-17 06:26:13 +11:00
profilepanel Fix spelling error 2016-04-11 09:26:08 -07:00
query Separate sever-side typeahead queries into "prefix" and "content" phases 2016-11-10 08:54:59 -08:00
search Convert all "DocumentIndexers" into "FulltextEngines" 2015-12-21 17:25:23 -08:00
searchfield Add basic typechecking support to Conduit 2015-12-14 04:21:39 -08:00
storage Extract variable type information from pht() calls 2016-11-08 08:33:15 -08:00
typeahead Separate sever-side typeahead queries into "prefix" and "content" phases 2016-11-10 08:54:59 -08:00
view Make it more clear that red dots next to usernames mean Calendar availability 2016-11-02 13:45:43 -07:00