I ended up using two search parameters, one to detect the threshold version and one to detect any version (because "Not Installed" meant something else)
I want to prevent upgrades from before a specific version.
When I install version 5.1 it should check the previous version and only continue with the new installer if there isn't a previous version installed or if the previous version is above a 5.0.