Page MenuHomePhabricator

Have a more scope-restricted default global (primary) search
Open, Stalled, MediumPublic

Description

Check if we can change/limit the default scope of the fulltext global search to certain types of documents (for example only tasks and commits?) instead of querying all and any applications (though fixing T397499 should make this already a wee bit better).

Should get us slightly faster search results.

Event Timeline

Aklapper triaged this task as Low priority.

Copying over what I said in T397392 regarding this sort of idea:

If I was going to suggest a wild idea, maybe it's worth investigating the possibility of forwarding the top-right search bar to the task-specific Advanced Search by default (with "Group By" set to None & "Order By" set to Relevance), on the massive assumption that most people using it will be looking for Phabricator tasks only (and also that the task-specific search doesn't provide too much worse of a user-experience)? But that would definitely require consultation beforehand in case that assumption proves to be wrong, and might also need a fair amount of code adjustments (I haven't checked).

I think it might be different -- reading that task, it sounds like it's proposing to add an 'application-specific advanced search' option to the dropdown to the left of the search bar; whereas my wild idea would be to redirect that search bar to the Maniphest advanced search in all cases/by default. (which could potentially involve removing that dropdown option altogether, depending on the desired design/implementation)

whereas my wild idea would be to redirect that search bar to the Maniphest advanced search in all cases/by default

While I personally agree I am not convinced that's wanted behavior. A bunch of users may be looking for search results to cover at least commits && tasks. :-/

I had been poking this again today on a code level Which might be mostly moot because only after a while I went into the commit history just to find http://phorge.localhost/settings/builtin/global/page/search/ from https://we.phorge.it/rP7e2bec92807d2a6c432fd7f690e9cb7dda0b1fc3: a global setting to set "Search Scope" and "Choose the default behavior of the global search in the main menu."
Which sounds very much what I'd like to consider.
It only seems to work when logged out or after creating a new user account as a each user's individual search scope setting is cached.
As an existing user, I can go to https://phabricator.wikimedia.org/settings/panel/search/.
Which is a page that seems to be linked from nowhere.
Well, oh well.

(Note to myself: This differs from the "System Saved Queries" at https://phabricator.wikimedia.org/search/query/edit/ which can be reordered and refer to the sidebar and thus default behavior on https://phabricator.wikimedia.org/search/ )

Per

$apps = PhabricatorApplication::getAllInstalledApplications();
$types = array_mergev(mpull($apps, 'getApplicationSearchDocumentTypes'));
phlog(json_encode($types));

we currently have the following searchable PHID types belonging to installed apps in our WMF installation which can be found via the Global (fulltext) Search: '["TASK","CMIT","PROJ","DSHB","DSHP","PRTL","BLOG","POST","MOCK","CEVT","CDTL","PSTE","USER"]'

Per /config/module/phid/, that array translates to:
Maniphest Task, Diffusion Commit, Project, Dashboard, Dashboard Panel, Dashboard Portal, Phame Blog, Phame Post, Pholio Mock, Calendar Event, Passphrase Credential, Paste, User.

If we somehow introduced a custom default search scope for the Global fulltext search, I am unsure that we'd gain a significant performance improvement if we did not also exclude object types which exist in larger numbers (see list below).
It might still be worth a shot, given stuff like https://we.phorge.it/rPc57167f28edc16447074aeaa53330e70c7c6aa11.

Did this change recently?

I could have sworn that until a few weeks ago, searching in Phab defaulted to open tasks, even when on the https://phabricator.wikimedia.org/ homepage or a workboard. Now, the default includes a lot of noise from Diffusion commits and pastes, etc.

Maybe I had a custom setting and an upgrade lost this? I can't seem to find a setting to make Task search the default, and this task suggests that doesn't exist.

@Krinkle: I was about to reply "no changes" until I remembered that default Phorge offers an "Open Tasks" global search query which I may have disabled in our installation at some point in the naïve hope that more folks would switch to the Task Search. Which now feels shortsighted by me.
I enabled that query again, you should find it in the top bar search dropdown, and should also be able to set that via the hidden individual search scope setting at https://phabricator.wikimedia.org/settings/panel/search/ .

Note to myself:
Maybe doing T252150: Change default search scope for Search field in upper right corner from Global to Open Tasks by setting "Search Scope" to "Open Tasks" on https://phabricator.wikimedia.org/settings/builtin/global/page/search/ is by far the easiest solution to this task (now that I recently found out that this setting actually exists). Or creating a new global custom search for more item types, and setting that as the default for everyone (can be individually overwritten, stored in user cache).

Aklapper changed the task status from Open to Stalled.Mon, Dec 1, 2:58 PM
Aklapper raised the priority of this task from Low to Medium.

I'd prefer to first get https://we.phorge.it/D26539 merged and deployed in our instance, then tackle this ticket by saving a new global query, move that down on /search/query/edit/ not to interfere with current sidebar defaults, and set that new query via /settings/builtin/global/page/search/ as default scope in the global top bar scope dropdown. (Now that I discovered that hidden setting, this suddenly feels surprisingly easy.)

Needs discussion though what's the new default scope. Tasks, Projects, User? Maybe Commits, maybe Pastes?
We will break somebody's workflows for sure.