Nia McCash
Mega Sage
Mega Sage

In this article, I wanted to share some interesting findings for a ‘code search’ method that I have been using and how it compares to the existing code search in Studio. 

This code search method does not require opening of Studio, or any plugins or Share apps to be installed.

For this ‘code search’, I go to the sys_metadata list:
find_real_file.png

 

And perform a keyword search on the list:
find_real_file.png

 

The search will look through all tables that extend sys_metadata including ACLs, reports, dictionary entries, etc. As such, one interesting finding was the difference in what I was able to find with this method of code search. 

 

For the search term: ProcessParamParser

 

Studio returned 1 matching result as follows:

find_real_file.png

Searching the sys_metadata table returned 4 results:

find_real_file.png

 

Here’s a peek at the NGINX code (that was not found by the code search in Studio):

find_real_file.png

 

Thanks to my fellow Dev MVP - Eric Riemer - who pointed out to me on slack that the tables and configs for Studio search be found in the sn_codesearch_table so you can add to this if you want to expand what is searchable by Studio. As you can see above, Studio search has the added benefit of highlighting the exact line of code where your search term is found.

find_real_file.png

 

I am not suggesting that one method is better than the other.
Each method likely has its pros and cons (eg. see Allen A's comment on performance considerations 👇)

For Studio and similar code search methods, I refer you to these two community articles:

The above is definitely not meant to be a thorough comparison of the code search options, but i thought the differences are interesting and worth sharing. Hopefully this has been helpful to some people/in some situations.

Comments
Allen Andreas
Tera Patron

Hi,

Thanks for posting.

I'm assuming this is because studio is searching "All applications" as indicated by the code search results and the other method is searching instance wide, everything.

So if you're wanting to find within your apps, if that search term is listed, studio will work.

If you're wanting to look within your entire instance, going through the sys_metadata search will work.

One is less resource intensive than the other and better to use IF...you know the scope basically of your search.

Thanks!

Version history
Last update:
‎02-04-2021 01:47 PM
Updated by: