query-search

Query one or more sources. Most of the advanced options offered here apply mostly to search collections (and can be specified on a per collection basis as well in the form of their associated sources). If you use the browse mode, search results will be cached into a temporary file and can be browsed using the query-browse function. The SOAP name of this function is: QuerySearch

Synopsis

query-results nodeset query-search(query, query-object, query-condition-object, query-condition-xpath, query-modification-macros, sources, start, syntax-operators, syntax-repository-node, syntax-field-mappings, sort-by, sort-xpaths, sort-score-xpath, sort-num-passages, rank-decay, num, num-over-request, num-per-source, num-max, browse, browse-num, browse-start, browse-clusters-num, term-expand-max-expansions, term-expand-error-when-exceeds-limit, spelling-enabled, spelling-configuration, dict-expand-dictionary, dict-expand-max-expansions, dict-expand-stem-enabled, dict-expand-stem-stemmers, dict-expand-wildcard-enabled, dict-expand-wildcard-min-length, dict-expand-wildcard-segmenter, dict-expand-wildcard-delanguage, dict-expand-regex-enabled, arena, output-contents-mode, output-contents, output-summary, output-score, output-shingles, output-duplicates, output-key, output-cache-references, output-cache-data, output-sort-keys, output-axl, output-bold-contents, output-bold-contents-except, output-bold-class-root, output-query-node, output-display-mode, authorization-rights, authorization-username, authorization-password, collapse-xpath, collapse-num, collapse-binning, collapse-sort-xpaths, binning-state, binning-mode, binning-configuration, force-binning, fetch, fetch-timeout, aggregate, aggregate-max-passes, cluster, cluster-near-duplicates, cluster-kbs, cluster-stemmers, cluster-segmenter, efficient-paging, efficient-paging-n-top-docs-to-cluster, debug, profile, extra-xml);
string query;
operator nodeset query-object;
operator nodeset query-condition-object;
string query-condition-xpath;
string query-modification-macros;
string sources;
int start;
string syntax-operators;
string syntax-repository-node;
field-map nodeset syntax-field-mappings;
string sort-by;
sort nodeset sort-xpaths;
string sort-score-xpath;
int sort-num-passages;
double rank-decay;
int num;
double num-over-request;
int num-per-source;
int num-max;
boolean browse;
int browse-num;
int browse-start;
int browse-clusters-num;
int term-expand-max-expansions;
boolean term-expand-error-when-exceeds-limit;
boolean spelling-enabled;
spelling-correction nodeset spelling-configuration;
string dict-expand-dictionary;
int dict-expand-max-expansions;
boolean dict-expand-stem-enabled;
string dict-expand-stem-stemmers;
boolean dict-expand-wildcard-enabled;
int dict-expand-wildcard-min-length;
string dict-expand-wildcard-segmenter;
boolean dict-expand-wildcard-delanguage;
boolean dict-expand-regex-enabled;
string arena;
enum output-contents-mode;
string output-contents;
boolean output-summary;
boolean output-score;
boolean output-shingles;
boolean output-duplicates;
boolean output-key;
boolean output-cache-references;
boolean output-cache-data;
boolean output-sort-keys;
nodeset output-axl;
string output-bold-contents;
boolean output-bold-contents-except;
string output-bold-class-root;
boolean output-query-node;
enum output-display-mode;
string authorization-rights;
string authorization-username;
string authorization-password;
string collapse-xpath;
int collapse-num;
boolean collapse-binning;
sort nodeset collapse-sort-xpaths;
string binning-state;
enum binning-mode;
binning-setnodeset binning-configuration;
boolean force-binning;
boolean fetch;
int fetch-timeout;
boolean aggregate;
int aggregate-max-passes;
boolean cluster;
double cluster-near-duplicates;
string cluster-kbs;
string cluster-stemmers;
string cluster-segmenter;
boolean efficient-paging;
int efficient-paging-n-top-docs-to-cluster;
boolean debug;
boolean profile;
nodeset extra-xml;

Parameters

Return Value

Exceptions

Authentication

Like all Watson Explorer Engine API functions with the exception of ping, the query-search 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-search 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 username and password under which a function executes. An example of this in Java for a SOAP call to the query-search function is the following:

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

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

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