Restricting Visual Query conditions

By default, all the Visual Query operators are available for all the record types that support them in your system. To prevent the creation of queries that take too long to produce results, you can configure Visual Query to restrict the operators that are valid in conditions.

Before you begin

The Visual Query configuration is one of a group of configuration files that you can modify and send to the i2 Analyze server without the need for system downtime. These files are stored in the toolkit\configuration\live directory.

To enable updating the server without the need to restart it, ensure that you have a command-line tool such as postman or curl.

About this task

Visual Queries are closely aligned with the Information Store schema. You create and edit the Visual Query configuration file in your configuration development environment, alongside highlight queries and search results filters.

If you follow this procedure in a deployment that provides high availability, you must complete each step on every Liberty server in your environment before you move to the next step.

Procedure

Set the rules that you want to apply to Visual Query conditions:

  1. Open the toolkit\configuration\live\visual-query-configuration.xml file in an XML editor.

  2. Using the supplied examples as a guide, add the rules that you want to implement.

    Note: Pay attention to the order of your rules. Where there are clashes, later rules override earlier ones.

  3. Save your changes.

Update the DiscoServerSettingsCommon.properties file to use your configuration rules:

  1. Using a text editor, open the DiscoServerSettingsCommon.properties file. You can find this file in the following location: toolkit\configuration\fragments\opal-services\WEB-INF\classes.

  2. Set the VisualQueryConfigurationResource property to the name of the configuration file. For example:

    VisualQueryConfigurationResource=visual-query-configuration.xml
  3. Save your changes.

Update the deployment with your changes. The following method deploys your changes without stopping the server by using a POST request to a REST endpoint.

Note: To redeploy your changes by using the deployment toolkit only, see Redeploying Liberty. You must use the deployment toolkit if you are in a deployment with high availability or you are deploying in your production environment.

  1. At the command line, navigate to the toolkit\scripts directory.

  2. Update the server with your configuration file:

    setup -t updateLiveConfiguration
  3. Update the running application by using the reload endpoint:

    curl -i --cookie-jar cookie.txt -d j_username=<user_name>
                                    -d j_password=<password>
                                    http://<host_name>/<context_root>/j_security_check
    
    curl -i --cookie cookie.txt -X
        POST http://<host_name>/<context_root>/api/v1/admin/config/reload

    Warning: The reload method updates the configuration without requiring a server restart, but any logged-in users are logged out from i2 Analyze when you run it.

    The server validates the visual query configuration as it loads it, and returns any errors in its response.

  4. If the configuration is invalid, modify the visual-query-configuration.xml file, and then repeat the process to update the deployment.

What to do next

Run a selection of Visual Queries that use conditions. Continue to change the configuration until you are satisfied with its behavior.