Creating the query with UrlENEQuery

You use the UrlENEQuery class to parse MDEX Engine-specific parameters from the browser request query string into MDEX Engine query parameters.

The code to accomplish this task looks like the following:

The UrlENEQuery class ignores non-MDEX Engine-specific parameters, so this class is still safe to use when additional application-specific parameters are needed (as long as they don’t conflict with the MDEX Engine URL parameter namespace).

Creating an empty ENEQuery object and populating it

Alternatively, you can use the ENEQuery class to instantiate an empty ENEQuery object, and then populate it with MDEX Engine query parameters using a variety of setter methods in Java, or ENEQuery properties in .NET.

The code to accomplish this task is similar to the example below:
  • Java:
    //Create an empty ENEQuery object and populate it using setter methods
    ENEQuery nequery = new ENEQuery();
    nequery.setNavDescriptors(dimensionValueIDs);
    nequery.setERec(recordID);
    ...
  • .NET:
    //Create an empty ENEQuery object and populate it using properties
    ENEQuery nequery = new ENEQuery();
    nequery.NavDescriptors = dimensionValueIDs
    nequery.ERec = recordID
    ...

Creating MDEX Engine queries from state information

You can use the ENEQuery class to construct a query from any source of state information, including non-Endeca URL parameters, cookies, server-side session objects, and so forth. These are all application design decisions and have no impact on the final MDEX Engine query or its results.

The following are all valid ways of creating an MDEX Engine query: