Creating a Handler for Data Sources in Data Cube
After you connect to a data source in Data Cube, you can create request handlers that will return specific pieces of data from your data sources. You can use handlers to create custom search interfaces using your data sources in your own applications.
After you create a data source and import data into Data Cube, a default handler is automatically created for the data source. The default handler query will return all of the data from the data source. You can follow this procedure to create multiple, custom handlers for different needs.
Before You Begin
- You must be able to log in to the Web Console to view Data Cube. See Accessing the Web Console.
- Only users assigned a role with the Data Connectors permission at the MediaAgent level can access Data Cube in the Analytics section of the Web Console. The associated MediaAgent must have been configured with Analytics Engine for Data Cube.
- You must have connected to at least one data source. See Connect to Data Sources.
- You must have crawled the data source. See Crawling Data Connections.
- In a Web browser, log in to the Web Console and then click Analytics.
- Click the connector heading for the type of data source you want to view.
- On the Data Sources (connector) page, click the name of the data source that you want to use.
- On the left side of the page under Data Connectors > connector, click Handlers.
- In the upper-right corner of the page, click Create New Handler.
- In the New Handler page, enter the name of the new handler in the Name box.
- Complete the remaining options on the New Handler page for the parameters that you want to include in the handler query:
- In Default Search Field, enter the name of the default data field that you want use for searching the data. If you leave Default Search Field blank, all of the data fields will be included for searches.
- In Default Search Keyword, enter a default query to return only matching data in the response. You can include wildcard patterns in your keyword query.
- Click the Column Names list and select one or more data fields from the data source that you want to return in the response.
Note: Unless Override is selected, some system-generated fields are also included in the response.
- In Filter Criteria, enter an conditional statement (using AND, OR, NOT) to filter the data in the response by specific data fields and values.
- In Sort By, enter the data field name that you want to use to sort the response. Then enter asc to sort the data in ascending order (numbers arranged from smallest to largest and letters in alphabetical order) or desc to sort the data in descending order (numbers arranged from largest to smallest and letters in reverse alphabetical order). Separate multiple sorting statements with a comma.
- To enable faceting on data fields in the response:
- Select the Facet check box.
- In Facets Field, enter the name of the data field that you want to use to add facet categories to the handler.
- To add more facets, click the add button.
- If facets are enabled and you want to override the default facet counts that are created for each facet in the response, in Facets Query, enter the query that you want to use to create facet counts.
For more information, see Data Cube Handler Options.
- To view additional options for the handler, click Additional Criteria:
- In Count, enter the maximum number of results that you want to include in the response.
- Click the Response Type list and select a format for the response.
- To include additional parameter-value pairs, in Raw Query enter the parameter and values as parameter=value. You can enter multiple Raw Queries.
Note: Raw Query values will override most values for parameters included in the handler form. If the handler form parameter can have multiple entries, such as Filter Criteria, then the Raw Query values will be appended to the parameter in the handler form.
For more information about handler query options, see Data Cube Handler Options.
- For each handler option that you want to include in the handler query, select a priority level for the option in terms of any additional parameter that will be included in the response:
- Default: The default parameters for the handler. These values will be overridden if the same parameters are present in the request.
- Append: These values will be appended to any values specified in the request.
- Override: These parameters will be used in spite of any values provided in the request.
Note: If you do not select a priority option for a parameter option, then that parameter will not be included in the handler query.
You can create a search view for the handler to view the response data in a more user-friendly format. For more information, see Creating Search Views in Data Cube.