Boost/bury sorting for Endeca records

The record boost and bury feature can used to sort record results for queries.

The Endeca.stratify relevance ranking module can be specified in record search options, via the Ns URL query parameter or the API methods.

Note: When used for sorting, you must prepend the Endeca prefix to the stratify module name.

Using the Ns URL parameter

The format for using the Ns URL parameter with the rel option to specify the stratify relevance ranking module is:
Ns=Endeca.stratify(EQLexpressions)
where EQLexpressions is one or more of the EQL expressions documented in the "Using the Endeca Query Language" in the Advanced Development Guide. Note that you must prepend the Endeca prefix to the module name.
For example, assume you wanted to promote Spanish wines. This N=0 root node query returns all the records, with the Spanish wines boosted into the first stratum (i.e., they are displayed first to the user):
N=0&Ns=Endeca.stratify(collection()/record[P_Region="Spain"],*)
And if you wanted to boost your highly-rated Spanish wines, the query would look like this:
N=0&Ns=Endeca.stratify(collection()/record[P_Region="Spain" and P_Score>90],*)

The query results will boost Spanish wines that have a rating score of 91 or greater. These records are placed in the highest stratum and all other records are placed in the unmatched stratum.

Using API methods

You can use the single-argument version of the ERecSortKey constructor to create a new relevance rank key that specifies the Endeca.stratify module. After adding the ERecSortKey object to an ERecSortKeyList, you can set it in the query with the Java ENEQuery.setNavActiveSortKeys() and the .NET ENEQuery.SetNavActiveSortKeys methods in the Presentation API.

The following Java sample code shows now to use these methods:
String stratKey = "Endeca.stratify(collection()/record[P_Region="Spain"],*)";
ERecSortKey stratSort = new ERecSortKey(stratKey);
ERecSortKeyList stratList = new ERecSortKeyList();
stratList.add(0, stratSort);
usq.setNavActiveSortKeys(stratList);