How site search actually works


i am trying to get a grasp on how site search actually works, and i have the following questions:

first of all, my logging:
i am using the bulk tracking api.
when a user searches our site, i provide ‘search’ and ‘search_count’ parameters along with the url of the search result page.

is a hit registered on the search results page? because my experience is leaning towards no.
it seems like there is this nebulus ‘site search’ meta page that piwik makes as only a transition point to where the user goes after a site search.

which leads to interesting detection problems:
ets say that the back end has logic so that different search result pages are shown depending on the type/format/etc of the actual search string.
how would i detect which page they were shown?

lets say that the back end has logic so that if there is onlly 1 search match, you are taken directly to that match page:
it seems like that actual data page is counted as the search result page, and that any link you click on from that page, is counted as ‘Pages following a site search’

what is the right way of detecting that a search lead directly to a data page and not to search results?