Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Chapter 4 — The Google Web API 57


Table 4-2: Base Data from a Search Request

Element Description

documentFiltering A boolean value that indicates whether filtering was
performed on the results. The value is only true if you
have requested filtering and filtering has been
performed. If you have not requested filtering, the
value will always be false.
searchComments Any message the API deems suitable to return about
the search, such as filtered content or words removed
from the query string.
estimatedTotalResultsCount The approximate total number of matches for the
given search criteria. The value given may not equal
the exact number of matches; you can determine this
by looking at the estimateIsExactvalue. Results
are estimates when results might be removed due to
duplications.
estimateIsExact A Boolean that if true states that the estimate value is
the real value.
resultElements An array of results. See Table 4-3 for the format of
each result item.
searchQuery The original value of the search query text.
startIndex Indicates the index (of the first result in the list of
results) within the total number of results.
endIndex Indicates the index (of the last result in the list of
results) within the total number of results.
searchTips A text string for search tips, such as alternate searches
or misspellings.
directoryCategories An array of directory categories (from the Google
directory) that would match the search.
searchTime A floating-point value indicating the amount of time
taken to perform the search.

The array of results is actually a list of individual structures, and each structure includes the
information about the result, including its URL, the snippet of text extracted from the page,
and other information. You can see the individual fields in a given item in Table 4-3.

Free download pdf