About adding PDRs and DDRs

PDRs and DDRs represent the non-data records. They are records that define the schema for your data records. Adding PDRs and DDRs allows you to define the characteristics of attributes on your data records.

A PDR defines a standard attribute. For example, for a standard attribute "Type", you can define whether it should allow multiple assignments, or be a single-assign attribute (allowing one value from each record). You can also define a spec for the standard attribute "Type", which is used when making assignments from this attribute on data records.

Similarly, a PDR and a DDR together define characteristics of a managed attribute. For example, each managed attribute, such as "location", has a name ("Location"), and the Spec attribute. The Spec attribute of the managed attribute is used when managed attribute values are added to the managed attribute. Other characteristics of a managed attribute specify how searching should behave on values from this attribute.

Since PDR and DDR are records (although they represent non-data records and define the schema for data records), you can add PDRs and DDRs as records, using the same addRecords sub-operation of the ingestChanges in the Data Ingest Web Service as is used for adding data records. It is important to add PDRs and DDRs before adding any data records.

For information on how to add any records (data or non-data), see Adding new records.

There is one important difference between adding data records and adding PDRs and DDrs. When you add data records, you can define for them any attributes you want. When you add a PDR and a DDR, it is important to know which attributes you should add. This is because the attributes on the PDR and the DDR records are defined by primordial records that exist in the index before any source data records are loaded. An easy way to determine the format for PDR and DDR records is to use putProperties and PutDimensions requests of the Configuration Web Service WSDL.

For example, the structure of putProperties request has this configuration:
<ns:putProperties>
   <ns1:record>
      <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>
   </ns1:record>
</ns:putProperties>
This structure indicates which attributes you should add when adding a new PDR, including which of these attributes are required and which are optional. For example, for adding a PDR "location", you can add a record with these characteristics:
<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>
Similarly, to check which attributes should be present when you need to add a DDR (since both a PDR and a DDR define each managed attribute), use the putDimensions structure, from the Configuration Web Service:
<ns:putDimensions>
   <ns1:record>
      <mdex-dimension_Key>?</mdex-dimension_Key>
      <mdex-dimension_EnableRefinements>?</mdex-dimension_EnableRefinements>
      <mdex-dimension-value_Spec>?</mdex-dimension-value_Spec>
      <mdex-dimension-value_Parent>?</mdex-dimension-value_Parent>
      <mdex-dimension_IsDimensionSearchHierarchical>?</mdex-dimension_IsDimensionSearchHierarchical>
      <mdex-dimension_IsRecordSearchHierarchical>?</mdex-dimension_IsRecordSearchHierarchical>
   </ns1:record>
</ns:putDimensions>
This structure indicates which attributes you should add when adding a new DDR, after a corresponding PDR has already been added. For example, for adding a DDR "location", you can add:
<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>
Note that mdex-dimension-value_Spec and mdex-dimension-value_Parent attributes are optional. If you specify them, as in this example, you can provide values for them. (You then use these values of Spec and Parent when adding managed attribute values.) However, if you omit the attributes from the request that adds a DDR, then they are added automatically, and assigned values according to this structure: mdex-dimension_value_Spec and mdex-dimension_value_Parent, where value is the name of the managed attribute. Such as, for the managed attribute value "location", the Spec would be named mdex-dimension_location_Spec, and the Parent would be named mdex-dimension_location_Parent.

For detailed information on properties in the PDRs and DDRs and their meanings, see the Oracle Endeca Server Developer's Guide.