Pre-dupsort: fix query when prefix is passed in JSON

After the last similar merge, queries no longer recognize the prefix if passed in the JSON, so this PR fixed that.

@benbjohnson @mkobetic @charlescng