Deleting records

The Data Ingest Web Service allows you to delete records from a running data domain.

The deleteRecords operation of ingestChanges allows you to create a request to delete a record. The request must specify the EQL expression that correctly identifies one or more records to be deleted, using this request format:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:ns="http://www.endeca.com/MDEX/ingest/2/0" 
  xmlns:ns1="http://www.endeca.com/MDEX/XQuery/2009/09">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:ingestChanges>
        <ns:deleteRecords>
            <ns:recordSpecifier>?</ns:recordSpecifier>
         </ns:deleteRecords>
       </ns:ingestChanges>
   </soapenv:Body>
</soapenv:Envelope>

Multiple records can be deleted in the same request. A records deletion operation cannot be combined in the same request with any operation that would try to modify the records to be deleted.

If you submit the ingestChanges request after a Transaction Web Service request that starts an outer transaction, the request must specify the outer transaction ID. If no outer transactions have been started, the ID attribute must be omitted in the request.

To delete a record from the data domain:

  1. Make certain that both the data domain's Dgraph process and the Data Ingest service are running.
  2. Create a deleteRecords request, similar to the example below that deletes one record, and send the request to the Data Ingest service.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:ns="http://www.endeca.com/MDEX/ingest/2/0" 
    xmlns:ns1="http://www.endeca.com/MDEX/XQuery/2009/09">
       <soapenv:Header/>
       <soapenv:Body>
          <ns:ingestChanges>
            <ns:deleteRecords>
                <ns:recordSpecifier>"partID" = 'P123'</ns:recordSpecifier>
               </ns:deleteRecords>
           </ns:ingestChanges>
       </soapenv:Body>
    </soapenv:Envelope>
  3. After the request is made, check the ingestChangesResponse to determine if the request transaction was successful.
A successful ingestChangesResponse returned from the above sample request should look like this:
<ingest:ingestChangesResponse 
    xmlns:ingest="http://www.endeca.com/MDEX/ingest/2/0">
   <ingest:numPropertiesCreated>0</ingest:numPropertiesCreated>
   <ingest:numRecordsAffected>0</ingest:numRecordsAffected>
   <ingest:numRecordsDeleted>1</ingest:numRecordsDeleted>
</ingest:ingestChangesResponse>
Note that when specifying a record with an invalid or missing primary key, the deleteRecords sub-operation will not fail, but instead will ignore the record. In this case, the numRecordsDeleted element in the response will have a value of 0 (zero):
<ingest:ingestChangesResponse ...>
   ...
   <ingest:numRecordsDeleted>0</ingest:numRecordsDeleted>
</ingest:ingestChangesResponse>