Configuration : Configuring CloudView with the Data Model : Creating Dynamic Properties
 
Creating Dynamic Properties
 
Add a Dynamic Property
About Storing and Displaying Dynamic Property Fields
Store Properties in a Parent Class Dynamic Property
Search Dynamic Property Fields
A dynamic property allows you to map one or several metas to the same index field, based on the meta name.
This is useful when you do not know all the metas available in your data source. It also reduces the number of fields you need in the index.
For example, use dynamic properties to:
Map all meta names that start with the word item to an item field, when indexing a corpus of store inventory.
Map any meta name that includes the word price to a price facet, when indexing sales data.
Note: Dynamic properties can generate alphanumeric fields, numerical fields, date/time fields, or category facets. When using date/time dynamic properties, the validation of the date/time format is performed according to the format specified for this dynamic property.
Add a Dynamic Property
About Storing and Displaying Dynamic Property Fields
Store Properties in a Parent Class Dynamic Property
Search Dynamic Property Fields
Add a Dynamic Property
The following procedure describes how to configure a dynamic property for a data model class.
1. In the Administration Console, go to Index > Data Model.
2. Under Classes, select the class (if the property is not part of the default class).
3. Under Dynamic properties for the <Classname> class (below), click Add dynamic property.
a. Select a Name and Data type.
b. Select a Semantic type. This defines the type of semantic processing for the property.
c. Select a Field type.
4. Define Matching rules:
For Mode, select a matching method:
Exact: includes the specified meta name only.
Prefix: includes meta names that begin with this string.
Note: You can select the Unprefix check box if you want to remove the prefix from search queries.
Suffix: includes meta names that end with this string.
Substring: includes meta names that contain this string.
Pattern: includes meta names that match this regular expression.
For Pattern, specify the string or regular expression.
5. Click Accept.
6. (Optional) To display meta values under their meta name in hit results or the Refinements panel, select Store meta names.
Note: Selecting this option impacts how you search with dynamic property prefix handlers. See Search When Storing Meta Names.
7. (Optional) Select or clear the remaining options as required.
8. Click Apply.
9. Go to Home > Indexing, click Clear, and then select the build groups that are modified by this property.
10. Scan your documents.
About Storing and Displaying Dynamic Property Fields
The way in which index fields and category facets are stored is determined by the Store meta names option, which also determines how these fields can be retrieved and searched.
For details on searching, see Search Dynamic Property Fields.
If Store Meta Names is not Selected
If Store meta names is not selected for a dynamic property, the resulting dedicated index field (or category facet or output context) is the same as any other alphanumeric or numerical field created with standard properties. It contains only meta values.
Figure 6. Without Stored Meta Names
Note: The Store index field includes both the store_city and store_country metas, and displays the values for both together.
If Store Meta Names is Selected
If Store meta names is selected, by contrast, the resulting index field (or category facet or output context) is indeed different from standard fields: for each value, it also stores the associated meta name. This allows you to search and retrieve specific metas within the field.
Figure 7. With Stored Meta Names
Note: The Store index field displays the store_city and store_country metas separately.
Calculate Facets for Dynamic Property Fields
Dynamic properties, are not stored in the Categories index field with a /top/foo/bar tree structure like standard facets. To calculate their values, use virtual expressions, with the following syntax:
#extract(dynamicField, "<meta name>") to return the value of "meta name" in the dynamic field.
Store Properties in a Parent Class Dynamic Property
For big projects with a lot of fields, you can mutualize dynamic fields if they can be used by different classes.
The idea is to store the properties of child classes into a single dynamic property specified for a parent class. For example, we could configure our data model to have:
parent_class with:
dynprop_num_ram
dynprop_alpha_search
...
common_prop1
common_prop2
and child_class1 with:
prop1 --> in dynprop_num_ram (parent_class)
prop2 --> in dynprop_alpha_search (parent_class)
...
prop3 (dedicated to this class)
1. In the Administration Console, go to Index > Data Model.
2. Select a property, then expand Other advanced options.
3. In Store in dynamic property, enter the name of the dynamic property in which you want to store the current property.
4. To avoid getting duplicate values for your children meta at search time:
a. Expand Expansion control.
b. Select Customize default expansion.
c. Clear Generate hit meta.
5. Click Apply.
Search Dynamic Property Fields
The Store meta names option also determines how you search the resulting index field or category facet using prefixes.
Search When Storing Meta Names
1. Include the meta name in the prefix handler, in this format:
If the property belongs to the default class: <property_name>:<meta_name>:<query>.
If the property does not belong to the default class: <classname_property_name>:<meta_name>:<query>.
For example: item:item_description:skirt
Searches for skirt in the item_description meta of the item index field.
Search When not Storing Meta Names
1. Use only the property name for the prefix handler, in this format:
If the property belongs to the default class: <property_name>:<query>.
If the property does not belong to the default class: <classname_property_name>:<query>.
For example: item:skirt
Searches for skirt in the item index field, which includes the metas item_description, item_name, and item_details.
Search When the Dynamic Property is in a Parent Class
1. To target a property stored in a dynamic property of a parent class, you must specify the parent class and the child class in your prefix handler: <parentclassname_dynamic_property_name>:<childclassname_meta_name>:<query>.
The following syntax does not work: <parentclassname_dynamic_property_name>:<meta_name>:<query>.