Enqueues raw XML for processing by the crawler. The SOAP name of this function is: SearchCollectionEnqueueXml
Synopsis
crawler-service-enqueue-response nodeset search-collection-enqueue-xml(collection, subcollection, crawl-nodes, exception-on-failure, crawl-type, ensure-running);
nmtoken collection;
enum subcollection;
crawl-urls nodeset crawl-nodes;
boolean exception-on-failure;
enum crawl-type;
boolean ensure-running;
Parameters
- nmtoken collection - The name of the collection to which you will enqueue the XML. (Required)
- enum subcollection - The subcollection in which to enqueue. Default value: live. Possible values: live|staging.
- crawler-service-enqueue-response nodeset crawl-nodes - Any combination of crawl-url and crawl-delete. (Required)
- boolean exception-on-failure - If false then the search-collection-enqueue exception will be thrown only for problems related to communicating with the crawler. If true, the exception will be thrown if any URL was not successfully enqueued. Default value: false.
- enum crawl-type - If the crawler needs to be started, what mode to start the crawler in. Using resume-and-idle will cause the crawler to not process any existing data, allowing for a faster response time. Using resume will cause any pending data to be processed before the enqueue, preserving the ordering of pending URLs. Default value: resume-and-idle. Possible values: resume|resume-and-idle.
- boolean ensure-running - If the crawler needs to be started, should we start it?. Default value: true.
Exceptions
- search-collection-invalid-name
- search-collection-service-communication-missing-result
- search-collection-service-communication-terminating
- search-collection-service-communication-not-running
- search-collection-enqueue
- search-collection-enqueue-read-only
- search-collection-enqueue-invalid-node
- search-collection-enqueue-invalid-attr
- search-collection-enqueue-malformed-crawl-url
- search-collection-enqueue-malformed-crawl-delete
- search-collection-enqueue-malformed-index-atomic
- search-collection-enqueue-malformed-crawl-state
- search-collection-enqueue-audit-log-disabled
- search-collection-enqueue-terminating
- search-collection-enqueue-database
Authentication
Like all Watson Explorer Engine API functions with the exception of ping, the search-collection-enqueue-xml 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 search-collection-enqueue-xml 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 search-collection-enqueue-xml function is the following:
Authentication authentication = new Authentication();
authentication.setUsername("joe-user");
authentication.setPassword("joes-password");
SearchCollectionEnqueueXml foo = new SearchCollectionEnqueueXml();
foo.setAuthentication(authentication);
A single authentication object would typically be reused throughout each individual application.