Defining the filter identifier for REST search service

To use a specific filter configuration for a request, you can provide the filter identifier as URL query parameter. The filter identifier must be configured in the custom/rest/searchfilter.json file. The REST Service uses the corresponding filter configuration to create the filter expression. The filter identifier is useful when a REST endpoint is started for different REST functions.

About this task

By default, the REST search service returns all the data for an entity. To get a specific search result, you must customize the search operation by defining the filter identifier for the REST search service. Complete the following steps.

Procedure

  1. From the top-level menu of the Appliance Dashboard, select Configure > Advanced Configuration > Custom File Management.
  2. On the Custom File Management page, click the All Files tab.
  3. Go to directories/data.
  4. Select the rest.properties file to work with it.
    For more information, see Managing the custom files.
  5. From the top-level menu of the Appliance Dashboard, select Configure > Advanced Configuration > Update Property.
  6. On the Update Property page, click the All Properties tab.
  7. Click the Identity server property files tab.
  8. Select the rest.properties file and define the filter identifier text for the REST service endpoint key.
    For more information, see Managing the server properties.
  9. Add the filter identifier details in the searchfilter.json file.
    For example, if you define the filter identifier in the rest.properties as customsearch, then you can add the details in the searchfilter.json file.
    "customsearch": {
    				"filterTemplate": "(&(requester=${requester})(${filterExpression}))",
    				"joinOperator": "&",
    				"multivalueJoinOperator": "|", 
    				"comparisonOperator": ">=",
    				"baseFilter": "(!(uid=${systemUser.owner.uid}))",
    				"allowWildcard": "false"

Results

The filter identifier is defined according to your requirement. Use the filter identifier customsearch as a URL parameter for the REST search service.

Example

For more information about how to use filter identifier in the request URL, see examples in Filter configuration for REST search services.