Change Result Sorting (Display Order)
By default, the Content component lists query results in order of relevance. To weight and rank the documents it returns by statistical relevance, Content uses complex algorithms that use a combination of information theory and Bayesian methods. It makes use of information theoretic values calculated dynamically for all concepts on indexing, which allows it to evaluate relevance both as a percentage, and in the case of agents, as absolute values.
In practice, the relevance acts as a measure of the conceptual overlap between the query text and the text in a document. You can affect the relevance in several ways. You can apply extra weight to certain fields by associating a weighting factor with them at indexing time. For example, you can give extra weight when query terms appear in the document title as opposed to the body of the text.
You can change the order in which Content returns query results by adding the Sort parameter to your Query, Suggest, SuggestOnText, GetTagValues, or GetQueryTagValues action.
Sort Options for Query, Suggest, and SuggestOnText
For a full list of sort options for the Query, Suggest, and SuggestOnText actions, see the Sort parameter.
You can sort results by several criteria, by adding multiple sort options, separated by plus symbols (+):
sortOption1+sortOption2+...
Examples:
http://MyHost:20000/action=Query&Text=presidential elections&Sort=Date
In this example, Content displays results in order of the document date.
http://MyHost:20000/action=Query&Text=presidential elections&Sort=DRETITLE:reversealphabetical
In this example, Content displays results in reverse alphabetical order by their DRETITLE
.
http://MyHost:20000/action=Query&Text=presidential elections&Sort=Relevance+DRETITLE:alphabetical+Date
In this example, results order by Relevance
, then by their DRETITLE
, and then by their Date
.
Sort for GetTagValues and GetQueryTagValues
For a full list of sort options for the GetTagValues and GetQueryTagValues actions, see the Sort parameter.
For example:
http://MyHost:20000/action=GetQueryTagValues&FieldName=GRAPE,COUNTRY &Text=A smooth red wine that complements game&Sort=Alphabetical
In this example, Content displays results in alphabetical order.
TIP: The GetQueryTagValues action also has a QuerySort parameter, which determines how it sorts the results of the associated query when it retrieves values.
For example, if you set MaxResults in GetQueryTagValues, the action retrieves parametric values from the first N
results, according to the result sorting method. You can use QuerySort to specify how to sort these results. The options for QuerySort are the same as for the Query action Sort parameter (see Sort Options for Query, Suggest, and SuggestOnText).