Initial loading of records

The initial load user case assumes that you are loading records into an empty MDEX Engine.

The initial load use case (also called a full index load) makes these assumptions:
  • All of your source records will be loaded into the MDEX Engine.
  • The MDEX Engine contains no primary-key attributes. Therefore, the initial load operation must create the appropriate primary-key attributes by using the primaryKey element in the request.
  • 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 request for an initial load should use one or more primaryKey elements to create the primary-key attributes. An example of a full request would be:
<ingest:ingestRecords 
      xmlns:ingest="http://www.endeca.com/MDEX/ingest/2010" 
      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 MDEX Engine. 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 MDEX Engine.

To load records into an empty MDEX Engine:

  1. Use mkmdex to create an instance of the MDEX Engine, and then start the MDEX Engine. See the Latitude Installation Guide for details.
  2. Create an ingest:ingestRecords request, similar to the example above, and send the request to the Data Ingest 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/2010">
   <ingest:numPropertiesCreated>4</ingest:numPropertiesCreated>
   <ingest:numRecordsAffected>2</ingest:numRecordsAffected>
   <ingest:numRecordsDeleted>0</ingest:numRecordsDeleted>
</ingest:ingestRecordsResponse>