Hooks from: & to: syntax in yml

Hi, I would like to rebuild the app including some modification to a file in order to disable the search feature for anonymous users.(more than with just css)

Can anyone provide me some documentation for the syntax of those hooks for the from: & to: part?

    - replace:
        filename: "/var/www/discourse/app/assets/javascripts/discourse/app/components/search-menu.js"
        from: /get classNames()/
        to: |
          if (!this.currentUser) {return false;} get classNames()

Discourse accepts the syntax now but at the end of the rebuild it fails with

 Error: Parse Error at discourse/components/search-menu.gjs:88:7"
replace failed with the params {"filename"=>"/var/www/discourse/app/assets/javascripts/discourse/app/components/search-menu.gjs", "from"=>"/get classNames()/", "to"=>"if (!this.currentUser) {return false;} get classNames()\n"}

There is a hidden site setting to accomplish that:

rate_limit_search_anon_global_per_minute

Thanks for pointing that out. Just to clarify, what’s the name of the hidden site setting? And does it fully disable search for anonymous users, or just hide the results? I’m looking for a way to block access at the controller level, so wondering if that setting alone is enough or if some custom code is still needed.