query-browse

Navigate the results (search and clustering) stored in a temporary file by query-search. The SOAP name of this function is: QueryBrowse

Synopsis

query-results nodeset query-browse(file, 
state, browse-num, browse-start, output-bold-contents, 
output-bold-contents-except, output-bold-class-root, output-bold-cluster-class-root, 
output-query-node, output-display-mode);
string file;
string state;
int browse-num;
int browse-start;
string output-bold-contents;
boolean output-bold-contents-except;
string output-bold-class-root;
string output-bold-cluster-class-root;
boolean output-query-node;
enum output-display-mode;

Parameters

  • string file - Reference to the temporary file that contains the cached results. (Required)
  • string state - A browsing state, as specified in the search output. Default value: root|root.
  • int browse-num - Only this number of results are returned initially. Overwrites whatever is specified in the state.
  • int browse-start - Out of the num results retrieved, only return the ones with rank higher than browse-start (starts at 0). Overwrites whatever is specified in the state.
  • string output-bold-contents - Space separated list of content names to be bolded (or not bolded depending on the value of output-bold-contents-except) with the query words and cluster labels.
  • boolean output-bold-contents-except - If set to true, the list of contents is considered a list of contents not to bold. Default value: false.
  • string output-bold-class-root - If not specified, a standard <b> tag is used for bolding. If specified, a <span> tag is used with a class name using this root concatenated with a number corresponding to each keyword.
  • string output-bold-cluster-class-root - If not specified, a standard <b> tag is used for bolding the cluster labels. If specified, a <span> tag is used with a class name using this root concatenated with a number corresponding to each cluster label.
  • boolean output-query-node - Return the query node that was used to perform the search. This might be different from the query node that was provided as a parameter. Default value: true.
  • enum output-display-mode - Using 'limited' mode returns a subset of the XML data that is returned in 'normal' mode. This subset is optimized for applications using the API to return large data sets. Default value: default. Possible values: default|limited.

Return Value

Exceptions

  • There are no exceptions specific to this function.

Authentication

Like all Watson Explorer Engine API functions except for ping, the query-browse function requires authentication.

When using REST, you can simply pass v.username and v.password as CGI parameters via HTTP or HTTPS to authenticate the REST call to the query-browse function.

When using the SOAP API, you can pass credentials as parameters on an endpoint, or you can leverage the authentication method that is supported by all Watson Explorer Engine functions. Each provides a setAuthentication method that can be passed an authentication object to provide the user name and password under which a function runs. An example of this in Java for a SOAP call to the query-browse function is the following:


    Authentication authentication = new Authentication();
    authentication.setUsername("joe-user");
    authentication.setPassword("joes-password");

    QueryBrowse foo = new QueryBrowse();
    foo.setAuthentication(authentication);

A single authentication object would typically be reused throughout each individual application.