Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Quick Search Preview

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

  1. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    293
    Putting the name in quotes should do the trick.
     
    jonathans42 and iSinner like this.
  2. Mjeno

    Mjeno

    Joined:
    Apr 7, 2016
    Posts:
    5
    Hey, everyone! I would love to use Quick Search, but it's just not showing up in the Package Manager. A bunch of other packages are, including one single pre-release package.

    Further information:
    - I am browsing the "Unity Registry".
    - Pre-release packages are set to be visible in the Advanced Project Settings.
    - I am logged into my Unity account.
    - I am using Unity 2021.1.15f1. The package does show up in the list when using 2020.3.13f1.

    Any idea what could be going wrong?

    Update: Just editing the manifest.json file to pretend it was installed produces a bunch of errors, mostly "The name 'SearchQury' does not exist in the current context". I guess Quick Search is not yet compatible with 2021.1?
     
    Last edited: Jul 21, 2021
  3. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Try this:
    p: /(Plants|Creatures)/*


    i.e.

    upload_2021-8-2_10-16-29.png
     
  4. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Try adding quotes, i.e.
    h: "Panel - Options Menu"
    , otherwise your query is split in multiple words and we try to match them individually.
     
    iSinner likes this.
  5. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Search is built-in Unity >=2021.1 so you do not need the package anymore.
     
  6. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    293
    Ohh, this does exactly what I need thank you! Can you explain exactly how this works, or where I can read about the
     | 
    token? The syntax cheat sheet doesn't have anything about it it seems. I assume it is acting like an
    OR
    .
     
  7. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Basically you can search using regex. In this case I am matching multiple words.
     
  8. oxysofts

    oxysofts

    Joined:
    Dec 17, 2015
    Posts:
    124
    Will Search still update separately of Unity?
     
  9. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    We are still updating com.unity.quicksearch@3.0.0-preview.* for 2020.3.
     
  10. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    https://twitter.com/tjheuvel/status/1422437561696407559

    Any clue what could be going on here? Unity 2021.1.15, search is rather useless because it cant find my file until i complete about 90% of the name. No such issue with previous versions of Unity.

    Unable to repo in a smaller project, only in our main project. I dont see a search index file in my user settings folder, thats weird?
     
    Last edited: Aug 3, 2021
  11. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    I sent you a direct message to get more info about your setup.
     
  12. ExtraCat

    ExtraCat

    Joined:
    Aug 30, 2019
    Posts:
    52
    After installing Mirror and PlayFab packages unity editor started constantly using one CPU, even when minimized with empty scene (v. 2020.3.13f1), and greatly slowing down the work. Turns out this package is causing it.

    Search settings were set for a game of average size, which makes sense because the project didn't even have any gameplay scenes yet, only main menu. After uninstalling quick search everything went back to norm.

    I didn't even use quick search to search something in the project, I guess the indexing itself is causing it.
     
  13. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Hi ExtraCat, can you let me know which version of the package you are using? Do you see anything going on in the Background Task window?

    Thanks,
     
  14. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Hi Search users,

    We've been working on a new dependency viewer (still WIP and not official) using the Search backend.

    Here's an intro page to learn about the tool: https://github.com/Unity-Technologies/com.unity.search.extensions/wiki/dependency-viewer

    Here's the repo to get it installed: https://github.com/Unity-Technologies/com.unity.search.extensions

    The Search Extensions package will work with Unity 2020.3 and any other versions higher than 2021.2.
    • If you are using 20.3: also install the com.unity.quicksearch@3.0.0-preview.14 package.
    • If you are using 21.2+ : Search extensions will use the built-in Search framework.
    There is no incremental update yet to the database, so you'll need to rebuild the DB when you want the info to be up-to-date.

    We would love your feedback on the tool if that is something you think your project needs.

    Please post your questions, comments, suggestions and bug reports to https://forum.unity.com/threads/experimental-dependency-viewer.1158899/

    Thanks,

    upload_2021-8-19_10-45-24.png
     
    Last edited: Aug 19, 2021
    sirxeno, Baste, BOXOPHOBIC and 2 others like this.
  15. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    Very welcome news ! I have been looking for a dependencies viewer for a while and now that it’s coming to unity makes my day !
     
  16. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Great to hear! The package is still very early in development (bug reports are welcome on github at https://github.com/Unity-Technologies/com.unity.search.extensions/issues).

    At this stage we really want to shape the future of the tool from user feedback and requirements.
     
  17. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    First feedback: really nice first version!

    I have listed unused assets in the dependency viewer and now I want to select multiple assets from that list in the project window in order to perform an action on them ( delete or move )
    But when I right click > select it only selects one asset in the project browser

    I know its not a smart thing to delete all unused assets but its just an example of multi-select from list and synchronise selected items in the project window

    Alternatively allow deleting multiple selected assets from disk via the decency viewer
     
    Last edited: Aug 19, 2021
  18. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    One thing that may be nice in order to see if there are referenced assets inside a folder in the project window,
    is to have an indication of used count on the folder of all items inside the folder.
    or some other indicator that it contains referenced items.
    This way I can quickly see in the project window if a folder is empty of referenced items or not.

    Or just an 0 next to the folder when there are no referenced assets inside the folder
    Then I know if there is not a zero by the folder that there are items inside that are referenced.
     
    Last edited: Aug 19, 2021
  19. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Good point, we do not handle multiple selection right now. We'll fix that.

    Yes we want to do this too. We also want to have a slider in the UI to show multiple level of indirect references. So basically a folder would show all indirect references of all assets under it.

    We'll do this for version 1.0.4.

    Thanks for the feedback.
     
    Lars-Steenhoff likes this.
  20. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,106
    Looks good for start thanks :)

    Questions/Propositions:
    - may be source assets size is important but in my experience I mostly dont care about source assets size and care vary much about imported assets sizes. So I need column for Imported Assets sizes.

    - Looks like you develop yet another way to track dependencies in project and it again have nothing to do with real dependencies that will work upon pressing build button. Am I wrong?

    - I want to select scene and see all textures, meshes and sounds that it depends on and their imported sizes that I will have in player if unload all and load only this scene. How can I do this?

    - will be very good to select scene and see all shader variant dependencies in it? and imported size of every shader variant and sum of ones.

    - one of hard questions in project is why this asset actually goes into build? Want to select asset and see path to root scene/scenes or other assets that act as root in real build asset collection process. So I can see all resource why asset was added to build
     
  21. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Yes that was requested by another user too. Right now we only have 4 columns. We will add the ability to add as many columns as you want just like Search Table (since the dependency table view is based on the Search Table), see
    upload_2021-8-19_15-40-10.png

    The AssetDatabase has it own way of tracking dependencies that is required for the import process. In our case here, we are pushing the limits a lot more by tracking all sorts of dependencies, such as scripts weak dependencies, i.e. when a C# script or shader
    string
    refers to an asset filename, etc.

    Same as above, this is not available yet. In a future version we will add way to aggregate dependency info by running complex search expression to compute that data. Right now the tool won't aggregate any data, you need to build your own search expressions, see Most Used Asset.

    You are right, at the moment we gather all references and their source, but we didn't have time yet to display that source (i.e. the property referring to the asset) in the UI. We aren't sure yet on how to properly layout all that data to be easily readable and understandable.

    Great feedback, we'll try to come up with a better way to layout the data of references so you can better understand why the system found a given reference.

    @sebastienp_unity is about to setup another thread to gather and keep track of your requests.
     
  22. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
  23. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    Yep I reposted it there
     
  24. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,106
  25. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,106
    Installed com.unity.quicksearch@3.0.0-preview.14 package and now I can not open asset using Alt+Enter from search window. In version 2.x.x it works nut not in 3.0.0

    How can I add shortcut for Open?

    upload_2021-8-20_0-8-50.png
     
  26. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,106
    Can not move between asses using Left Right buttons only Up Down works and works as Left Right instead of Up Down
    Also Menu Button on Keyboard dont open context menu on asses like RightClick
     
  27. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,106
    Can I perform such complicated request not for entire project but for one folder in project?
     
  28. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,106
    Search window make performance bad if opened even when hidden and not used
    upload_2021-8-20_13-15-27.png
    If close search window everything go normal
     
  29. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Indeed, something changed in that contextual menu. Do you mind reporting an issue for this and I will take care of it.

    We've not added left/right navigation in grid view. We should do that. I'll add a task for this.

    You can do this if you start with the folder name in quotes, i.e.
    p: "Assets/My/Folder/" t:texture


    Ok this is bad. I will try to repro. Can you tell if you repro in another project too? Would you know by any chance which
    UnityEditor.Search
    method
    InvokeTickEvents
    is calling?
     
  30. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    80
    I'm using 2021.1.17 and based on a message in this thread, Search should be built into Unity in this version. However, I can't find any reference to it at all, and cannot find any way to open it (Alt + ' does nothing)

    EDIT: Finally found it after digging through the shortcuts. Seems like the shortcut got changed to ctrl+k in 2021... Documentation should seriously be updated. Even the first post on this thread says to click Help -> Quick Search but that doesn't exist in 2021.1
     
    Last edited: Aug 30, 2021
    cygnusfear likes this.
  31. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    What mechanism does QS use to decide when to update the search index with new things?

    I'm currently changing branches a bunch. When I change from a branch that doesn't have a file to a branch that has it, QS often doesn't find the file if I search for it. Recreating the index (by changing it somehow) fixes it, but that's not exactly ideal!

    We've also been running into bugs for a very long time where the AssetDatabase and Resources both fail to find new files after a git merge, so there's a good chance that it's the same issue. Some info on what's happening would go a long way towards maybe being able to create a good repro.
     
  32. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    The keyboard shortcut has been changed to CTRL+K in that version. You can rebind shortcuts with the shortcut manager.

    upload_2021-8-30_9-15-22.png
     
  33. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Hi, the latest version uses a transaction manager to track all assets changes. Usually we accumulate changes and wait until you use Search the next time to start the incremental update process.

    The transaction DB can be found at
    ./Library/Search/transactions.db
    . Which version are you using? It is not impossible some changes failed to be tracked using the transaction DB when it happened through an external process that the ADB didn't catch and didn't re-imported the touched assets.

    If you can repro such cases, please record the steps and send them to me.

    For sure, the workaround would be to open the index manager and (Re)Build the index which should get it up-to-date (not ideal, sorry about). If you think the
    transactions.db
    is corrupted, please send it our way and we will look at it (let us know which version you are using for that).

    Yes that is possible, the transaction manager relies on the
    AssetDatabase
    to report some of the transactions. That said, it seems to be the most stable with >=21.2.

    We could always add some integrity check at some point (i.e. first time you use Search after launching Unity) to see if the search index DB needs to be rebuilt because its internal document count doesn't match what found on disk. But the side effect of this, is that is takes some CPU and disk IO resources to run this check and it is not always suitable if done in the background without notice.
     
  34. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,106
    Finally report
    (Case 1362526)



    Thanks

    This is what I see with deep profile when launch game and wait in main menu:
    upload_2021-9-2_17-14-2.png
     
  35. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    I have assigned the issue to me. I will fix this ASAP.

    I will contact you in DM to get more info to repro this once locally.

    Thanks,
     
    JesOb likes this.
  36. ExtraCat

    ExtraCat

    Joined:
    Aug 30, 2019
    Posts:
    52
    That was 2.0.2 version, the newest one available for unity 2020.3.13f1. There was nothing in the Background Task window I'm afraid.
     
  37. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Hi, I am investigating a similar issue with Jes28. I am about to release com.unity.quicksearch@3.0.0-preview.16 which has some very important indexing optimization. Index size is ~70% smaller and combining step is >5-10X faster.

    I'll let you know when it is ready so you can tell me if it changes something for you.

    You can always remove the asset index using the Search Index Manager and use the
    find:
    provider which doesn't cost any indexing time.
     
    Lars-Steenhoff and JesOb like this.
  38. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    upload_2021-9-6_9-4-52.png

    Could we have a "properties" entry in this menu, so we can open ScriptableObjects and other assets in a properties window instead of the main inspector? For settings objects I want them in their own tab, so I can dock it and modify it easily on the go, but I can't do that from Quick Search in the new, nice way with a properties window. I instead have to do the ancient, sad process of opening another inspector and locking it like it's 2019. :(
     
  39. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Hi, we do have it for >=2021.2, but I can surely use a bit of reflection to do the same for 2020.3. I'll try to add this to com.unity.quicksearch@3.0.0-preview.16
     
    Baste likes this.
  40. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Actually it will be in preview.17
     
  41. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    There you go, here's what you should get with preview.17

    upload_2021-9-8_14-50-38.png

    Alt+ENTER
    is back to as you can see in the screenshot above.
     
    Baste and JesOb like this.
  42. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    Thanks a lot for that! Two more questions:
    - the online changelog @ https://docs.unity3d.com/Packages/com.unity.quicksearch@3.0/changelog/CHANGELOG.html is out of date - it's only up to preview 13. Somebody forgot to update, or is there a website bug?

    - Is the index supposed to get rebuilt from scratch every time we update the package? Quick search is generally high quality and stable on the latest preview, so I've kept updating to the latest version, but "building assets search index" after the update takes a while, and it causes a noticeable performance regression when it's active, so I'd rather avoid to push that to all the team members if I'm able.
     
  43. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Hi, I will have to check with the doc team about this. Also we are not super vigilant with the preview changelogs since the official release notes will be part of 22.1.

    Here's are the ~changes~ for .17 (a bit more to come)

    ## [3.0.0-preview.17] - 2021-09-14
    - Add search action Properties for the asset provider
    - Add support for the dependency manager
    - Add table view support for 2020.3 (still experimental)
    - Do not stall asset provider request when done through a search expression if the indexes are not ready.
    - Fix {t:prefab} not being evaluated as an union expression
    - Fix asset store provider display in compact view.
    - Fix asset type selector for GameObject/Prefabs, @type will report Prefab for GameObject assets (i.e. .prefab files)
    - Fix performance issue with DateTime.Now and GetDocumentKey with scene objects (~10x)
    - Fix Quick Search package 3.0 can not open prefab/scene on alt+enter (case 1362526)
    - Fix scene provider item display in compact view.
    - Fix search column serialization using path info instead of selector.
    - Fix search file checkout when using SCM (i.e. perforce)
    - Guard API attributes from user code exceptions
    - Improve search auto-completion when query includes commas (,)
    - Improve Search UI localization
    - Optimize scene ref: search queries, ~10% faster.
    - Process search task dispatcher when running background search expressions (fix some query stalling when using SearchService.Request)
    - Reduce index size by 10-20% by removing unused filters, name: and id:
    - Reduce index size by 95% by fixing and improving string property encoding.
    - Remove id: and name: from the asset index (reduces the index size)


    Yeah since we are doing major optimizations, we bump the index db version to make sure they get re-indexed. Hopefully this will stabilize when we reach the 22.1 release. Sorry about that :( That said, preview.17 should be much faster to index!

    I hope I can release preview.17 this week. Let me know if indexing your project was much faster with that version, even with Properties indexing turned on. So yeah, .17 will also re-index everything (we've done important string encoding and indexing optimizations)
     
    JesOb likes this.
  44. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,106
    Just updated to this version from custom :)
    Good update overall :)
    Thanks @jonathans42

    Will be glorious if you fix it as provider for Project and ObjectPicker
    Object picker still dont see any sprite :)
     
    jonathans42 likes this.
  45. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Working on it.
     
    JesOb likes this.
  46. shoo

    shoo

    Joined:
    Nov 19, 2012
    Posts:
    67
    Hello! At first I want to give a thanks for such a useful tool. I found that I able to use this QuickSearch API to make my editor tools cleaner by delegating some of the functions to the QuickSearch.

    I mostly use this tool not only for classical search, but for extending editor too, i.e. for filtering scene hierarchy or options selector for my tools(for example, instead of adding option to the tool window(Add/Prefab1, Add/Prefab2, Add/Prefab3), I just use hotkey(ctrl+A) in my tool to open Add menu and select some prefab here, so I use QS for indexing prefabs and simplifying UI). So, this API helps me a lot, and now I am discovering this tool to use at its maximum.

    But I didn't found any way to customize view. For example, at some cases it is better to show not only scene objects which was founded, but also show this object sub-hierarchy. For now, I didn't found any way to implement it. Is it possible at all, and if it's possible where I can find examples(or where to start)?
     
  47. Per-Morten

    Per-Morten

    Joined:
    Aug 23, 2019
    Posts:
    119
    Would it be possible to add a way to clear the search bar each time you open quicksearch, similar to how it was in earlier versions? I find myself constantly forgetting to clear the search bar because I quicksearch similar to how I would use ctrl+p in other software, aka search and go to file.
     
    JesOb likes this.
  48. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    It's not uncommon that I actually want to search for the thing I last searched for (
    player t:prefab
    is like 80% of what QuickSearch gets to look for :p), but I totally see it as an option.

    Alternatively, maybe the previous text could start out selected, so when you start typing it gets cleared, but you still get that last search when you open up?
     
    Lurking-Ninja likes this.
  49. Per-Morten

    Per-Morten

    Joined:
    Aug 23, 2019
    Posts:
    119
    Good idea, having the previous text starting out selected would probably be better than outright clearing it.
     
  50. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    If you do not mind, you could easily create a new MenuItem method that uses SearchService.ShowWindow and by passing an empty string as the initial search context. Then once you have this method ready, you can bind the shortcut you want through the shortcut manager. I am taking note of your suggestion and we could in a future release add a new shortcut entry that could map do to exactly this.