The same way you did for previous file, take reference from here :
Copy that module and paste in your other website, it should work.
@gaurav_harsh1 There is no clear information, my path /lib/internal/Magento/Framework/Search/Dynamic how to edit in a namespace?
Don't edit the lib file, again we are not editing this core file, we have to ovrride this lib/internal file.
Just copy your module to another Project and run commands.