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);
// Make ENE request
ENEQueryResults qr = nec.query(usq);

Copyright © Legal Notices