delete_rank_expression ( $domain_name, $rank_name, $opt )

Removes a RankExpression from the search domain.

Access

public

Parameters

Parameter

Type

Required

Description

$domain_name

string

Required

A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed. [Constraints: The value must be between 3 and 28 characters, and must match the following regular expression pattern: [a-z][a-z0-9-]+]

$rank_name

string

Required

The name of the RankExpression to delete. [Constraints: The value must be between 1 and 64 characters, and must match the following regular expression pattern: [a-z][a-z0-9_]*]

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Create and delete a rank expression.

// Instantiate the class
$search = new AmazonCloudSearch();

$domain_name = 'my-domain';
$rank_expression = 'test_expression';

/*%**************************************************************%*/
// Create a new CloudSearch domain

echo '# Creating a new CloudSearch domain' . PHP_EOL;
$response = $search->create_domain($domain_name);

// Check for success...
if ($response->isOK())
{
	echo 'Kicked off the creation of the CloudSearch domain...' . PHP_EOL;
}
else
{
	print_r($response);
}

echo PHP_EOL;

/*%**************************************************************%*/
// Define rank expressions

echo '# Defining a new CloudSearch rank expression' . PHP_EOL;
$response = $search->define_rank_expression($domain_name, array(
	'RankName' => $rank_expression,
	'RankExpression' => '(0.7*text_relevance)',
));

// Check for success...
if ($response->isOK())
{
	echo 'Defined a rank expression...' . PHP_EOL;
}
else
{
	print_r($response);
}

echo PHP_EOL;

/*%**************************************************************%*/
// Describe rank expressions

echo "# Describing the CloudSearch rank expressions, \"${domain_name}\"" . PHP_EOL;
$response = $search->describe_rank_expressions($domain_name);

print_r($response->body->RankName()->map_string());

echo PHP_EOL;

/*%**************************************************************%*/
// Delete rank expressions

echo '# Deleting the CloudSearch rank expression...' . PHP_EOL;
$response = $search->delete_rank_expression($domain_name, $rank_expression);

// Check for success...
if ($response->isOK())
{
	echo 'CloudSearch rank expression was deleted successfully.' . PHP_EOL;
}
else
{
	print_r($response);
}

echo PHP_EOL;

/*%**************************************************************%*/
// Delete the CloudSearch domain

echo '# Deleting the CloudSearch domain...' . PHP_EOL;
$response = $search->delete_domain($domain_name);

// Check for success...
if ($response->isOK())
{
	echo 'CloudSearch domain was deleted successfully.' . PHP_EOL;
}
else
{
	print_r($response);
}

Source

Method defined in services/cloudsearch.class.php | Toggle source view (8 lines) | View on GitHub

public function delete_rank_expression($domain_name, $rank_name, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['DomainName'] = $domain_name;
    $opt['RankName'] = $rank_name;
    
    return $this->authenticate('DeleteRankExpression', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback