URL query parameters allow you to communicate with the Presentation API from your client browser.
There are two sets of URL query parameters that allow you to specify relevance ranking modules that will order the returned record set:
Note that all of these parameters must be specified together. These sets of URL parameters are described in the following two sections.
This topic describes the use of query parameters with relevance ranking.
The following query parameters affect relevance ranking:
Dk=<0|1> Dx=rel+strategy Ntx=rel+strategy
For the Dx
and Ntx
parameters, the rel
option sets the relevance ranking strategy. For a list of valid module names to use in the strategy, see the "Controlling relevance ranking at the query level" topic.
Relevance ranking for record search operations is automatic. Results are returned in descending order of relevance as long as a relevance ranking strategy is enabled (either in the URL or as the default for the selected search interface) and if the user has not selected an explicit record sort operation in the record search request. If the user has requested an explicit sort ordering, relevance rank ordering for results does not apply.
For dimension search operations, relevance ranking is enabled by the Dk
parameter. The value of this (optional) parameter can be set to zero or one:
The default value if the parameter is omitted is zero (that is, relevance ranking is not enabled).
For both dimension search and record search operations, the relevance ranking strategy used for the current request can be selected using the search option URL parameters (Dx
and Ntx
) as in the following examples:
<application>?D=mark+twain&Dk=1 &Dx=rel+exact,static(rank,descending) <application>?N=0&Ntk=All&Ntt=polo+shirt &Ntx=mode+matchany+rel+MyStrategy
The second example assumes that MyStrategy was defined in Developer Studio, and is specified via the rel option (which sets the relevance ranking option. The example also uses the mode option (which requests "match any word" query matching).
Using URL-defined strategies (as in the first example) can be especially useful during development, when you want to compare the results of multiple strategies quickly. Once you have determined what strategy works best, you can define the strategy in a search interface in Developer Studio.
You can use the following set of parameters to order the records of a record search via a specified relevance ranking strategy.
The parameters are:
Nrk=search-interface Nrt=relrank-terms Nrr=relrank-strategy Nrm=relrank-matchmode
All of these parameters must be specified together. None of the parameters allow the use of a pipe character (|) to specify multiple sets of arguments.
The definition of the parameters is as follows:
Nrk
sets the search interface to use in the navigation query for a record search. Only search interfaces can be specified; Oracle Commerce properties and dimensions cannot be used. Note that the search interface does not need to have a relevance ranking strategy defined in it.Nrt
sets one or more terms that will be used by the relevance ranking module to order the records. For multiple terms, each term is delimited by a plus (+) sign. Note that these relevance ranking terms can be different from the search terms (as set by theNtt
parameter, for example).Nrr
sets the relevance ranking strategy to be used to rank the results of the record search. For a list of valid module names to use in therelrank-strategy
argument, see the "Controlling relevance ranking at the query level" topic.Nrm
sets the relevance ranking match mode to be used to rank the results of the record search. With the exception of MatchBoolean, all of the search mode values listed in "Using Search Modes" are valid for use with theNrm
parameter. Attempting to use MatchBoolean with theNrm
parameter will cause the record search results to be returned without relevance ranking and a warning to be issued to the dgraph log.
All four parameters link to the Java
ENEQuery.setNavRelRankERecRank()
method and the .NET
ENEQuery.NavRelRankERecRank
property. Note that these
parameters have a dependency on the
N
parameter, because a navigation query is being
performed.
Because the
Nrt
parameter lets you specify relevance ranking terms
(and not search terms), you have the freedom to perform a record search based
on one set of terms (for example,
merlot and
2003) and then have the record set ordered by another set of terms
(for example,
pear). This behavior is different from that of the Ntx parameter,
which uses the terms of the
Ntt
parameter to order the record set (in other words,
the same set of search terms are also used to perform relevance ranking).
The following is an example of using these parameters:
<application>?N=0&Ntk=P_Description&Ntt=sonoma &Nrk=All&Nrt=citrus&Nrr=maxfield&Nrm=matchall
In the example, a record search is first performed for the word sonoma
against the P_Description property. Then
Nrk
specifies that the search interface named All be
used.
Nrr
specifies that the Maxfield relevance ranking module
use the word
citrus (specified via Nrt) as the term by which the records are
ordered, using the match mode specified by
Nrm
.
Note
The
Nrk
,
Nrt
,
Nrr
, and
Nrm
parameters take precedence over the
Ntk
,
Ntt
, and
Ntx
parameters. That is, if both sets of parameters
are used in a query, the relevance ranking strategy specified by the
Nrr
parameter will be used to order the records.