Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Quick Search Preview

Discussion in 'Editor Workflows' started by benoitd_unity, Feb 26, 2019.

  1. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    87
    Hello,

    We’re very excited to share a new feature we have been working on, called Quick Search. Think of Spotlight Search for macOS but that you can use to look for different things across the editor.

    How to get it
    Quick Search is currently only available as a Preview package via the Package Manager. Make sure you have Show preview packages enabled in the Advanced dropdown in order to access it. The feature is officially supported with Unity 2019.1 and higher.

    How does it work
    You can invoke Quick Search via the menu entry Help -> Quick Search or via the associated keyboard shortcut, which is the recommended way for increased efficiency.

    As you type in the search field, Quick Search will immediately start searching across all search providers. You can then navigate through the results with the arrow keys. Some items have multiple actions, which you can quickly access via the Alt-Right Arrow keyboard shortcut.

    Quick Search comes with a few default search providers (Assets, Hierarchy, Settings, etc…) and we are planning to add even more in the future. It is also possible to add your own custom search providers via the API with only a few lines of code.

    This is only a quick overview and if you want to know more, head over to the documentation from the Package Manager window.

    Feedback
    This feature is still in development but we’re interested to know what else it could do for you so try it out and please share your feedback.
     
    Last edited: Feb 27, 2019
  2. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    416
    Is it +2019.1? I'm on 2018.3.0f2 and I can't see it.
    Also it would be really nice if you could include some screenshots of the Quick Search.
     
    disturbedUKR likes this.
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,096
    This sounds like it would massively speed up some of our workflows. I also can't see it - we're stuck on 2018.2 for the time being. It would be great to know Unity version restrictions - I really hope this will be available for 2018.4 LTS. Screenshots would also be cool!

    What can we do with custom providers? We have a bunch of asset types that we edit through custom windows - think AnimatorControllers. Will be be able to specify that the custom providers should open the selected thing in a window? Or do any arbitrary action, really?
     
  4. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    Hi Baste, I know it works on 2018.3, so we could certainly downgrade the requirement to 2018.3, but for the time being it is targeting 2019.1.

    You can do a lot with custom search providers. In the package folder you'll find an Examples/ folder with other search providers to feed your mind.

    This is not the most up-to-date doc, but you can take a look at https://docs.unity3d.com/Packages/com.unity.quicksearch@0.9/manual/index.html#api

    The documentation will be updated for release 1.0 in the next few days.

    We are planning to provide such provider as examples, but if a window can be opened by feeding a search query that should be pretty simple.

    Thanks for the feedback,
     
    Novack likes this.
  5. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    If you have a project on 2018.3, you can edit your manifest.json and add this line:

    Code (CSharp):
    1.  
    2. "com.unity.quicksearch": "1.0.0-preview.2"
    3.  
    I just tried it and it worked. By default, the package manager UI won't list packages that targets a different version, but it doesn't prevent you from manually adding them.

    upload_2019-2-27_8-42-44.png

    Thanks,
     
    Novack and JakubSmaga like this.
  6. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    Here's a gif show casing most of the features it supports.

    quicksearch_tool_tour.gif
     
    Xarbrough, Flavelius, pvloon and 9 others like this.
  7. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    290
    Have you looked at "MonKey" ?

    It a nice addition but honestly if it is just limited to search...
     
  8. sebastienp_unity

    sebastienp_unity

    Unity Technologies

    Joined:
    Feb 16, 2018
    Posts:
    24
    We have looked at it and it is a nice plugin that does way more than searching. Our goal with the quicksearch was to provide an out of the box search tool since this workflow was cruelly lacking. Then add more SearchProvider to implement more complex workflow (see our Examples folder for a Code executor, a calculator, a text indexer and an asset store searcher).
     
    BradZoob and hippocoder like this.
  9. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,331
    Excellent work. I would consider having an option to set the size of the search area, because sometimes there's a lot of assets and we want to dig through a lot of similarly named ones.

    Try testing the scenario where you have got 20-30 or so animations imported for the same character. When importing animations separately like this for use in Animator, it also imports all the meshes as well, so you get a ton of the same-named meshes in a lot of real world projects.

    That might be a nice case study for consideration.
     
  10. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    529
    You can import only the animations by selecting only the bones and helper objects for your rig and export only those selected objects. Basically, excluding the mesh from the export and you get animations only, this is what I usually do.
     
    hippocoder likes this.
  11. Giuseppe

    Giuseppe

    Joined:
    Dec 4, 2011
    Posts:
    18
    fantastic addition to the editor ux, thank you :)
     
    jonathans42 and hippocoder like this.
  12. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,888
    It looks very similar to Haste from the screenshots. Is this from the Haste developer who perhaps works for Unity Technologies now?
     
  13. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,331
    Possible to bring search to enum fields as well? I think at some point, most developers will feel the pain from scrolling the endless list, when it would be nice to, in the drop-down just specify a letter even.

    Not essential but certainly a pain point for many developers.
     
    JakubSmaga likes this.
  14. Bill-Sansky

    Bill-Sansky

    Joined:
    Oct 2, 2016
    Posts:
    59
    This looks great! One thing MonKey has that could be of interest for you guys here is the ability it has to read parameters, which in my opinion is really useful when you want to do more advanced stuff. This way you're free to use the interface for more than just searching stuff.
     
  15. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    87
    It will forward any parameters to the actual search provider. For example, searching for assets, if you enter t:Script Player, it will only search through script files. Is that what you were suggesting?
     
  16. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,888
    A search that finds where a specific asset is used.

    For example, I want to find all materials that reference a certain texture. Or I want to find all prefabs that reference a particular material. Or I want to find all scenes that reference a specific prefab. Or I want to find all prefabs where a certain .asset file is referenced. Etc...
     
    benoitd_unity likes this.
  17. Bill-Sansky

    Bill-Sansky

    Joined:
    Oct 2, 2016
    Posts:
    59
    I was thinking more of an arbitrary recognition of parameters so users can create their own commands, or maybe you intend the tool to only work with the search provider?
     
  18. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    87
    You can create and provide your own search provider, which could just be a command interpreter with its own set of parameters.
     
    jonathans42 likes this.
  19. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    87
    No there is no association.
     
    Peter77 likes this.
  20. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    You could create your own SearchProvider that behaves like a command system. If you look in the Editor/Providers/Examples folder, you'll find Eval.cs and Calculator.cs that supports command input.

    We might provide a simple command system that supports macros and parameters in upcoming version.

    Thanks,
     
  21. Jay-Pavlina

    Jay-Pavlina

    Joined:
    Feb 19, 2012
    Posts:
    195
    Will performance be improved? Each keystroke in the search window is significantly delayed in my project. There is no delay when using search in the project tab.
     
  22. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    Did you update to the latest version com.unity.quicksearch@1.0.1-preview.1 ? There is some significant performance improvements there.

    Otherwise, you can click on the filter button and unselect Assets/Folder and Assets/Packages to get a performance boost.

    upload_2019-3-15_14-40-37.png

    Let me know if it changes something for you.
     
  23. Jay-Pavlina

    Jay-Pavlina

    Joined:
    Feb 19, 2012
    Posts:
    195
    Yes I am on the latest version. After unchecking the folders checkbox, the speed increased tremendously. I would have tried unchecking that earlier but didn't think searching folders would be so slow. Maybe it should be off by default? Anyway, thank you, it works great now.

    Edit: The folder box gets checked every time I search. How do I keep it off?
     
    jonathans42 likes this.
  24. sschoener

    sschoener

    Joined:
    Aug 18, 2014
    Posts:
    20
    This is a great addition to Unity. I have been working on such a tool of my own as a side project for some time now and wanted to ask whether you have looked into using this tool with larger projects, since those are the ones that typically benefit most from searching. Your current API does not support asynchronous search providers (in the most general sense, not necessarily using C#'s async machinery) which I found to be a necessity for larger projects during my experiments. Is this something that you are actively thinking about? The point of the tool is to be a fast search, so keeping the user waiting for some blocking call in between key-strokes is a major pain-point, in my opinion.
     
  25. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    Yes we will make it off by default in the upcoming version.
     
  26. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    If you open the quick search using the default shortcut (i.e. Alt+') is should remember the your preferences. We have other ways to open the quick search, that opens the search with preselected filters, i.e. Alt+Shift+A, but in that cases the filter changes are not saved. Using Alt+' (check shortcut next to Help/Quick Search) should work in your case and save filters.
     
    Jay-Pavlina likes this.
  27. sebastienp_unity

    sebastienp_unity

    Unity Technologies

    Joined:
    Feb 16, 2018
    Posts:
    24
    With the latest version we support an async api. It is demonstrated in 2 of our samples:

    - com.unity.quicksearch\Editor\Providers\Examples\AssetStoreProvider.cs : show how to do a webrequest to access the AssetStore and populate the item list when the requets is back
    - com.unity.quicksearch\Editor\Providers\Examples\ESS.cs: shows how to use Entrian Search to index the content of your project. Since an entrian request is somewhat long, we do it in another thread and populate the results asynchronously.

    This would be a snippet using context.sendAsyncItems to handle populating search results asynchronously

    Code (CSharp):
    1. new SearchProvider(type, displayName)
    2. {
    3.     filterId = "store:",
    4.     fetchItems = (context, items, provider) =>
    5.     {
    6.         var currentSearchRequest = UnityWebRequest.Get(url + context.searchQuery);
    7.         currentSearchRequest.SetRequestHeader("X-Unity-Session", InternalEditorUtility.GetAuthToken());
    8.         var currentSearchRequestOp = currentSearchRequest.SendWebRequest();
    9.         currentSearchRequestOp.completed += op => {
    10.  
    11.             var items = // GetItems from websearch
    12.  
    13.             // Notify the search about async items:
    14.             // ensure to set the searchId so if a new search was started these results are ignored.
    15.             context.sendAsyncItems(context.searchId, items);
    16.         };
    17.     }
    18. };
     
    sschoener likes this.
  28. slime73

    slime73

    Joined:
    May 14, 2017
    Posts:
    30
    I just tried the latest (1.0.1-preview.1) with a large-scale 2018.3 project. It's working without any errors so far, but it's so slow that it's completely unusable, I think due to the amount of assets / folders / etc. the game has.

    Typing any single letter into the search bar causes it to freeze for 3+ seconds (on my Windows system with an SSD and an i7 8700k). Typing a word or phrase takes dozens of seconds to complete. I looked at some basic Deep Profiling results of profiling the editor while that was going on, and most of the time seemed to be spent inside Directory.GetDirectories (called by SearchService.GetItems()). Every item added to the directory list seems to take a not insignificant amount of time to be constructed, and with a bigger project it looks like it adds up very quickly.

    Because the time is spent in filesystem-related functionality and I'm using an SSD, I'm assuming it will also be an order of magnitude slower on a less powerful system with a mechanical HDD.
     
    Last edited: Apr 2, 2019
  29. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    We will soon release version 1.0.2 that fixes the performance issue you are having. For now you can disable/uncheck the Folder filter under the asset search provider.

    Stay tune for the 1.0.2 release. We tested it in megacity demo project and it works nicely now.

    Thanks,
     
  30. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    569
    Very interested in integrating this with Bolt ASAP to get graph search! :D

    Is there a way for me to check that the package is in the project via compilation #defines?
     
  31. slime73

    slime73

    Joined:
    May 14, 2017
    Posts:
    30
    Thanks. I disabled the folder filter and it's much faster than before - freezes of about 100-150ms per letter typed, instead of ~3 seconds. The speed is still slow enough that it lags behind any reasonable typing speed, but it's definitely usable now.

    A quick glance at some deep profiler results of typing shows most of the time (~100-140ms) is spent in AssetDatabase.FindAssets now, and some additional time in (~10-30ms) in QuickSearchTool.DrawItems.
     
  32. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    It most be a HUGE project if FindAssets takes around 140 ms. Is that a project you can share in private so we can run a few tests?
     
  33. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    Please do and ping us if you need any assistance.

    Thanks,
     
  34. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    I do not know myself. I just asked the package manager devs. That said, in 2019.3 the quick search will probably be packaged built-in, so always available.
     
  35. slime73

    slime73

    Joined:
    May 14, 2017
    Posts:
    30
    Our Assets folder is 88 GB (and our final release build size is 6-8GB). I think it's much smaller than a triple-A game, but much larger than most indie games. AA? :)

    Unfortunately I don't think it's possible to share it currently. It would be nice if Unity had in-house games or other media built to this scale so new tech could be easily tested against the sort of setup a mid-sized development studio might have, but that's certainly not on you.

    I just did a simple comparison with Sublime Text's fuzzy search on that 88 GB assets folder and it felt ~2-3x faster on average (and found more items due to the fuzzy bit), that was just me eyeballing it without any actual data from Sublime Text though.

    Since FindAssets is a core API I don't expect you'll be able to optimize much more without changes to Unity itself, but if there's anything specifically you'd like me to profile and share, or other data you want that I can give, I'd be willing to help.
     
    Last edited: Apr 4, 2019
  36. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    Ok thanks for the info. We should release the next preview release in a few days which should offer some better overall performances. That said, we'll keep on eye on performance and keep improving it.

    Thanks,
     
  37. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    569
    Should be pretty straightforward actually, I just need to be able to use #defines to check for the base classes to implement.

    It's kind of a general concern actually now with Unity getting more modularized; until packages come with linked #defines, it's going to be increasingly hard to create assets that fit the different dependencies of each user.
     
  38. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    2,307
    Hello, this looks like an interesting feature. :)

    Experienced in 2019.2.0a9:
    • The associated shortcut (Alt+') does not work.
     
  39. Redhook_Galen

    Redhook_Galen

    Joined:
    Nov 21, 2018
    Posts:
    8
    Started using this today and it is a rad addition, especially on Windows since the Menu Item search feature from OSX doesn't have a Windows equivalent.

    One request I would have is it possible for AnimationClips source to show the clips instead of the FBX file? So that we can drag from the quick search into a Animator field or Timeline clip.

    The use case for this is that we use the animation naming standard (man@walk.fbx, wolf@walk.fbx, wolf@jump.fbx) but the problem with this is that when using the Asset Search window everything just shows up as the animation name without whatever is before the @ symbol until you click on it and look at the footer for the filepath. If you add the name of the character into the search it finds nothing.

    So it would be cool if Quick Search could display animation clips for us and search the parent asset's name. So if I searched "t:AnimationClip wolf" I would get all our wolf animations ready to drag.
     
  40. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    63
    Could we have shortcut to quick search like in Rider : pres Shift twice?
    It is very fast and convinient and would be one shortcut for 2 programs ( Unity and Rider).

    Why there is no Capital letters search like any modern code intellegennce do? For example in order to find
    asset with name MySuperUsefullAsset you just write MSUA and it will be finded.
    Any plans for implementing this?
     
    dadude123 likes this.
  41. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    You can always go in the Shortcut Manager to validate which shortcut is bound to the Quick Search or even change it.
     
    APSchmidt likes this.
  42. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    It shouldn't be too difficult to add such a search provider. We'll add it to our TODO list and get back to you.

    Thanks for the feedback,
     
    ReptileDev likes this.
  43. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    Hi, yes we are planning to add better search capability like you suggested. This will be implemented over time and might come sooner than later. Stay tuned.
     
  44. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    468
    Are all Unity employees required to work on dinky Macbooks? What's up with this small search window that is not resizable? Do you really want us to use this?

    Unity has to keep in mind that users may use large size multi-monitors. We are in 21st century, so please do something about the Editor windows.

    Unity was originally designed for single monitor and meant to reuse as much as monitor space on a single window and the current version is not much different from 10 years ago. So much context switching and it's really killing the productivity.
    I know you guys won't listen but don't make the new tools to follow the bad design.

    I really wonder if there is a UX team in Unity who oversees the whole Editor workflow, instead of leaving each tool to each developer. Programmers are notorious for making a bad UX and they don't use the tool that they build, instead, we all have to suffer.
     
  45. sebastienp_unity

    sebastienp_unity

    Unity Technologies

    Joined:
    Feb 16, 2018
    Posts:
    24
    On a more objective level what are the type of windowing feature you would like for the QuickSearch tool?

    - Resizable?
    - Dockable?
    - Less transient? Should the window close when you select an item or when you click outside the QuickSearch tool?

    Thanks for your feedback.


     
  46. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    468
    If I were free to say, I'll do all of the above.
    Transient Window(auto-close-window when you select one of the search results) is convenient when you want to search for something quickly, hence the name. But please make it resizable. It's making me feel claustrophobic.

    And dockable window(non-transient window) will be useful for some use cases where you want to browse through the search results without closing the window.

    Thanks.
     
  47. Razmot

    Razmot

    Joined:
    Apr 27, 2013
    Posts:
    258
    Could it be used to search ECS entities at runtime ? Something like a "name" or "debug" component attached to the entity, containing the string to search.
     
  48. lorddesu

    lorddesu

    Joined:
    Aug 20, 2014
    Posts:
    20
    Are you going to add package for 2018.3 or 2018.4 LTS?
     
  49. ktest112233

    ktest112233

    Joined:
    Jan 7, 2019
    Posts:
    27
    is it possible to modify the shortcut for the quick search in 2018.3?
     
    Lars-Steenhoff likes this.
  50. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    164
    The current version does not do it, but that said, I'll it on our TODO list for the upcoming releases.