Record boost/bury queries

Record queries can use the stratify relevance ranking module for boosting or burying records.

The stratify relevance ranking module can be specified in record search options, via the Ntx URL query parameter or the ERecSearch class.

Using the Ntx URL parameter

For record searches, the format for using the Ntx URL parameter with the rel option to specify the stratify relevance ranking module is:
Ntx=rel+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.
This example uses an EQL property value query with the and operator:
N=0&Ntx=mode+matchall+rel+stratify(collection()/record[P_Region="Tuscany" and P_Score>98],*)
&Ntk=P_WineType&Ntt=red

The results will boost red wine records that are from Tuscany and have a rating score of 98 or greater. These records are placed in the highest stratum and all other records are placed in the unmatched stratum.

Using the ERecSearch class

You can use the three-argument version of the ERecSearch constructor to create a record search query. The third argument can specify the use of the stratify module. The ERecSearch class is available in both the Java and .NET versions of the Presentation API.

The following example illustrates how to construct such a query using Java:
// Create query
ENEQuery usq = new UrlENEQuery(request.getQueryString(), "UTF-8");

// Create a record search query for red wines in the P_WineType property
// and boost records from the Tuscany region
String key = "P_WineType";
String term = "red";
String opt = "Ntx=rel+stratify(collection()/record[P_Region="Tuscany"],*)";
// Use the 3-argument version of the ERecSearch constructor
ERecSearch eSearch = new ERecSearch(key, term, opt);
// Add the search to the ENEQuery
ERecSearchList eList = new ERecSearchList();

eList.add(0, eSearch);
usq.setNavERecSearches(eList);
...
// Make ENE request
ENEQueryResults qr = nec.query(usq);