/** * This code was auto-generated by a Codezu. * * Changes to this file may cause incorrect behavior and will be lost if * the code is regenerated. */ package com.mozu.api.resources.commerce.catalog.admin; import com.mozu.api.ApiContext; import java.util.List; import java.util.ArrayList; import com.mozu.api.MozuClient; import com.mozu.api.MozuClientFactory; import com.mozu.api.MozuUrl; import com.mozu.api.Headers; import org.joda.time.DateTime; import com.mozu.api.security.AuthTicket; import org.apache.commons.lang.StringUtils; /** <summary> * Use the Search resource to manage all settings and options for providing product search on your site, as well as search tuning rules. * </summary> */ public class SearchResource { /// /// <see cref="Mozu.Api.ApiContext"/> /// private ApiContext _apiContext; public SearchResource(ApiContext apiContext) { _apiContext = apiContext; } /** * Retrieves the details of the specified search tuning rule. * <p><pre><code> * Search search = new Search(); * SearchTuningRule searchTuningRule = search.getSearchTuningRule( searchTuningRuleCode); * </code></pre></p> * @param searchTuningRuleCode The unique identifier of the search tuning rule. * @return com.mozu.api.contracts.productadmin.search.SearchTuningRule * @see com.mozu.api.contracts.productadmin.search.SearchTuningRule */ public com.mozu.api.contracts.productadmin.search.SearchTuningRule getSearchTuningRule(String searchTuningRuleCode) throws Exception { return getSearchTuningRule( searchTuningRuleCode, null); } /** * Retrieves the details of the specified search tuning rule. * <p><pre><code> * Search search = new Search(); * SearchTuningRule searchTuningRule = search.getSearchTuningRule( searchTuningRuleCode, responseFields); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param searchTuningRuleCode The unique identifier of the search tuning rule. * @return com.mozu.api.contracts.productadmin.search.SearchTuningRule * @see com.mozu.api.contracts.productadmin.search.SearchTuningRule */ public com.mozu.api.contracts.productadmin.search.SearchTuningRule getSearchTuningRule(String searchTuningRuleCode, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SearchTuningRule> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.getSearchTuningRuleClient( searchTuningRuleCode, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Retrieves a list of search tuning rules and their properties. * <p><pre><code> * Search search = new Search(); * SearchTuningRuleCollection searchTuningRuleCollection = search.getSearchTuningRules(); * </code></pre></p> * @return com.mozu.api.contracts.productadmin.search.SearchTuningRuleCollection * @see com.mozu.api.contracts.productadmin.search.SearchTuningRuleCollection */ public com.mozu.api.contracts.productadmin.search.SearchTuningRuleCollection getSearchTuningRules() throws Exception { return getSearchTuningRules( null, null, null, null, null); } /** * Retrieves a list of search tuning rules and their properties. * <p><pre><code> * Search search = new Search(); * SearchTuningRuleCollection searchTuningRuleCollection = search.getSearchTuningRules( startIndex, pageSize, sortBy, filter, responseFields); * </code></pre></p> * @param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a list of supported filters. * @param pageSize When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with this parameter set to 25, to get the 51st through the 75th items, set startIndex to 50. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param sortBy The element to sort the results by and the channel in which the results appear. Either ascending (a-z) or descending (z-a) channel. Optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for more information. * @param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with pageSize set to 25, to get the 51st through the 75th items, set this parameter to 50. * @return com.mozu.api.contracts.productadmin.search.SearchTuningRuleCollection * @see com.mozu.api.contracts.productadmin.search.SearchTuningRuleCollection */ public com.mozu.api.contracts.productadmin.search.SearchTuningRuleCollection getSearchTuningRules(Integer startIndex, Integer pageSize, String sortBy, String filter, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SearchTuningRuleCollection> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.getSearchTuningRulesClient( startIndex, pageSize, sortBy, filter, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Retrieves the details of the specified search tuning rule sort fields. Sort fields allow you to control the product relevance whenver shoppers sort products on a page. For more information about sort relevance, refer to [Search Tuning Rules and Sorting](../../../developer/api-guides/search-tuning-rules.htm#search_tuning_rules_and_sorting). * <p><pre><code> * Search search = new Search(); * SearchTuningRuleSortFields searchTuningRuleSortFields = search.getSearchTuningRuleSortFields(); * </code></pre></p> * @return com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields * @see com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields */ public com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields getSearchTuningRuleSortFields() throws Exception { return getSearchTuningRuleSortFields( null); } /** * Retrieves the details of the specified search tuning rule sort fields. Sort fields allow you to control the product relevance whenver shoppers sort products on a page. For more information about sort relevance, refer to [Search Tuning Rules and Sorting](../../../developer/api-guides/search-tuning-rules.htm#search_tuning_rules_and_sorting). * <p><pre><code> * Search search = new Search(); * SearchTuningRuleSortFields searchTuningRuleSortFields = search.getSearchTuningRuleSortFields( responseFields); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @return com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields * @see com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields */ public com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields getSearchTuningRuleSortFields(String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.getSearchTuningRuleSortFieldsClient( responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Retrieves the search settings for the specified site.Refer to [Search Settings API Overview](../../../../developer/api-guides/search-settings.htm) for more information about 's search settings. * <p><pre><code> * Search search = new Search(); * SearchSettings searchSettings = search.getSettings(); * </code></pre></p> * @return com.mozu.api.contracts.productadmin.SearchSettings * @see com.mozu.api.contracts.productadmin.SearchSettings */ public com.mozu.api.contracts.productadmin.SearchSettings getSettings() throws Exception { return getSettings( null); } /** * Retrieves the search settings for the specified site.Refer to [Search Settings API Overview](../../../../developer/api-guides/search-settings.htm) for more information about 's search settings. * <p><pre><code> * Search search = new Search(); * SearchSettings searchSettings = search.getSettings( responseFields); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @return com.mozu.api.contracts.productadmin.SearchSettings * @see com.mozu.api.contracts.productadmin.SearchSettings */ public com.mozu.api.contracts.productadmin.SearchSettings getSettings(String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.SearchSettings> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.getSettingsClient( responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Retrieves a collection of synonyms definitions for product searches.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinitionCollection synonymDefinitionCollection = search.getSynonymDefinitionCollection( localeCode); * </code></pre></p> * @param localeCode The two character country code that sets the locale, such as US for United States. Sites, tenants, and catalogs use locale codes for localizing content, such as translated product text per supported country. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection * @see com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection */ public com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection getSynonymDefinitionCollection(String localeCode) throws Exception { return getSynonymDefinitionCollection( localeCode, null); } /** * Retrieves a collection of synonyms definitions for product searches.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinitionCollection synonymDefinitionCollection = search.getSynonymDefinitionCollection( localeCode, responseFields); * </code></pre></p> * @param localeCode The two character country code that sets the locale, such as US for United States. Sites, tenants, and catalogs use locale codes for localizing content, such as translated product text per supported country. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection * @see com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection */ public com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection getSynonymDefinitionCollection(String localeCode, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.getSynonymDefinitionCollectionClient( localeCode, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Retrieves a list of synonym definitions according to any specified filter criteria and sort options.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinitionPagedCollection synonymDefinitionPagedCollection = search.getSynonymDefinitions(); * </code></pre></p> * @return com.mozu.api.contracts.productadmin.search.SynonymDefinitionPagedCollection * @see com.mozu.api.contracts.productadmin.search.SynonymDefinitionPagedCollection */ public com.mozu.api.contracts.productadmin.search.SynonymDefinitionPagedCollection getSynonymDefinitions() throws Exception { return getSynonymDefinitions( null, null, null, null, null); } /** * Retrieves a list of synonym definitions according to any specified filter criteria and sort options.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinitionPagedCollection synonymDefinitionPagedCollection = search.getSynonymDefinitions( startIndex, pageSize, sortBy, filter, responseFields); * </code></pre></p> * @param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a list of supported filters. * @param pageSize When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with this parameter set to 25, to get the 51st through the 75th items, set startIndex to 50. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param sortBy The element to sort the results by and the channel in which the results appear. Either ascending (a-z) or descending (z-a) channel. Optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for more information. * @param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with pageSize set to 25, to get the 51st through the 75th items, set this parameter to 50. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinitionPagedCollection * @see com.mozu.api.contracts.productadmin.search.SynonymDefinitionPagedCollection */ public com.mozu.api.contracts.productadmin.search.SynonymDefinitionPagedCollection getSynonymDefinitions(Integer startIndex, Integer pageSize, String sortBy, String filter, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SynonymDefinitionPagedCollection> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.getSynonymDefinitionsClient( startIndex, pageSize, sortBy, filter, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Retrieves the details of the specified synonym defintion.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinition synonymDefinition = search.getSynonymDefinition( synonymId); * </code></pre></p> * @param synonymId The unique identifier of the synonym definition. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinition * @see com.mozu.api.contracts.productadmin.search.SynonymDefinition */ public com.mozu.api.contracts.productadmin.search.SynonymDefinition getSynonymDefinition(Integer synonymId) throws Exception { return getSynonymDefinition( synonymId, null); } /** * Retrieves the details of the specified synonym defintion.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinition synonymDefinition = search.getSynonymDefinition( synonymId, responseFields); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param synonymId The unique identifier of the synonym definition. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinition * @see com.mozu.api.contracts.productadmin.search.SynonymDefinition */ public com.mozu.api.contracts.productadmin.search.SynonymDefinition getSynonymDefinition(Integer synonymId, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SynonymDefinition> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.getSynonymDefinitionClient( synonymId, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Creates a search tuning rule for your site. You can use search tuning rules to fine tune the product search results that appear when a shopper searches for a specific keyword, or navigates to a category page.For more information on search tuning rules, refer to [Search Tuning Rules](../../../../developer/api-guides/search-tuning-rules.htm). * <p><pre><code> * Search search = new Search(); * SearchTuningRule searchTuningRule = search.addSearchTuningRule( searchTuningRuleIn); * </code></pre></p> * @param searchTuningRuleIn The details of the new search tuning rule. * @return com.mozu.api.contracts.productadmin.search.SearchTuningRule * @see com.mozu.api.contracts.productadmin.search.SearchTuningRule * @see com.mozu.api.contracts.productadmin.search.SearchTuningRule */ public com.mozu.api.contracts.productadmin.search.SearchTuningRule addSearchTuningRule(com.mozu.api.contracts.productadmin.search.SearchTuningRule searchTuningRuleIn) throws Exception { return addSearchTuningRule( searchTuningRuleIn, null); } /** * Creates a search tuning rule for your site. You can use search tuning rules to fine tune the product search results that appear when a shopper searches for a specific keyword, or navigates to a category page.For more information on search tuning rules, refer to [Search Tuning Rules](../../../../developer/api-guides/search-tuning-rules.htm). * <p><pre><code> * Search search = new Search(); * SearchTuningRule searchTuningRule = search.addSearchTuningRule( searchTuningRuleIn, responseFields); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param searchTuningRuleIn The details of the new search tuning rule. * @return com.mozu.api.contracts.productadmin.search.SearchTuningRule * @see com.mozu.api.contracts.productadmin.search.SearchTuningRule * @see com.mozu.api.contracts.productadmin.search.SearchTuningRule */ public com.mozu.api.contracts.productadmin.search.SearchTuningRule addSearchTuningRule(com.mozu.api.contracts.productadmin.search.SearchTuningRule searchTuningRuleIn, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SearchTuningRule> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.addSearchTuningRuleClient( searchTuningRuleIn, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Updates the details of the search tuning rule sort fields. * <p><pre><code> * Search search = new Search(); * SearchTuningRuleSortFields searchTuningRuleSortFields = search.updateSearchTuningRuleSortFields( searchTuningRuleSortFieldsIn); * </code></pre></p> * @param searchTuningRuleSortFieldsIn The details of the updated search tuning rule sort fields. * @return com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields * @see com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields * @see com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields */ public com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields updateSearchTuningRuleSortFields(com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields searchTuningRuleSortFieldsIn) throws Exception { return updateSearchTuningRuleSortFields( searchTuningRuleSortFieldsIn, null); } /** * Updates the details of the search tuning rule sort fields. * <p><pre><code> * Search search = new Search(); * SearchTuningRuleSortFields searchTuningRuleSortFields = search.updateSearchTuningRuleSortFields( searchTuningRuleSortFieldsIn, responseFields); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param searchTuningRuleSortFieldsIn The details of the updated search tuning rule sort fields. * @return com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields * @see com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields * @see com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields */ public com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields updateSearchTuningRuleSortFields(com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields searchTuningRuleSortFieldsIn, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.updateSearchTuningRuleSortFieldsClient( searchTuningRuleSortFieldsIn, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Updates a collection of synonym definitions.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinitionCollection synonymDefinitionCollection = search.updateSynonymDefinitionCollection( collection, localeCode); * </code></pre></p> * @param localeCode The two character country code that sets the locale, such as US for United States. Sites, tenants, and catalogs use locale codes for localizing content, such as translated product text per supported country. * @param collection The updated details of the synonym definition collection. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection * @see com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection * @see com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection */ public com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection updateSynonymDefinitionCollection(com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection collection, String localeCode) throws Exception { return updateSynonymDefinitionCollection( collection, localeCode, null); } /** * Updates a collection of synonym definitions.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinitionCollection synonymDefinitionCollection = search.updateSynonymDefinitionCollection( collection, localeCode, responseFields); * </code></pre></p> * @param localeCode The two character country code that sets the locale, such as US for United States. Sites, tenants, and catalogs use locale codes for localizing content, such as translated product text per supported country. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param collection The updated details of the synonym definition collection. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection * @see com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection * @see com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection */ public com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection updateSynonymDefinitionCollection(com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection collection, String localeCode, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SynonymDefinitionCollection> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.updateSynonymDefinitionCollectionClient( collection, localeCode, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Creates a new synonym definition.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinition synonymDefinition = search.addSynonymDefinition( synonymDefinition); * </code></pre></p> * @param synonymDefinition The details of the new synonym definition. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinition * @see com.mozu.api.contracts.productadmin.search.SynonymDefinition * @see com.mozu.api.contracts.productadmin.search.SynonymDefinition */ public com.mozu.api.contracts.productadmin.search.SynonymDefinition addSynonymDefinition(com.mozu.api.contracts.productadmin.search.SynonymDefinition synonymDefinition) throws Exception { return addSynonymDefinition( synonymDefinition, null); } /** * Creates a new synonym definition.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinition synonymDefinition = search.addSynonymDefinition( synonymDefinition, responseFields); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param synonymDefinition The details of the new synonym definition. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinition * @see com.mozu.api.contracts.productadmin.search.SynonymDefinition * @see com.mozu.api.contracts.productadmin.search.SynonymDefinition */ public com.mozu.api.contracts.productadmin.search.SynonymDefinition addSynonymDefinition(com.mozu.api.contracts.productadmin.search.SynonymDefinition synonymDefinition, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SynonymDefinition> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.addSynonymDefinitionClient( synonymDefinition, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Updates the details of the specified search tuning rule. * <p><pre><code> * Search search = new Search(); * SearchTuningRule searchTuningRule = search.updateSearchTuningRule( searchTuningRuleIn, searchTuningRuleCode); * </code></pre></p> * @param searchTuningRuleCode The unique identifier of the search tuning rule. * @param searchTuningRuleIn The details of the updated search tuning rule. * @return com.mozu.api.contracts.productadmin.search.SearchTuningRule * @see com.mozu.api.contracts.productadmin.search.SearchTuningRule * @see com.mozu.api.contracts.productadmin.search.SearchTuningRule */ public com.mozu.api.contracts.productadmin.search.SearchTuningRule updateSearchTuningRule(com.mozu.api.contracts.productadmin.search.SearchTuningRule searchTuningRuleIn, String searchTuningRuleCode) throws Exception { return updateSearchTuningRule( searchTuningRuleIn, searchTuningRuleCode, null); } /** * Updates the details of the specified search tuning rule. * <p><pre><code> * Search search = new Search(); * SearchTuningRule searchTuningRule = search.updateSearchTuningRule( searchTuningRuleIn, searchTuningRuleCode, responseFields); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param searchTuningRuleCode The unique identifier of the search tuning rule. * @param searchTuningRuleIn The details of the updated search tuning rule. * @return com.mozu.api.contracts.productadmin.search.SearchTuningRule * @see com.mozu.api.contracts.productadmin.search.SearchTuningRule * @see com.mozu.api.contracts.productadmin.search.SearchTuningRule */ public com.mozu.api.contracts.productadmin.search.SearchTuningRule updateSearchTuningRule(com.mozu.api.contracts.productadmin.search.SearchTuningRule searchTuningRuleIn, String searchTuningRuleCode, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SearchTuningRule> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.updateSearchTuningRuleClient( searchTuningRuleIn, searchTuningRuleCode, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Updates the search setting properties for a specific site.Refer to [Search Settings API Overview](../../../../developer/api-guides/search-settings.htm) for more information about 's search settings. * <p><pre><code> * Search search = new Search(); * SearchSettings searchSettings = search.updateSettings( settings); * </code></pre></p> * @param settings The search settings to update. * @return com.mozu.api.contracts.productadmin.SearchSettings * @see com.mozu.api.contracts.productadmin.SearchSettings * @see com.mozu.api.contracts.productadmin.SearchSettings */ public com.mozu.api.contracts.productadmin.SearchSettings updateSettings(com.mozu.api.contracts.productadmin.SearchSettings settings) throws Exception { return updateSettings( settings, null); } /** * Updates the search setting properties for a specific site.Refer to [Search Settings API Overview](../../../../developer/api-guides/search-settings.htm) for more information about 's search settings. * <p><pre><code> * Search search = new Search(); * SearchSettings searchSettings = search.updateSettings( settings, responseFields); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param settings The search settings to update. * @return com.mozu.api.contracts.productadmin.SearchSettings * @see com.mozu.api.contracts.productadmin.SearchSettings * @see com.mozu.api.contracts.productadmin.SearchSettings */ public com.mozu.api.contracts.productadmin.SearchSettings updateSettings(com.mozu.api.contracts.productadmin.SearchSettings settings, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.SearchSettings> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.updateSettingsClient( settings, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Updates the details of a synonym definition.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinition synonymDefinition = search.updateSynonymDefinition( synonymDefinition, synonymId); * </code></pre></p> * @param synonymId The unique identifier of the synonym definition. * @param synonymDefinition The updated synonym definition details. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinition * @see com.mozu.api.contracts.productadmin.search.SynonymDefinition * @see com.mozu.api.contracts.productadmin.search.SynonymDefinition */ public com.mozu.api.contracts.productadmin.search.SynonymDefinition updateSynonymDefinition(com.mozu.api.contracts.productadmin.search.SynonymDefinition synonymDefinition, Integer synonymId) throws Exception { return updateSynonymDefinition( synonymDefinition, synonymId, null); } /** * Updates the details of a synonym definition.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * SynonymDefinition synonymDefinition = search.updateSynonymDefinition( synonymDefinition, synonymId, responseFields); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param synonymId The unique identifier of the synonym definition. * @param synonymDefinition The updated synonym definition details. * @return com.mozu.api.contracts.productadmin.search.SynonymDefinition * @see com.mozu.api.contracts.productadmin.search.SynonymDefinition * @see com.mozu.api.contracts.productadmin.search.SynonymDefinition */ public com.mozu.api.contracts.productadmin.search.SynonymDefinition updateSynonymDefinition(com.mozu.api.contracts.productadmin.search.SynonymDefinition synonymDefinition, Integer synonymId, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SynonymDefinition> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.updateSynonymDefinitionClient( synonymDefinition, synonymId, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Deletes the specified search tuning rule from the site. * <p><pre><code> * Search search = new Search(); * search.deleteSearchTuningRule( searchTuningRuleCode); * </code></pre></p> * @param searchTuningRuleCode The unique identifier of the search tuning rule. * @return */ public void deleteSearchTuningRule(String searchTuningRuleCode) throws Exception { MozuClient client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.deleteSearchTuningRuleClient( searchTuningRuleCode); client.setContext(_apiContext); client.executeRequest(); client.cleanupHttpConnection(); } /** * Deletes the specified synonym definition.Refer to [Search Synonyms](../../../../developer/api-guides/search-settings.htm#search_synonyms) for more information about search synonyms. * <p><pre><code> * Search search = new Search(); * search.deleteSynonymDefinition( synonymId); * </code></pre></p> * @param synonymId The unique identifier of the synonym definition. * @return */ public void deleteSynonymDefinition(Integer synonymId) throws Exception { MozuClient client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.deleteSynonymDefinitionClient( synonymId); client.setContext(_apiContext); client.executeRequest(); client.cleanupHttpConnection(); } }