Initial loading of records

The use case for the initial load of records assumes that you are loading records into an empty data store that has been created in the Oracle Endeca Server.

The initial data load is performed via one or more invocations of the Data Ingest Web Service ingestRecords operation specifying one or more mdex:record elements.

The following actions take place during the initial load of records:
  • All of your source records are loaded into the data store.
  • Appropriate primary-key attributes are created by using the primaryKey element in the request. (This is because the initially created data store contains no primary-key attributes and they must be created.)
The request for an initial load should use one or more primaryKey elements to create the primary-key attributes. An example of a full request is:
<ingest:ingestRecords 
      xmlns:ingest="http://www.endeca.com/MDEX/ingest/1/0" 
      xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09">
   <ingest:primaryKeys>
      <ingest:primaryKey name="partID"/>
      <ingest:primaryKey name="supplierID"/>
   </ingest:primaryKeys>
   <ingest:addAssignments>
      <mdex:record>
         <partID type="mdex:string">P123</partID>
         <modelNum type="mdex:int">2562</modelNum>
      </mdex:record>
      <mdex:record>
         <supplierID type="mdex:string">S456</supplierID>
         <location type="mdex:geocode">42.365615 -71.075647</location>
      </mdex:record>
   </ingest:addAssignments>
</ingest:ingestRecords>

The request first creates the partID and supplierID primary-key attributes, and then adds two new records to the data store. The primary key of the first record is partID=P123 while supplierID=S456 is the primary key of the second record. The request also creates two standard attributes (modelNum and location) because they do not exist in the data store.

Note: If you submit the ingestRecords 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 load records into an empty data store:

  1. Use the create-ds command of the Oracle Endeca Server to create an instance of the data store and start the Dgraph process.
  2. Create an ingest:ingestRecords request, similar to the example above, and send the request to the Data Ingest Web Service. The request is typically created and managed by a ETL client.
  3. After the request is made, check the ingestRecordsResponse to determine if the request transaction was successful.
A successful ingestRecordsResponse returned from the above sample request should look like this:
<ingest:ingestRecordsResponse xmlns:ingest="http://www.endeca.com/MDEX/ingest/1/0">
   <ingest:numPropertiesCreated>4</ingest:numPropertiesCreated>
   <ingest:numRecordsAffected>2</ingest:numRecordsAffected>
   <ingest:numRecordsDeleted>0</ingest:numRecordsDeleted>
</ingest:ingestRecordsResponse>