The first part of the search process is defining what is being searched. If you’re searching for a file, it’s usually bound by a subdirectory. If you’re looking for a physical object, it’s usually bound by some area, outside of which you’re either certain of its absence, or you’re unable or unwilling to search in.
p-search starts off using something called “candidate generators,” which allow the user to enumerate the things being searched. For a program like Emacs, the most commonly used generator would be the “filesystem” generator, which generates candidates from a subdirectory.
A candidate in p-search is defined as something with key-value attributes. A filesystem candidate could have a filename, file content, modification date, size, etc. An Emacs buffer candidate, for example, you want to search your open buffers, could have a content, name, and Emacs buffer object. A physical location candidate could have a latitude and longitude.
In p-search, the properties of a candidate dictate how you can search said entity. If the search candidate has text content, then you can perform a text-search on it. If the search candidate has a latitude/longitude, you can perform a distance search. If a candidate has a git-root property, then you can perform a search by git authors.