レコードの初期ロード

レコードの初期ロードの使用例では、Oracle Endeca Serverで作成された空のデータ・ドメインにレコードをロードすることを想定しています。

初期データ・ロードは、1つ以上のrecordを指定するデータ・インジェストWebサービスのingestChanges操作をaddRecordsを使用して1回以上起動することで実行されます。

注意: 初期作成されたデータ・ドメインには主キー属性が含まれていないので、主キー属性の割当てはありません。主キーとその割当ては作成する必要があります。
要約すると、レコードの初期ロード中に次の処理が発生します。
  • 主キー属性のPDRをデータ・ドメインに追加する必要があります。
  • 一部またはすべてのソース・レコードがデータ・ドメインにロードされます。
  • 主キー属性の割当てが、attribute要素(record要素内(addRecords操作))を使用して作成されます。
    <attribute name="pKey" type="mdex:string">pKeyValue</attribute>
    pKeyは主キー属性の名前(partIDなど)で、pKeyValueは追加するレコードの主キーの値(P775など)です。
完全なリクエストの例は次のとおりです。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:ns="http://www.endeca.com/MDEX/ingest/3/0" 
  xmlns:ns1="http://www.endeca.com/MDEX/XQuery/2009/09">
 <soapenv:Header/>
 <soapenv:Body>
 <ns:ingestChanges>
  <ns:addRecords>
   <ns:record>
    <ns1:attribute name="mdex-property_Key" type="mdex:string">partID</ns1:attribute>
    <ns1:attribute name="mdex-property_DisplayName" type="mdex:string">Part ID</ns1:attribute>
    <ns1:attribute name="mdex-property_Type" type="mdex:string">mdex:string</ns1:attribute>
    <ns1:attribute name="mdex-property_Language" type="mdex:string">en</ns1:attribute>
    <ns1:attribute name="mdex-property_IsSingleAssign" type="mdex:boolean">false</ns1:attribute>
    <ns1:attribute name="mdex-property_IsUnique" type="mdex:boolean">true</ns1:attribute>
    <ns1:attribute name="mdex-property_IsTextSearchable" type="mdex:boolean">false</ns1:attribute>
    <ns1:attribute name="mdex-property_TextSearchAllowsWildcards" type="mdex:boolean">
     false</ns1:attribute>
    <ns1:attribute name="mdex-property_IsPropertyValueSearchable" type="mdex:boolean">
     true</ns1:attribute>
    <ns1:attribute name="system-navigation_Select" type="mdex:string">single</ns1:attribute>
    <ns1:attribute name="system-navigation_Sorting" type="mdex:string">lexical</ns1:attribute>
    <ns1:attribute name="system-navigation_ShowRecordCounts" type="mdex:boolean">true</ns1:attribute>
    <ns1:attribute name="system-property_GroupMembership" type="mdex:string">
    system_properties</ns1:attribute>
   </ns:record>
 <ns:record>
   <ns1:attribute name="partID" type="mdex:string">P789</ns1:attribute>
   <ns1:attribute name="modelNum" type="mdex:int">2562</ns1:attribute>
   <ns1:attribute name="location" type="mdex:geocode">42.365615 -71.075647</ns1:attribute>
  </ns:record>
 </ns:addRecords>
</ns:ingestChanges></soapenv:Body></soapenv:Envelope>

このリクエストでは、最初にpartID主キー属性を作成してから、主キーpartID=P789を使用して1つの新規レコードをデータ・ドメインに追加します。また、このリクエストでは、2つの標準属性(modelNumおよびlocation)も作成されます(それらがデータ・ドメインに存在しないため)。

注意: 外部トランザクションを開始するトランザクションWebサービスのリクエストの後に、ingestChangesリクエストを送信する場合、そのリクエストでは外部トランザクションIDを指定する必要があります。外部トランザクションが開始されていない場合、リクエストのID属性は省略する必要があります。前の例ではIDを指定せず、外部トランザクションが開始されていないことを前提としています。

空のデータ・ドメインにレコードをロードするには、次の手順を実行します。

  1. Oracle Endeca Serverのendeca-cmdコマンドを使用してEndecaデータ・ドメインが作成され、そのデータ・ドメインが開始されていることを確認します。
  2. 前の例と同じようにingest:ingestChangesリクエストを作成し、データ・インジェストWebサービスにリクエストを送信します。

    リクエストは通常、ETLクライアントによって作成および管理されます。または、soapUIを使用できます。

  3. リクエストの作成後、ingestChangesResponseを参照して、リクエストが成功したかどうかを確認します。
前のサンプル・リクエストから返される成功時のingestChangesResponseは、次のようになります。
<ingest:ingestChangesResponse xmlns:ingest="http://www.endeca.com/MDEX/ingest/3/0">
 <ingest:numPropertiesCreated>2</ingest:numPropertiesCreated>
 <ingest:numRecordsAffected>1</ingest:numRecordsAffected>
 <ingest:numRecordsDeleted>0</ingest:numRecordsDeleted>
</ingest:ingestChangesResponse>