Here is a quick tip for the use case where you want to limit the results of a search to only search within the site you are on and/or its sub sites:
Since you are specifying “contains”, it will include the current site and all subsites since all subsites will contain the path of the parent. All other results not in or below the current site will be excluded because they will not have this path.
The screen shot below shows the configuration of this change at the site collection level. If we had made this change at the farm (search service) level, it can be used anywhere in the farm.