Show Menu
TOPICS×

About Ranking Rules

You can use Ranking Rules to control the relative positioning or ranking of a customer's search results based on contained meta tag content and related Adobe Analytics metrics.

Using Ranking Rules

You define ranking rules to affect the relative placement of the documents within your search results, based on the contents of each document. You can base ranking rules either on meta tag content, Adobe Analytics metrics (if your account is configured to work with Adobe Analytics), or Adobe Analytics HBX metrics (if your account is configured to work with Adobe Analytics HBX).
You can set web pages that contain meta tags with desired characteristics, such as a certain brand name or price, or web pages that have desirable Adobe Analytics key performance indicators, such as unique viewers, to receive a higher ranking than web pages that do not. The "desirable" characteristics are easily updated by adding or editing Ranking Rules and then re-indexing your website.
If you have more than one meta tag of type "rank" defined, you can create separate collections of rules to use in calculating the various rank fields. You can add a ranking rule group, which you can then assign to one of your defined Rank fields. Rule groups normally contain one or more rule definitions, but can also refer to other Rule groups, so you can create one or more groups of commonly used rules that are shared during the calculation of your multiple ranks.
A positive rank value promotes search results towards the top; a negative rank value demotes search results towards the bottom of the search results. The normal range for ranking values is 1.0 which is the maximum promotion within the search results, while -1.0 is the maximum demotion. While you can customize this range by editing the Rank field in metadata definitions, this type of customization is usually unnecessary.
If you have defined more than one rank field under Settings > Metadata > Definitions, you have the option to create additional sets of ranking rules, one for each rank field. You can defined additional sets of ranking rules without being directly associated with a rank field. This flexibility lets you create sets of common Rules that can be shared in the calculation of one or more rank value.
Important : Before you can use Ranking Rules, there are several account configuration steps that you must complete.

Configuring ranking

Before you can use ranking rules, there are several account configuration steps that you must complete.
To configure ranking
  1. Choose from the following:
    Task
    Configuration
    To create ranking rules that are based on meta tags
    1. On the product menu, click Settings > Metadata > Definitions .
    2. On the Definitions page, click Add New Field .
    3. On the Add Field page, in the Field Name text field, type rank ; in the Meta Tag Name text field, type rank ; in the Data Type drop-down list, select Rank . Leave all other field options as-is.
      See the query parameter sp_sr in Backend search CGI parameters .
    4. Click Add .
    To create ranking rules that are based on Adobe Analytics metrics
    1. Make sure you have set up Adobe Analytics authentication from within site search/merchandising.
    2. Select and add an available report suite.
    3. Configure the list of Adobe Analytics metrics that you want to be available for the creation of new Ranking Rules.
    4. Load the initial Adobe Analytics metrics for your website pages.
  2. Add one or more Ranking Rules.
  3. Click regenerate your staged site index to perform a full-reindex of your website (from Index > Full Index ).
  4. Check the values in the Rank column in Settings > Metadata > Definitions to verify that your Ranking Rules were applied correctly.

About ranking documents by age

You can rank an HTML document by its age with an exponential decay function. The rate of decay is specified with a chosen half-life constant, the amount of time that must pass before the value drops to one half of its initial value.
Age ranking is based on the following two equations:
K = -ln(2) / H
RANK = e^(K * T)
Variables H and T are inputs to this function: H is the desired half-life period and T is the document's age, expressed in seconds. K is the calculated half-life, and RANK is the exponential decay of the specified age value. The resulting value is from 0 through 1. A more recent document has a rank value closer to 1 compared to an older document. In theory, documents should never reach the value of 0, but rounding errors can cause a result to become 0.

Requirements for using age ranking

  • Your account should already be configured correctly for ranking. If it is not configured, see Configuring ranking .
  • The HTML document must have an HTML meta tag field that represents its birth date, or inception as a time stamp, or some other meaningful date value.
  • The special built-in function, search_get_age_rank() , as specified in the Add or Edit Ranking Rule pages, is used to calculate a document's age rank. The next sections describe in detail the general use of the age-ranking function. An example is also presented that demonstrates the age-ranking feature.

Using search_get_age_rank () on the Add Ranking Rule page or the Edit Ranking Rule page

Specify search_get_age_rank() as follows:
search_get_age_rank(Birthdate#Half_Life#Default_Rank)
  • Birthdate - The birth date or inception date of the file must be a date formatted string in accordance to the field's date formats. This date formatted string must be a field reference, as in {field_name} .
  • Half_Life - The half life is the amount of time that must pass before the value drops to one half of its initial value. This value is expressed in the number of days and it is an integer or a floating point number.
  • Default_Rank - The default rank is used as a safety net in case the birth date is invalid or the date is in the future. You cannot use this default value if its associated metadata field has a valid default value too. The value here is a floating point number or an integer. See below for suggestions if you run into problems with which default value is being used.
Example
In the following example,
search_get_age_rank({birthdate}#28#0.20)
the date contained in the document's birthdate field is passed in as the time-stamp. The half life is 28 days. The default ranking value is 0.20 if the date is invalid.
See the options table in Adding a ranking rule .
In the Values/Ranks section of the Add Ranking Rule page or the Edit Ranking Rule page, you can only use search_get_age_rank with custom-made rules. Therefore, be sure that you choose Custom from the Values/Ranks drop-down list. When the rule uses the age-ranking function, no spaces are allowed in the values part of the rule. Be sure that there are no spaces in the function arguments or in between them. And, there are no spaces between any mathematical or conditional operators.
The following is an example of a values/ranks rule—a rule associated with a text field:
regexp .* search_get_age_rank({other_field}#365#0.20)
This example assumes that other_field contains a date value. If this field is not itself a date-type field, this value is interpreted using the date formats associated with the pre-defined Date field. Otherwise, this field's date formats are used. This values/ranks entry is used whenever the document's field, that the Rule's Data Source identifies, is non-empty, and the function's return value (from 0 through 1) is the assigned rank.
For a Rule associated with a Numeric field, specifically a Date field:
9999999999 search_get_age_rank({other_field}#365#0.20)
As each document is processed, the value in other_field is converted to the Unix "epoch" form, using the field's date format definitions. This value is used in the search_get_age_rank() call. As every "epoch" value is less than 9999999999 (for now at least), the Rule simply supplies the function's return value (from 0 through 1) as the rank.
In both of the preceding examples, it is typical that the Rule's Data Source is the same field that is used in the search_get_age_rank() function - other_field in this case.

An example of integrating age ranking into ranking rules

The following is an example of how you can integrate age ranking into ranking rules. The example also shows you the raw results from the age-ranking function and the results from the ranking rules. The example assumes the following:
  • The web pages that are crawled have HTML meta tag named "birthdate". The content of this tag is a time-stamp related to the document.
  • The metadata definitions have a defined metatag field for the birthdate tag. This field is set to type "date."
Ranking rules
Now you add a new ranking rule. The rule is defined to use the "birthdate" field on the document. A new ranking rule is added with the following properties set:
  • Data Source Type: Meta Tag
  • Data Source Name: birthdate
  • Weights/Conditions: 10 - Maximum Importance
  • Values/Ranks: 9999999999 search_get_age_rank(#14#0.10)
  • Default Rank: -1
The rule does several things. The weight of the rule is set to 10. The rank value is simply the result of the age-rank function, a value from 0 through 1. You cannot use spaces with search_get_age_rank() . Also, notice that the field "birthdate" is enclosed in braces. Finally, when you save this rule, the commas in the Values/Ranks definition are replaced with # characters; this behavior is normal.
Viewing the results
Use the Data View feature to quickly see the results of the age-rank function. Add the appropriate Metadata fields. In the example, age_val and myrank are the two Metadata fields that should be added to the Data View. The myrank field shows how age ranking affects the ranking values. The age_val field shows the raw output of the exponential-decay function for that document.

Default values

The following are three default values involved with the function search_get_age_rank() :
  • The default value that you can enter into the search_get_age_rank() function itself.
  • The default rank value from the Ranking rule.
  • The default value from the Metadata definition.
Depending on where the failure occurs, you may get different default values.
For example, the default value from the Metadata definition should never happen if Ranking and Filtering is properly implemented. This default value is the last resort value when no valid or known content for that Metadata field exists. The default value from the ranking rules may appear when search_get_age_rank() is referencing its own associated tag and the tag is missing in the document. In this case, this rule goes straight to the rule's default value. If the age-ranking function references another ranking rule's tag, it is possible that the default value passed into that age-ranking function is used if the referenced tag is missing or invalid.

Adding a ranking rule

You can add Ranking Rules to affect the relative placement of the web pages within your Search results, based on the contents of each web page.
To add a ranking rule
  1. On the product menu, click Rules > Ranking Rules > Edit Rules .
  2. (Optional) If you have created a rules group and added rules to the group, on the Define Ranking Rules page, in the Select Rule Group drop-down list, select a rule group that contains the rules you want to edit.
  3. On the Define Ranking Rules page, click Add Rule to add a new Ranking Rule, or to add a reference to a Rule set.
  4. On the Add Ranking Rule page, set the options you want. Fields that are marked with an asterisk (*) are required.
    The Data Source Type that you select affects the choices that are available on the Data Source Name drop-down list. For example, if you selected Meta Tag as the Data Source Type, the Data Source Name refers to the name of a meta tag on your website pages. If you selected Adobe Analytics Metric (Number) , the Data Source Name refers to one of the Adobe Analytics metric names that you selected in a Report Suite as found on the Edit Adobe Analytics Metrics page in site search/merchandising.
    Option
    Description
    Data Source Type
    Determines the characteristics of the data source that is used as the input to this ranking rule.
    Data source types that you can select from include the following:
    • Meta Tag
      Bases this rule on numeric data or textual data that is stored within a named meta tag on your website pages.
    • Adobe Analytics Metric (Number)
      Bases this rule on a numeric Adobe Analytics metric that is associated with your site pages.
    Data Source Name
    If you chose Meta Tag as the Data Source Type, this is the name of a meta tag that is found within the pages of your website. The names in the drop-down menu come from the list of defined metadata values that were configured in Settings > Metadata > Definitions.
    If you chose Adobe Analytics Metric (Number) as the Data Source Type, this is the name of a Adobe Analytics metric. The names in the drop-down menu, come from the list defined available Adobe Analytics metrics that were configured in Settings > Adobe Analytics > Metrics > Edit.
    If the Adobe Analytics metric name that you selected is not already defined in Settings > Metadata > Definitions , a text field and an Add button are displayed. Enter the name of the Metadata Field Name (the metadata field name cannot exceed 20 characters), and then click Add .
    When pages are encountered with multiple Adobe Analytics keys, as with a product page displaying multiple products, Composite Scheme specifies how to deal with the multiple Adobe Analytics metric values associated with that page. Select one of the following:
    • Sum
      Returns the sum of the metric values.
    • Average
      Returns the average of the values (the sum divided by the number of values).
    • Maximum
      Returns the largest of the values.
    • First
      Returns the value corresponding to the first key.
    • Last
      Return the value corresponding to the last key.
    Weights/Conditions
    Contains either a simple, single rule weight number, or a paired list of rules weight numbers and test conditions.
    A rule weight number is a value from 1-10 that indicates how important this ranking rule is relative to the other ranking rules in determining the overall rank of a document. A higher rule weight indicates higher importance. A weight of zero (0) ignores the rule.
    Choose Custom from the drop-down list to customize the rule weight for various pages by defining a list of rule weight/test conditions pairs. Test conditions are fragments of Perl that are used to test Data Source Values, or global variables that are defined within your custom filter script (for example, price, brand, season, or page views as in the following example). If a test condition evaluates to "true," the associated rule weight value is applied. If a test condition evaluates to "false,", the next condition in the list is evaluated. 0 ({price} > 50.00) && ({brand}=~/Kuhl/)5 {season} =~ /Fall/10 {pageviews} > 1000005 In the custom created weight/condition example above, the rule weight 0 is applied if the first test condition evaluates to "true." That is, the price contains a value greater than 50 and the brand contains "Kuhl"). If the first test condition evaluates to "false," the next condition is evaluated. If none of the previous conditions are met, the rule weight 5 is assigned.
    You should always provide a rule weight with no condition at the end of the list. If you do not do this, the rule gets a weight of 0 in the case where none of the condition tests evaluate to "true."
    Values/Ranks
    Consists of either one of the built-in ranking functions, or possible Data Source content along with desired ranks.
    If you chose Adobe Analytics Metric (Number) as the Data Source Type, you are presented with a drop-down list with the following options:
    • Auto-Rank by Order (default)
      Calculates a rank that is based on the document's relative position, according to its Adobe Analytics Metric. For example, the closer the document's position to the top-ranked document, the higher its rank.
    • Auto-Rank by Value
      Calculates a rank based on the document's relative value, according to its Adobe Analytics Metric. For example, the closer the document's value to the top-ranked document's value, the higher its rank.
    • Custom
      Specifies custom settings. For example, a Data Source with the name of "brand" might contain the brand name for a particular product. You can specify the relative importance of each brand by listing it along with its rank.
    The rank values returned from the Auto-Rank calculations are in the range 0.0 (lowest) to 1.0 (highest). They are not adjusted according to the ranges that are defined for the Rank field under Settings > Metadata > Definitions.
    In the following example, if the brand Data Source for a particular search result exactly matches "DKNY," the applied rank for that result is 0.5. Otherwise, if the brand is "Levis," the applied rank is 0.1. The Data Source content must match the set value. In other words, If the Data Source content is "Levis Corp.", it will not match the value "Levis". Case is ignored, so "DKNY" matches "dkny" and "Dkny". DKNY 0.5 Levis 0.1 Lee 0.2
    As a more advanced option, you can specify values as regular expressions. For example, suppose some of your site pages contain a brand value of "Levis" and other site pages contain a brand value of "Levis jeans." You can use a regular expression specified with the keyword regexp .
    In the following example, a search result document containing brand content "Levis jeans" is assigned a rank of 0.1. As with standard comparison, case is ignored for regular expressions. DKNY 0.5 regexp Levis.* 0.1 Lee 0.2
    Default Rank
    Specifies the rank to apply for search result documents that do not match any of the specified values. In the above example, a search results document with a "brand" Data Source containing "the gap" is assigned the default rank value because "the gap" does not match any of the defined values.
    Notes
    Add information that pertains to the ranking rule definition or the rule group definition that you created.
    The range of valid rank values is normally -1.0 to 1.0 as in the following:
    • -1.0 is "Minimum Rank (display lower in the search results)."
    • 0.0 is "Neutral rank (do not change search results order)."
    • 1.0 is "Maximum rank (display higher in the search results."
    Defined ranks should be within the same range for every rule. The rank ranges must also match the ranges that are defined for the Rank field under Settings > Metadata > Definitions .
  5. Click Add .
  6. To preview the results of the rule addition, click regenerate your staged site index to rebuild your staged website index.
  7. (Optional) Do one of the following:

Editing a ranking rule

You can edit an existing ranking rule that you have already added.
To edit a ranking rule
  1. On the product menu, click Rules > Ranking Rules > Edit Rules .
  2. (Optional) If you have created a rules group and added any rules to the group, on the Define Ranking Rules page, in the Select Rule Group drop-down list, select a rule group that contains the rules you want to edit.
  3. In the table, under the Actions column header, click Edit for the data source name you want to change.
  4. On the Edit Ranking Rule page, set the options that you want. Fields that are marked with an asterisk (*) are required.
    See the table of options under Adding a ranking rule .
  5. Click Save Changes .
  6. Rebuild your staged website index to preview the results of the rule edit.
  7. (Optional) Do one of the following:

Deleting a ranking rule

You can delete ranking rules that you no longer need to use.
To delete a ranking rule
  1. On the product menu, click Rules > Ranking Rules > Edit Rules .
  2. (Optional) If you have created a rules group and added any rules to the group, on the Define Ranking Rules page, in the Select Rule Group drop-down list, select a rule group that contains rules that you want to delete.
  3. In the table, under the Actions column header, click Delete for the data source name you want to change.
  4. On the Delete Ranking Rule page, click Delete .
    You are returned to the Define Ranking Rules page.
  5. Rebuild your staged website index to preview the results of the rule deletion.
  6. (Optional) Do one of the following:

Adding a ranking rule group

If you have defined more than one meta tag of type "rank", you can create separate collections of rules to use in calculating the various rank fields. You can add a ranking rule group, which you can then assign to one of your defined Rank fields.
Rule groups usually contain one or more rules that you have added. However, Rule groups can also refer to other Rule groups. For example, you can create one or more rules groups and then add commonly used rules to each one. Those rules are then shared during the calculation of your multiple ranks.
To add a ranking rule group
  1. On the product menu, click Rules > Ranking Rules > Edit Rules .
  2. On the Define Ranking Rules page, to the right of the Select Rule Group drop-down list, click Add .
  3. On the Add Ranking Rule Group page, in the Rule Group Name field, type a unique name for the new rule group.
  4. In the Rank Field Name drop-down list, select a rank metadata field name that you want to associate with the new rule group. Select None if you do not want to assign a rank.
    The list of rank field names comes from metadata definitions that were added in Settings > Metadata > Definitions .
    See the table of options in Adding a new meta tag field .
  5. Click Add .
  6. Rebuild your staged website index to preview the results of the rule addition.
  7. (Optional) Do one of the following:

Editing a ranking rule group

You can edit the settings of an existing ranking rule group.
To edit a ranking rule group
  1. On the product menu, click Rules > Ranking Rules > Edit Rules .
  2. On the Define Ranking Rules page, to the right of the Select Rule Group drop-down list, click Edit .
  3. On the Edit Ranking Rule Group page, in the Rule Group Name field, type a unique name for the rule group.
  4. In the Rank Field Name drop-down list, select a rank metadata field name that you want to associate with the rule group. Select None if you do not want to assign a rank.
    The list of rank field names comes from metadata definitions that were added in Settings > Metadata > Definitions .
    See the table of options in Adding a new meta tag field .
  5. Click Save Changes .
  6. Rebuild your staged website index to preview the results of the rule addition.
  7. (Optional) Do one of the following:

Deleting a ranking rule group

You can delete a Ranking Rule Group that you no longer need or use. When you delete a group, any Rules that were added to the group, are also deleted. You cannot delete the default "Ranking Rules" group.
The contents of any Rule Groups that are contained in the delete group are not deleted; only the references to these groups are removed.
Be sure you reindex your website so that the change is properly reflected in the search results.
To delete a ranking rule group
  1. On the product menu, click Rules > Ranking Rules > Edit Rules .
  2. On the Define Ranking Rules page, in the Select Rule Group drop-down list, select a group that you want to delete.
  3. To the right of the Select Rule Group drop-down list, click Delete .
  4. On the Delete Ranking Rule Group page, click Delete .
  5. Rebuild your staged website index to preview the results of the rule addition.
  6. (Optional) Do one of the following:

Reviewing ranking rule groups

You can use Ranking Rule Groups Overview to see each groups Rank Field name, and associated data source and weighting.
To review ranking rule groups
  1. On the product menu, click Rules > Ranking Rules > Edit Rules .
  2. On the Define Ranking Rules page, to the right of the Select Rule Group drop-down list, click Overview .
  3. On the Ranking Rule Groups Overview page, click Close to return to the Define Ranking Rules page.
  4. (Optional) Do one of the following:

Testing ranking rules

You can provide a suitable URL test the Ranking Rule definitions that you have set up. The metrics used in the calculations are displayed, along with the calculated Rank value.
To test ranking rules
  1. On the product menu, click Rules > Ranking Rules > Edit Rules .
  2. On the Define Ranking Rules page, in the Test URL area, type the URL to a web page that is on your website.
  3. Click Test .
  4. (Optional) Do one of the following:

Adjusting the weight associated with ranking rules

You can change the relative contributions of your individual Ranking Rules, and the contribution of Ranking to the final search results.
When Ranking is not defined, the search results are 100% on the Natural Relevance side of the Rules & Relevance slider bar on the Adjust Ranking Weights page. This balance simply means that the search results are ordered based solely on search terms.
When Ranking is defined, the associated Rank metadata field is assigned a Relevance value, ranging from 1-10. A value of 1 means that the calculated Rank makes up 10% of the search result ordering, and Natural Relevance the remaining 90%.
If you have more than one Rule defined in a Rule group, each Rule's Weight value determines how much that Rule's result contributes to the total calculated Rank. For example, suppose you have a Natural Relevance of 80%, meaning that the associated Rank field's relevance is 2. You also have defined two Rules: one with a weight of 3, and the second with a weight of 7. In such case, the first Rule's contribution to the final result is 6% ((3 / (3+7)) * 20%). The second Rule's contribution to the final result is 14% ((7 / (3+7)) * 20%).
To adjust the weight associated with ranking rules
  1. On the product menu, click Rules > Ranking Rules > Adjust Weights .
  2. On the Adjust Ranking Weights page, in the Select Rule Group drop-down list, select a group whose ranking weights you want to adjust.
  3. Drag the sliders to change the corresponding contribution values.
    The pie chart reflects your changes graphically.
  4. Click Save Changes .
  5. Rebuild your staged website index to preview the results of the rule addition.
  6. (Optional) Do one of the following: