beautypg.com

How sorting works, Details – Google Search Appliance Protocol Reference User Manual

Page 38

background image

Google Search Appliance: Search Protocol Reference

Request Format

38

How much metadata exists for each document

The sorting options specified

The value used to sort each document is available in the XML output in the FS tag.

How Sorting Works

When a search request is submitted with the sorting parameter specified as described in the following
sections, the Google Search Appliance retrieves the value corresponding to the given meta tag name for
each search result. In some instances, as described below, some processing of the value will occur.
These values will then be sorted according to the specific parameter specified. If two documents have
the same value, they will be ordered according to their original relevance.

Multivalued metadata—If you have specified certain meta tags as multivalued in Index > Index
Settings, then only the first value in those tags is used for sorting.

Multiple meta tags with the given name—If a document has multiple meta tags with the given name,
all of which have the exact same value, then that value will be used for sorting. If the multiple meta
tags have different values, then none will be used and the document will behave as if it has no meta
tag with the given name.

No meta tag with the given name for a document—If a document does not contain a meta tag with the
given name, then it will be placed after documents that do have meta tags with the given name. All
of these documents without such meta tag will be ordered by their original relevancy ranks.

Date—If a meta tag has been specified as a date in Index > Index Settings, then the value will be
normalized into a YYYY-MM-DD format before being sorted.

Details

To sort results by metadata, include the sort parameter in the search request, formatted as follows:

meta::::::

All values after the name are optional and can be left blank. For instance, if you want to specify only the
name and the language, you could use the following format:

meta::::
meta::::::

The following tables show the possible values for the options.

Value

Description

any string

The name of the meta tag that should be used to sort by. This string must be
double-URL-encoded.

Value

Description

A

Sort results in ascending order. Default.

D

Sort results in descending order.