Class: Google::Apis::CustomsearchV1::Search::Queries::Request
- Inherits:
-
Object
- Object
- Google::Apis::CustomsearchV1::Search::Queries::Request
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/customsearch_v1/classes.rb,
lib/google/apis/customsearch_v1/representations.rb,
lib/google/apis/customsearch_v1/representations.rb
Overview
Custom search request metadata.
Instance Attribute Summary collapse
-
#count ⇒ Fixnum
Number of search results returned in this set.
-
#cr ⇒ String
Restricts search results to documents originating in a particular country.
-
#cx ⇒ String
The identifier of an engine created using the Programmable Search Engine Control Panel.
-
#date_restrict ⇒ String
Restricts results to URLs based on date.
-
#disable_cn_tw_translation ⇒ String
Enables or disables the Simplified and Traditional Chinese Search feature.
-
#exact_terms ⇒ String
Identifies a phrase that all documents in the search results must contain.
-
#exclude_terms ⇒ String
Identifies a word or phrase that should not appear in any documents in the search results.
-
#file_type ⇒ String
Restricts results to files of a specified extension.
-
#filter ⇒ String
Activates or deactivates the automatic filtering of Google search results.
-
#gl ⇒ String
Boosts search results whose country of origin matches the parameter value.
-
#google_host ⇒ String
Specifies the Google domain (for example, google.com, google.de, or google.fr) to which the search should be limited.
-
#high_range ⇒ String
Specifies the ending value for a search range.
-
#hl ⇒ String
Specifies the interface language (host language) of your user interface.
-
#hq ⇒ String
Appends the specified query terms to the query, as if they were combined with a logical
AND
operator. -
#img_color_type ⇒ String
Restricts results to images of a specified color type.
-
#img_dominant_color ⇒ String
Restricts results to images with a specific dominant color.
-
#img_size ⇒ String
Restricts results to images of a specified size.
-
#img_type ⇒ String
Restricts results to images of a specified type.
-
#input_encoding ⇒ String
The character encoding supported for search requests.
-
#language ⇒ String
The language of the search results.
-
#link_site ⇒ String
Specifies that all results should contain a link to a specific URL.
-
#low_range ⇒ String
Specifies the starting value for a search range.
-
#or_terms ⇒ String
Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms.
-
#output_encoding ⇒ String
The character encoding supported for search results.
-
#related_site ⇒ String
Specifies that all search results should be pages that are related to the specified URL.
-
#rights ⇒ String
Filters based on licensing.
-
#safe ⇒ String
Specifies the SafeSearch level used for filtering out adult results.
-
#search_terms ⇒ String
The search terms entered by the user.
-
#search_type ⇒ String
Allowed values are
web
orimage
. -
#site_search ⇒ String
Restricts results to URLs from a specified site.
-
#site_search_filter ⇒ String
Specifies whether to include or exclude results from the site named in the
sitesearch
parameter. -
#sort ⇒ String
Specifies that results should be sorted according to the specified expression.
-
#start_index ⇒ Fixnum
The index of the current set of search results into the total set of results, where the index of the first result is 1.
-
#start_page ⇒ Fixnum
The page number of this set of results, where the page length is set by the
count
property. -
#title ⇒ String
A description of the query.
-
#total_results ⇒ Fixnum
Estimated number of total search results.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Request
constructor
A new instance of Request.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Request
Returns a new instance of Request.
1287 1288 1289 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1287 def initialize(**args) update!(**args) end |
Instance Attribute Details
#count ⇒ Fixnum
Number of search results returned in this set.
Corresponds to the JSON property count
1039 1040 1041 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1039 def count @count end |
#cr ⇒ String
Restricts search results to documents originating in a particular country. You
may use Boolean operators in the cr
parameter's value. Google
WebSearch determines the country of a document by analyzing the following: *
The top-level domain (TLD) of the document's URL. * The geographic location of
the web server's IP address. See Country (cr) Parameter Values
for a list of valid values for this parameter.
Corresponds to the JSON property cr
1051 1052 1053 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1051 def cr @cr end |
#cx ⇒ String
The identifier of an engine created using the Programmable Search Engine
Control Panel. This is a custom
property not defined in the OpenSearch spec. This parameter is required.
Corresponds to the JSON property cx
1058 1059 1060 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1058 def cx @cx end |
#date_restrict ⇒ String
Restricts results to URLs based on date. Supported values include: * d[number]
: requests results from the specified number of past days. * w[number]
:
requests results from the specified number of past weeks. * m[number]
:
requests results from the specified number of past months. * y[number]
:
requests results from the specified number of past years.
Corresponds to the JSON property dateRestrict
1067 1068 1069 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1067 def date_restrict @date_restrict end |
#disable_cn_tw_translation ⇒ String
Enables or disables the Simplified and Traditional Chinese Search
feature. Supported values are: * 0
: enabled (default) * 1
: disabled
Corresponds to the JSON property disableCnTwTranslation
1074 1075 1076 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1074 def disable_cn_tw_translation @disable_cn_tw_translation end |
#exact_terms ⇒ String
Identifies a phrase that all documents in the search results must contain.
Corresponds to the JSON property exactTerms
1079 1080 1081 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1079 def exact_terms @exact_terms end |
#exclude_terms ⇒ String
Identifies a word or phrase that should not appear in any documents in the
search results.
Corresponds to the JSON property excludeTerms
1085 1086 1087 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1085 def exclude_terms @exclude_terms end |
#file_type ⇒ String
Restricts results to files of a specified extension. Filetypes supported by
Google include: * Adobe Portable Document Format (pdf
) * Adobe PostScript (
ps
) * Lotus 1-2-3 (wk1
, wk2
, wk3
, wk4
, wk5
, wki
, wks
, wku
) *
Lotus WordPro (lwp
) * Macwrite (mw
) * Microsoft Excel (xls
) * Microsoft
PowerPoint (ppt
) * Microsoft Word (doc
) * Microsoft Works (wks
, wps
,
wdb
) * Microsoft Write (wri
) * Rich Text Format (rtf
) * Shockwave Flash (
swf
) * Text (ans
, txt
). Additional filetypes may be added in the future.
An up-to-date list can always be found in Google's file type FAQ.
Corresponds to the JSON property fileType
1098 1099 1100 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1098 def file_type @file_type end |
#filter ⇒ String
Activates or deactivates the automatic filtering of Google search results. See
Automatic Filtering for more information about Google's
search results filters. Valid values for this parameter are: * 0
: Disabled *
1
: Enabled (default) Note: By default, Google applies filtering to all
search results to improve the quality of those results.
Corresponds to the JSON property filter
1108 1109 1110 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1108 def filter @filter end |
#gl ⇒ String
Boosts search results whose country of origin matches the parameter value. See
Country Codes for a list of valid values. Specifying a gl
parameter value in WebSearch requests should improve the relevance of results.
This is particularly true for international customers and, even more
specifically, for customers in English-speaking countries other than the
United States.
Corresponds to the JSON property gl
1119 1120 1121 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1119 def gl @gl end |
#google_host ⇒ String
Specifies the Google domain (for example, google.com, google.de, or google.fr)
to which the search should be limited.
Corresponds to the JSON property googleHost
1125 1126 1127 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1125 def google_host @google_host end |
#high_range ⇒ String
Specifies the ending value for a search range. Use cse:lowRange
and cse:
highrange
to append an inclusive search range of lowRange...highRange
to
the query.
Corresponds to the JSON property highRange
1132 1133 1134 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1132 def high_range @high_range end |
#hl ⇒ String
Specifies the interface language (host language) of your user interface.
Explicitly setting this parameter improves the performance and the quality of
your search results. See the Interface Languages section of
Internationalizing Queries and Results Presentation for more
information, and Supported Interface Languages for a list of
supported languages.
Corresponds to the JSON property hl
1145 1146 1147 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1145 def hl @hl end |
#hq ⇒ String
Appends the specified query terms to the query, as if they were combined with
a logical AND
operator.
Corresponds to the JSON property hq
1151 1152 1153 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1151 def hq @hq end |
#img_color_type ⇒ String
Restricts results to images of a specified color type. Supported values are: *
mono
(black and white) * gray
(grayscale) * color
(color)
Corresponds to the JSON property imgColorType
1157 1158 1159 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1157 def img_color_type @img_color_type end |
#img_dominant_color ⇒ String
Restricts results to images with a specific dominant color. Supported values
are: * red
* orange
* yellow
* green
* teal
* blue
* purple
*
pink
* white
* gray
* black
* brown
Corresponds to the JSON property imgDominantColor
1164 1165 1166 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1164 def img_dominant_color @img_dominant_color end |
#img_size ⇒ String
Restricts results to images of a specified size. Supported values are: * icon
(small) * small | medium | large | xlarge
(medium) * xxlarge
(large) *
huge
(extra-large)
Corresponds to the JSON property imgSize
1171 1172 1173 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1171 def img_size @img_size end |
#img_type ⇒ String
Restricts results to images of a specified type. Supported values are: *
clipart
(Clip art) * face
(Face) * lineart
(Line drawing) * photo
(
Photo) * animated
(Animated) * stock
(Stock)
Corresponds to the JSON property imgType
1178 1179 1180 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1178 def img_type @img_type end |
#input_encoding ⇒ String
The character encoding supported for search requests.
Corresponds to the JSON property inputEncoding
1183 1184 1185 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1183 def input_encoding @input_encoding end |
#language ⇒ String
The language of the search results.
Corresponds to the JSON property language
1188 1189 1190 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1188 def language @language end |
#link_site ⇒ String
Specifies that all results should contain a link to a specific URL.
Corresponds to the JSON property linkSite
1193 1194 1195 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1193 def link_site @link_site end |
#low_range ⇒ String
Specifies the starting value for a search range. Use cse:lowRange
and cse:
highrange
to append an inclusive search range of lowRange...highRange
to
the query.
Corresponds to the JSON property lowRange
1200 1201 1202 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1200 def low_range @low_range end |
#or_terms ⇒ String
Provides additional search terms to check for in a document, where each
document in the search results must contain at least one of the additional
search terms. You can also use the Boolean OR query term for this
type of query.
Corresponds to the JSON property orTerms
1209 1210 1211 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1209 def or_terms @or_terms end |
#output_encoding ⇒ String
The character encoding supported for search results.
Corresponds to the JSON property outputEncoding
1214 1215 1216 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1214 def output_encoding @output_encoding end |
#related_site ⇒ String
Specifies that all search results should be pages that are related to the
specified URL. The parameter value should be a URL.
Corresponds to the JSON property relatedSite
1220 1221 1222 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1220 def @related_site end |
#rights ⇒ String
Filters based on licensing. Supported values include: * cc_publicdomain
*
cc_attribute
* cc_sharealike
* cc_noncommercial
* cc_nonderived
Corresponds to the JSON property rights
1226 1227 1228 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1226 def rights @rights end |
#safe ⇒ String
Specifies the SafeSearch level used for filtering out adult results.
This is a custom property not defined in the OpenSearch spec. Valid parameter
values are: * "off"
: Disable SafeSearch * "active"
: Enable SafeSearch
Corresponds to the JSON property safe
1234 1235 1236 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1234 def safe @safe end |
#search_terms ⇒ String
The search terms entered by the user.
Corresponds to the JSON property searchTerms
1239 1240 1241 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1239 def search_terms @search_terms end |
#search_type ⇒ String
Allowed values are web
or image
. If unspecified, results are limited to
webpages.
Corresponds to the JSON property searchType
1245 1246 1247 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1245 def search_type @search_type end |
#site_search ⇒ String
Restricts results to URLs from a specified site.
Corresponds to the JSON property siteSearch
1250 1251 1252 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1250 def site_search @site_search end |
#site_search_filter ⇒ String
Specifies whether to include or exclude results from the site named in the
sitesearch
parameter. Supported values are: * i
: include content from site *
e
: exclude content from site
Corresponds to the JSON property siteSearchFilter
1257 1258 1259 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1257 def site_search_filter @site_search_filter end |
#sort ⇒ String
Specifies that results should be sorted according to the specified expression.
For example, sort by date.
Corresponds to the JSON property sort
1263 1264 1265 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1263 def sort @sort end |
#start_index ⇒ Fixnum
The index of the current set of search results into the total set of results,
where the index of the first result is 1.
Corresponds to the JSON property startIndex
1269 1270 1271 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1269 def start_index @start_index end |
#start_page ⇒ Fixnum
The page number of this set of results, where the page length is set by the
count
property.
Corresponds to the JSON property startPage
1275 1276 1277 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1275 def start_page @start_page end |
#title ⇒ String
A description of the query.
Corresponds to the JSON property title
1280 1281 1282 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1280 def title @title end |
#total_results ⇒ Fixnum
Estimated number of total search results. May not be accurate.
Corresponds to the JSON property totalResults
1285 1286 1287 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1285 def total_results @total_results end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 |
# File 'lib/google/apis/customsearch_v1/classes.rb', line 1292 def update!(**args) @count = args[:count] if args.key?(:count) @cr = args[:cr] if args.key?(:cr) @cx = args[:cx] if args.key?(:cx) @date_restrict = args[:date_restrict] if args.key?(:date_restrict) @disable_cn_tw_translation = args[:disable_cn_tw_translation] if args.key?(:disable_cn_tw_translation) @exact_terms = args[:exact_terms] if args.key?(:exact_terms) @exclude_terms = args[:exclude_terms] if args.key?(:exclude_terms) @file_type = args[:file_type] if args.key?(:file_type) @filter = args[:filter] if args.key?(:filter) @gl = args[:gl] if args.key?(:gl) @google_host = args[:google_host] if args.key?(:google_host) @high_range = args[:high_range] if args.key?(:high_range) @hl = args[:hl] if args.key?(:hl) @hq = args[:hq] if args.key?(:hq) @img_color_type = args[:img_color_type] if args.key?(:img_color_type) @img_dominant_color = args[:img_dominant_color] if args.key?(:img_dominant_color) @img_size = args[:img_size] if args.key?(:img_size) @img_type = args[:img_type] if args.key?(:img_type) @input_encoding = args[:input_encoding] if args.key?(:input_encoding) @language = args[:language] if args.key?(:language) @link_site = args[:link_site] if args.key?(:link_site) @low_range = args[:low_range] if args.key?(:low_range) @or_terms = args[:or_terms] if args.key?(:or_terms) @output_encoding = args[:output_encoding] if args.key?(:output_encoding) @related_site = args[:related_site] if args.key?(:related_site) @rights = args[:rights] if args.key?(:rights) @safe = args[:safe] if args.key?(:safe) @search_terms = args[:search_terms] if args.key?(:search_terms) @search_type = args[:search_type] if args.key?(:search_type) @site_search = args[:site_search] if args.key?(:site_search) @site_search_filter = args[:site_search_filter] if args.key?(:site_search_filter) @sort = args[:sort] if args.key?(:sort) @start_index = args[:start_index] if args.key?(:start_index) @start_page = args[:start_page] if args.key?(:start_page) @title = args[:title] if args.key?(:title) @total_results = args[:total_results] if args.key?(:total_results) end |