customMetadataContent property

Content Platform Tenant Management Help

Version
9.7.x
File Size
4269 KB
Audience
anonymous
Part Number
MK-95HCPH002-19

To search for objects based on the full-text content of custom metadata, you specify the customMetadataContent property in a query expression. Criteria that use this property find objects only in namespaces that have full-text indexing of custom metadata enabled.

When custom metadata is indexed for full-text searching, the XML is treated as text, not as a structured document. Similarly, the customMetadataContent property value is treated as text.

Tip: If you frequently search for values of a particular element or attribute, use a content property that corresponds to that element or attribute, as content property searches are more efficient than customMetadataContent searches. If the required content property does not exist, ask your tenant administrator to create one.

To use the customMetadataContent property to query for any element name, attribute name, element value, or attribute value that matches a text string, use a query expression with this format:

customMetadataContent:text-string

If the text string consists of more than a single string of alphabetic or numeric characters, enclose the entire value in double quotation marks (").

To query for a combination of elements and attribute names and values, use a query expression with either of these formats:

customMetadataContent:"element-name.
attribute-name.attribute-value...element-value.element-name"

<![CDATA[customMetadataContent:"<element-name
attribute-name=attribute-value...>element-value</element-name>"]]>

The two formats are equivalent. The first format is simpler. The second format uses well-formed XML.

When using the second format, enclose both the property and text string in the square brackets that mark the CDATA content, and enclose the text string in double quotation marks ("). The outer square brackets ([ ]) are also required, as are the outside angle brackets and exclamation mark.

To query for the value of a specific element, specify every attribute and attribute value for the element, not just the element name and value.

To query for the value of a specific attribute, regardless of which element it applies to, use this format:

customMetadataContent:"attribute-name.attribute-value"

You can use the asterisk (*) and question mark (?) wildcard characters when specifying customMetadataContent property values that are not in quotation marks.

Here is some sample custom metadata that you might want to search:

<?xml version="1.0" ?>
<weather>
<location>Boston</location>
<date>20121130</date>
<duration unit="secs">180</duration>
<temp>
<temp_high unit="deg_F">31</temp_high>
<temp_low unit="deg_F">31</temp_low>
</temp>
<velocity>
<velocity_high unit="mph">17</velocity_high>
<velocity_low unit="mph">14</velocity_low>
</velocity>
<conditions>partly cloudy</conditions>
</weather>

Here are some examples of query expressions that use the customMetadataContent property to search the XML:

  • This query expression finds objects that have custom metadata with an element name, element value, attribute name, or attribute value that contains Boston:
    customMetadataContent:Boston
  • This query expression finds objects that have custom metadata that contains the location element with a value of Boston:
    customMetadataContent:"location.Boston.location"
  • This query expression finds objects that have custom metadata that contains the velocity_high element with a value of 17 and the unit attribute with a value of mph:
    customMetadataContent:"velocity_high.unit.mph.17.velocity_high"
  • This query expression returns objects that have custom metadata that contains the conditions element with a value of partly cloudy:
    customMetadataContent:"conditions.partly cloudy.conditions"
  • This query expression finds objects that have custom metadata that contains the date element with a value of 20121130:
    <![CDATA[customMetadataContent:"<date>20121130</date>"]]>
  • This query expression finds objects that have custom metadata that contains the temp_high element with a value of 31 and the unit attribute with a value of deg_F:
    <![CDATA[customMetadataContent:"<temp_high unit=deg_F>31
    </temp_high>"]]>"