PDRおよびDDRの追加について

PDRおよびDDRは非データ・レコードです。データ・レコードのスキーマを定義するレコードです。PDRおよびDDRを追加すると、データ・レコードに対して属性の特性を定義できます。

PDRは、標準属性を定義します。たとえば、標準属性Typeの場合、複数の割当てを許可するか、単一割当て属性(各レコードから1つの値を許可)とするかを定義できます。標準属性Typeにはspecも定義できます。specは、データ・レコードでこの属性から割当てを行うときに使用されます。

同様に、PDRとDDRを組み合せて管理属性の特性を定義します。たとえば、locationなどの管理属性はそれぞれ、名前(Location)とSpec属性を持っています。管理属性のSpec属性は、管理属性に管理属性値を追加するときに使用されます。管理属性の他の特性は、この属性からの値に対して検索がどのように動作するかを指定します。

PDRおよびDDRはレコードであるため(非データ・レコードであり、データ・レコードのスキーマを定義しますが)、データ・インジェストWebサービスで、データ・レコードの追加に使用するのと同じingestChangesaddRecordsサブ操作を使用して、PDRおよびDDRをレコードとして追加することができます。PDRおよびDDRは、データ・レコードより先に追加することが重要です。

レコード(データ・レコードまたは非データ・レコード)の追加方法は、「新規レコードの追加」を参照してください。

データ・レコードの追加とPDRおよびDDRの追加との間には、重要な相違点が1つあります。データ・レコードを追加する際には、必要な属性はすべてデータ・レコードに定義できます。PDRおよびDDRを追加する際には、どの属性を追加する必要があるかを把握していることが重要です。PDRおよびDDRレコードの属性は、ソース・データ・レコードをロードする前に、索引に存在する初期レコードによって定義されるためです。PDRおよびDDRレコードの書式を決定するには、構成WebサービスWSDLのputPropertiesリクエストとPutDimensionsリクエストを使用する方法が簡単です。

たとえば、putPropertiesリクエストの構造は次のような構成になっています。
<ns:putProperties>
            <!--Zero or more repetitions:-->
            <ns1:record>
               <!--Optional:-->
               <mdex-property_DisplayName>?</mdex-property_DisplayName>
               <mdex-property_IsSingleAssign>?</mdex-property_IsSingleAssign>
               <mdex-property_IsTextSearchable>?</mdex-property_IsTextSearchable>
               <mdex-property_IsUnique>?</mdex-property_IsUnique>
               <mdex-property_IsPropertyValueSearchable>?</mdex-property_IsPropertyValueSearchable>
               <mdex-property_Key>?</mdex-property_Key>
               <mdex-property_TextSearchAllowsWildcards>?</mdex-property_TextSearchAllowsWildcards>
               <mdex-property_Type>?</mdex-property_Type>
               <mdex-property_Language>?</mdex-property_Language>
               <system-navigation_Select>?</system-navigation_Select>
               <system-navigation_ShowRecordCounts>?</system-navigation_ShowRecordCounts>
               <system-navigation_Sorting>?</system-navigation_Sorting>
               <!--You may enter ANY elements at this point-->
            </ns1:record>
         </ns:putProperties>
この構造は、新しいPDRを追加するときにどの属性を追加する必要があるか、また各属性が必須かオプションかを示しています。たとえば、locationというPDRを追加する場合には、次のような特性を持つレコードを追加できます。
<ns:ingestChanges>
 <ns:addRecords>
   <ns:record>
     <ns1:attribute name="mdex-property_DisplayName" type="mdex:string">Location</ns1:attribute>
     <ns1:attribute name="mdex-property_IsPropertyValueSearchable" type="mdex:boolean">true</ns1:attribute>
     <ns1:attribute name="mdex-property_IsSingleAssign" type="mdex:boolean">false</ns1:attribute>
     <ns1:attribute name="mdex-property_IsTextSearchable" type="mdex:boolean">true</ns1:attribute>
     <ns1:attribute name="mdex-property_IsUnique" type="mdex:boolean">false</ns1:attribute>
     <ns1:attribute name="mdex-property_Key" type="mdex:string">location</ns1:attribute>
     <ns1:attribute name="mdex-property_Language" type="mdex:string">en</ns1:attribute>
     <ns1:attribute name="mdex-property_TextSearchAllowsWildcards" type="mdex:boolean">true</ns1:attribute>
     <ns1:attribute name="mdex-property_Type" type="mdex:string">mdex:string</ns1:attribute>
     <ns1:attribute name="system-navigation_Select" type="mdex:string">single</ns1:attribute>
     <ns1:attribute name="system-navigation_ShowRecordCounts" type="mdex:boolean">true</ns1:attribute>
     <ns1:attribute name="system-navigation_Sorting" type="mdex:string">record-count</ns1:attribute>
     <ns1:attribute name="system-property_GroupMembership" type="mdex:string">system_properties</ns1:attribute>
   </ns:record>
  </ns:addRecords>
</ns:ingestChanges>
同様に、DDRの追加が必要なときにどの属性が存在するかを確認するには(PDRとDDRはどちらも各管理属性を定義するため)、構成WebサービスのputDimensions構造を使用します。
<ns:putDimensions>
            <!--Zero or more repetitions:-->
            <ns1:record>
               <mdex-dimension_Key>?</mdex-dimension_Key>
               <mdex-dimension_EnableRefinements>?</mdex-dimension_EnableRefinements>
               <!--Optional:-->
               <mdex-dimension-value_Spec>?</mdex-dimension-value_Spec>
               <!--Optional:-->
               <mdex-dimension-value_Parent>?</mdex-dimension-value_Parent>
               <mdex-dimension_IsDimensionSearchHierarchical>?</mdex-dimension_IsDimensionSearchHierarchical>
               <mdex-dimension_IsRecordSearchHierarchical>?</mdex-dimension_IsRecordSearchHierarchical>
               <!--You may enter ANY elements at this point-->
            </ns1:record>
         </ns:putDimensions>
この構造は、対応するPDRをすでに追加した後で、新しいDDRを追加するときにどの属性を追加する必要があるかを示しています。たとえば、locationというDDRを追加する場合には、次のように追加できます。
<ns:ingestChanges>
 <ns:addRecords>
  <ns:record>
   <ns1:attribute name="mdex-dimension_Key" type="mdex:string">location</ns1:attribute>
   <ns1:attribute name="mdex-dimension_EnableRefinements" type="mdex:boolean">true</ns1:attribute>
   <ns1:attribute name="mdex-dimension-value_Spec" type="mdex:string">loc_spec</ns1:attribute>
   <ns1:attribute name="mdex-dimension-value_Parent" type="mdex:string">loc_parent</ns1:attribute>
  </ns:record>
 </ns:addRecords>
</ns:ingestChanges>
mdex-dimension-value_Spec属性とmdex-dimension-value_Parent属性はオプションです。この例のように、これらの属性を指定する場合には、その値を指定できます。(その場合、管理属性値を追加するときにSpecとParentの値を使用できます。)一方、DDRを追加するリクエストからこれらの属性を省略すると、属性は自動的に追加され、mdex-dimension_value_Specおよびmdex-dimension_value_Parent (valueは管理属性の名前)の構造に従って値が割り当てられます。そのため、管理属性値locationの場合、Specはmdex-dimension_location_Specという名前、Parentはmdex-dimension_location_Parentという名前になります。

PDRおよびDDRのプロパティとその意味の詳細は、『Oracle Endeca Server開発者ガイド』を参照してください。