I disagree that search term or search text (@JoeBlow's answer) is what is sought. These are names for the search pattern that is matched (in some way) against the universe of discourse to find matches (search hits).
They provide a map, or clues to finding what is sought - they are not what is sought.
Each of the matches found is possibly what was sought. But it is not necessarily what was sought. It is possible that the search method is not perfect and it finds false positives - the search method finds hits that satisfy its rules and design, but these hits might not correspond to what the searcher really seeks.
And it is possible for a search to yield no search hits, even though there are real objects in the universe that correspond to what was sought. This can happen because either the search-pattern definition system or the search method is inadequate.
To me, a reasonable answer to What is the name for the thing that we search for? is the sought or the query object or the search target. Perhaps there is a better name for it; dunno.
In a different sense, you can conflate what is sought with what is found, and in this sense an answer to the question could be a search hit.
But IMO the answer is certainly not search term, search text, or search pattern. Those are simply part of the means of expressing the query - ways to describe or specify what is sought.
If I am looking for my car, then my car is what is sought. A description of my car: its make, model, color, year, etc., is not my car. I am not looking for a description of my car. I am providing you with a description of my car as a means to help find it.
My car is the search target. A description of my car is the search text, or search pattern. Matches, or search hits, that are the result of searching are the set of cars that fit the search pattern. with luck, one of those cars is what was sought, the search target.
Update after @JoeBlow's comment questions, in hopes it makes things clearer:
If you are looking for a filename string then that is the search target: the thing you are looking for. You provide a search pattern of some sort to a search engine of some sort, which looks for pattern matches among the candidates (the file names in your list). The pattern matches found, if any, are search hits. If you provide a good search pattern then one of the search hits will presumably be the target you seek.
The point is that what you are looking for and the search pattern you provide to try to find it are different things. (In the case of a string target and a string pattern, they could be the same string of text, but they need not be for most matching.) And the search hits that are found by matching your pattern are also not the same as what you are looking for. One or more of them might be what you are looking for, but that's not true in general.
How many times has Google not found what you were looking for? That can be because (a) your search pattern was not good enough, (b) Google search/indexing methods are not good enough, or (c) what you were looking for is not in the universe of Google data - it is not there to be found.