I suggest the conventional solution to problems of this kind is to concatenate the pair of search terms (ie a helper column) and to add the concatenated pairs to the lookup array.
In the example above the concatenation of what to look up (rather than where to look up) is done 'on the fly'.