I think you can use docset keywords to achieve the functionality you want. You can define a keyword for each docset in Preferences. For example, python:test would search for "test" in the Python docset.
Just tried this out, and it's not as flexible as I would like. For example, !python <search> doesn't work. You'd need to use !python:<search>. It also seems to require that you have no space between the keyword, colon, and search phrase.