Studio data sources can have parents and children. A child data source is essentially a subset of its parent data source.
For example, a parent data source contains all of the transaction records for a company. A child data source may contain only transactions from the United States.
Child data sources may themselves have children. For example, the child data source containing United States transactions may have a child data source that contains only transactions for New York, or transactions processed by a specific distributor.
You can configure whether refinements to related data sources affect the current data source.
A child data source usually has the same server, port, and data domain name as its parent data source.
Setting | Description |
---|---|
parentDataSource | The id of the parent data source. |
You then configure baseFunctions setting with the filters for the child data source.
By default, the current query state for a child data source is the current query state of the parent data source plus any filters from the child data source. For example, if the parent data source has been refined to only include transactions for 1999, then the child data source only includes transactions for the United States (the child data source filter) from 1999 (the parent data source refinement).
For example, if an end user selects a refinement from a Guided Navigation component that is bound to a child data source, components bound to the parent data source also are updated with that refinement.
If that parent data source is itself a child data source, the change is then applied to its parent as well.
The operation is applied to each parent in turn until it reaches a data source that does not have a parent.
If that child data source itself has children, the change is then applied to those children as well.
The operation is applied to each child in turn until it reaches a data source that does not have any children.
For example, for the following data source hierarchy:
For a data source with related data sources, you can use selective refinement to override the default refinement behavior. Selective refinement allows you to control how refinements to related data sources affect the current data source.
The minimum configuration is to enable selective refinement. If you enable selective refinement, then a refinement to a related data source only affects the current data source if the attribute used for the refinement is present in both data sources.
You can configure the selective refinement to use a regular expression to select the attributes to include. You can also exclude and include specific attributes.
To implement selective refinement, you add the selectiveRefinements setting to the data source definition. The selectiveRefinements setting can use the following parameters:
selectRefinements Parameter | Description |
---|---|
enabled | Required. Whether to enable selective
refinements.
If set to true, then a refinement to a related data source is only applied to the current data source if the attribute used for the refinement is present in both data sources. If set to false (the default), then all refinements from related data sources are applied to the current data source. |
autoDetect | Required. Whether to automatically detect
the attributes to use for refinement.
If set to true (the default), then the attributes are detected automatically. You can also use autoDetectPattern to create a regular expression for detecting the attributes for which to apply refinements. If set to false, then the only attributes used for refinement are those provided by the includedAttributes parameter. |
autoDetectPattern | A regular expression used to determine the
attributes for which to respect refinements from related data sources.
For example, setting this to "^Supplier.+" indicates to only respect refinements from attributes whose attribute keys start with "Supplier". |
excludedAttributes | Optional. A comma-separated list of
attributes for which to ignore refinements from related data sources.
When specifying the attributes, use the attribute key. For example, the following configuration excludes refinements by color and sleeve type: "selectiveRefinements":{ "enabled":true, "excludedAttributes":["Color","Sleeve_Type"] } |
includedAttributes | Optional. A comma-separated list of
attributes for which to respect refinements.
When specifying the attributes, use the attribute key. If autoDetect is false, then if you do not provide attributes here, Studio does not apply any refinements from related data sources. If you are using autoDetectPattern to detect attributes, then the attributes provided here are used in addition to the automatically detected ones. For example, the following configuration adds refinement by price and region to the automatically detected attributes: "selectiveRefinements":{ "enabled":true, "autoDetectPattern":"Customer.+", "includedAttributes":["Price","Sales_Region"] } |
In the following example of a child data source, the ID of the parent data source is all-transactions.
This child data source includes data from all-transactions, filtered to only include records for the Importer supplier type.
The selective refinement indicates to respect customer-related attributes, except for the customer discount, and adds sales region and sales rep to the respected refinements.
{ "server":"server01.lab.acme.com", "port":"5555", "dataDomainName":"acmeDB" "name":"Importer Transactions" "parentDataSource":"all-transactions", "baseFunctions": [ {"class":"com.endeca.portal.data.functions.DataSourceFilter", "filterString":"Supplier_Types='Importer'" } ] "selectiveRefinements":{ "enabled":true, "autoDetect":true, "autoDetectPattern":"^Customer.+", "includedAttributes":["Sales_Region","Sales_Rep"], "excludedAttributes":["Customer_Discount"] } }