Christmas Search Tips and Tricks

The Unity Search Workflow is really rich and allows a lot of different workflows. But sometimes people forget that the Search backend can be scripted to add even more power to it. The current Unity Manual for search will be updated for 23.3 but I feel a lot of the APIs allowing you to customize Search are difficult to find (unless you crawl the Unity Script API pages by yourself).

As a (small) Christmas gift I decided to give you a bunch of articles helping you get even more control on search. I will try to post one article per day until the start of my Christmas break (December 22th).

All articles can be found here:

For those who do not know, the SearchExtensions package is a repository of examples and prototypes using the back of the Search system.

The article of the day is about Asset Custom Indexing or how YOU can decide how asset properties can be indexed.

The article can be found here:

4 Likes

Wonderful, thanks a lot

Is it viable for an editor tool to use the search API to classify selectable objects?

For example if I work with a grid and I want all floor tiles listed in a window, I could define a search scheme (labels, naming, tag component or similar). What would be some pros/cons over the classic approach where you’d provide or expect users to drop the floor tiles in one list, wall tiles in another list respectively just placing them in specific folders?

Challenge accepted: I will make this the subject of my next article/blurb. Hope to publish this by the end of the day!

1 Like

I just noticed that I wrote a blog post a while ago going through the major search features:

https://github.com/Unity-Technologies/com.unity.search.extensions/wiki/Search-Features-Walkthrough

I will try to write something more focused on using the Search Window as a Level Editing tool.

Here is the second article about how to get the most of the Search Window for Christmas:

How to use the Search Window as a Collection tool allowing you to manage multiple live collection of objects.

2 Likes

Check this out ^^^

I hope the explanation on my perceived advantage of Search Query vs Folder is good enough to answer your question.

What is the gift that keep on giving? More Search knowledge of course. This article is how to get the most out of the Advanced Picker workflow in Unity:

3 Likes

The feature walkthough page is god send.

Although, in my current project that’s approaching 500gb, I can’t use the new search to full potential because indexing take so much time. Is there anytip on how to optimize indexing?

I currently have to disable indexing in my project but I still use search because the saved search query is still very handy!

This is great stuff! The first time I tried out the new search tool I was overwhelmed and the manual wasn’t really helping, so after an hour trying to wrap my head around it I’ve never used it again. Will definitely have another look now. Especially the table editing seems very powerful!

You project is epically big. Here are some tips to help with indexing:

  • You can tweak what needs to be indexed. If you know you have folders contaning assets that have know value in being indexed (like psd) I suggest you create your own index file and exclude these folders.

  • Indexing properties and extended can be long: you can exclude these options. I suggest you keep indexing type and dependencies since searching by ref is a nice workflow.

  • You can also create multiple indices in your project. If you know that some folders full of assets (textures?) are not chaning often, you can create an index for this folder (any index file at the root of a folder will index recursively all assets in that folder. And create other indexes for assets that change more often. This way indexing will mostly affect fixes that change often.

In my test project I have multiple indices, each with different settings:

9542248--1347670--upload_2023-12-21_11-25-22.png

9542248--1347673--upload_2023-12-21_11-25-45.png

9542248--1347676--upload_2023-12-21_11-26-19.png

If you like the Search window and the posibility to save query on disk and you feel like indexing is not usable at all you can:

  • Remove all index settings from your project (and delete the default one created in UserSettings.
  • Use the Search window with the “ADB PRovider” enabled:

9542248--1347679--upload_2023-12-21_11-28-27.png

The ADB provider is connected to the AssetDatabase (same search engine as the Project Browser. This would still allow you to have a collection like workflow and save multiple SearchQuery in your project but searching would use AssetDatabase instead. You can still setup Table and save them in SearchQuery. I feel that even if in this workflow you wouldn’t have properties being indexed you could still benefit from the User Experience that the Search Window provide.

Here is a Table View I setup using the ADB provider and allowing to view and edit mesh and Cast Shadows properties:

9542248--1347682--upload_2023-12-21_11-33-34.png

Hope this helps. The “find” provider could be interesting for you as well, it searches by file name and supports glob and regex searching. All its search is fully threaded and you be fairly quick even in big project.

1 Like

You are right that the Search Window can be intimidating at first. It is difficult to find the right balance between ease of use and powerful workflow. I hope these articles I wrote can help “harness” the power of the Search workflow :slight_smile:

Does the tool support “reverse search”? For example, does it show me all the materials where a specific texture (the texture I search for) is used?

Hi @Peter77 ,

the ref keyword doesn’t do inverse search.

ref: will yield all assets that are using/referencing/pointing to MyMaterial.

If you want bidirectionnal dependencies you can look at our Dependency Viewer prototype here:

1 Like

The sequence continues with this piece on Asset Indexation and how to customize it:

Thank you for the reply. I have just installed it, very useful!

Last one before Christmas break. A post about the multiple places where Search is integrated in the Editor. Have a nice end of 2023 and a good 2024 everybody! Search Integration · Unity-Technologies/com.unity.search.extensions Wiki · GitHub