Enqueueing XML to Collections Managed by the Collection Broker

The following is an example in C# of enqueueing XML data to a search collection that is managed by the Collection Broker:

In C#:

    CollectionBrokerEnqueueXml cbxml = new CollectionBrokerEnqueueXml();
    
    
    cbxml.collection = COLLECTION;
    cbxml.crawlnodes = new CollectionBrokerEnqueueXmlCrawlnodes();
    cbxml.crawlnodes.crawlurls = new crawlurls();
    crawlurl[] cus = new crawlurl[2];
    cbxml.crawlnodes.crawlurls.Items = cus;
    cus[0] = new crawlurl();
    cus[0].url = ENQ_URL;
    
    cus[1] = new crawlurl();
    cus[1].url = MY_CRAWL_URL;
    cus[1].status = crawlurlStatus.complete;
    cus[1].crawldata = new crawldata[3];
    cus[1].crawldata[0] = new crawldata();
    cus[1].crawldata[0].contenttype = "text/html";
    cus[1].crawldata[0].text = "<html><head><title>My HTML page title</title></head><body>My body</body></html>";
    
    cus[1].crawldata[1] = new crawldata();
    cus[1].crawldata[1].contenttype = "application/vxml";
    cus[1].crawldata[1].vxml = new crawldataVxml();
    document[] doc = new document[1];
    cus[1].crawldata[1].vxml.document = doc;
    doc[0] = new document();
    doc[0].content = new content[2];
    doc[0].content[0] = new content();
    doc[0].content[0].name = "field1";
    doc[0].content[0].Value = "My first field";
    doc[0].content[1] = new content();
    doc[0].content[1].name = "field2";
    doc[0].content[1].Value = "My second field";
    
    cus[1].crawldata[2] = new crawldata();
    byte[] binarydata = new byte[4] { 98, 97, 100, 0 };
    cus[1].crawldata[2].base64 = System.Convert.ToBase64String(binarydata);
    cus[1].crawldata[2].contenttype = "text/plain";
    
    
    CollectionBrokerEnqueueXmlResponse cbxmlresp = port.CollectionBrokerEnqueueXml(cbxml);
    collectionbrokerenqueueresponse enqresp = cbxmlresp.collectionbrokerenqueueresponse;
    
    log l = enqresp.log;
    Boolean online = enqresp.online;
    collectionbrokerenqueueresponseStatus status = enqresp.status;
    if (status == collectionbrokerenqueueresponseStatus.error) ;
    if (status == collectionbrokerenqueueresponseStatus.success) ;

If the collection to which you are enqueueing is not loaded into memory when you submit the enqueue request, the request will be intercepted by the Collection Broker and the enqueue will be placed in the offline queue for that collection. By design, this is transparent to the user, so you will not receive any feedback or information indicating that this has occurred.

When enqueueing to a collection that is managed by the Collection Broker, you may always want to enqueue with an enqueue-type of re-enqueued to avoid delays associated with duplicate checking, URL limit checking, and expiration options that are traditionally performed when processing an enqueue.