Class: HubSpotSDK::Resources::Cms::SiteSearch
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Cms::SiteSearch
- Defined in:
- lib/hubspot_sdk/resources/cms/site_search.rb
Instance Method Summary collapse
-
#get_indexed_data(content_id, type: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::IndexedData
Return all indexed data for an asset (e.g., page, blog post, HubDB table), specified by ID.
-
#initialize(client:) ⇒ SiteSearch
constructor
private
A new instance of SiteSearch.
-
#search(analytics: nil, autocomplete: nil, boost_limit: nil, boost_recent: nil, domain: nil, group_id: nil, hubdb_query: nil, language: nil, length: nil, limit: nil, match_prefix: nil, offset: nil, path_prefix: nil, popularity_boost: nil, property: nil, q: nil, table_id: nil, type: nil, types: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::PublicSearchResults
Returns any website content matching the given search criteria for a given HubSpot account.
Constructor Details
#initialize(client:) ⇒ SiteSearch
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SiteSearch.
106 107 108 |
# File 'lib/hubspot_sdk/resources/cms/site_search.rb', line 106 def initialize(client:) @client = client end |
Instance Method Details
#get_indexed_data(content_id, type: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::IndexedData
Return all indexed data for an asset (e.g., page, blog post, HubDB table), specified by ID. This is useful when debugging why a particular asset is not returned from a custom search.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/hubspot_sdk/resources/cms/site_search.rb', line 20 def get_indexed_data(content_id, params = {}) parsed, = HubSpotSDK::Cms::SiteSearchGetIndexedDataParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["cms/site-search/2026-03/indexed-data/%1$s", content_id], query: query, model: HubSpotSDK::Cms::IndexedData, options: ) end |
#search(analytics: nil, autocomplete: nil, boost_limit: nil, boost_recent: nil, domain: nil, group_id: nil, hubdb_query: nil, language: nil, length: nil, limit: nil, match_prefix: nil, offset: nil, path_prefix: nil, popularity_boost: nil, property: nil, q: nil, table_id: nil, type: nil, types: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::PublicSearchResults
Returns any website content matching the given search criteria for a given HubSpot account. Searches can be filtered by content type, domain, or URL path. Includes options for weighing results by recency and popularity, along with language support.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/hubspot_sdk/resources/cms/site_search.rb', line 82 def search(params = {}) parsed, = HubSpotSDK::Cms::SiteSearchSearchParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "cms/site-search/2026-03/search", query: query.transform_keys( boost_limit: "boostLimit", boost_recent: "boostRecent", group_id: "groupId", hubdb_query: "hubdbQuery", match_prefix: "matchPrefix", path_prefix: "pathPrefix", popularity_boost: "popularityBoost", table_id: "tableId" ), model: HubSpotSDK::Cms::PublicSearchResults, options: ) end |