How To
Documentation
    Learn More

      Query Rewrite API

      API Objective: Improve relevancy using AI-generated data.

      This API manages documents used for query rewriting.

      This API requires a Fusion license.

      Examples

      Create a blocklist rule

      Input
      curl -u {usr}:{pw} -XPOST -H "Content-type:application/json" http://fusion-host:6764/api/apps/{app_id}/query-rewrite/instances -d
      Output
      {
        "id": "block_list_rule_1",
        "name": "block_list_rule_1",
        "type": "block_list",
        "field_name": "id",
        "field_values": ["6","17"],
        "enabled": true,
        "priority":11,
        "search_terms":["life"],
        "matching": "keywords"
      }'

      Update specific fields in an existing rule

      Input
      curl -u {usr}:{pw} -XPUT -H "Content-type:application/json" http://fusion-host:6764/api/apps/{app_id}/query-rewrite/instances -d
      Output
      {
        "id": "block_list_rule_1",
        "name": "block_list_rule_1",
        "type": "block_list",
        "field_name": "id",
        "field_values": ["6","17"],
        "enabled": false,
        "priority":9,
        "search_terms":["life"],
        "matching": "keywords"
      }'

      Publish rules in the staging area

      Input
      curl -u {usr}:{pw} -X PUT -H 'Content-Type: application/json' http://fusion-host:6764/api/apps/{app_id}/query-rewrite/publish

      Delete a published rule

      Input
      curl -u {usr}:{pw} -XPUT -H "Content-type:application/json" http://fusion-host:6764/api/apps/{app_id}/query-rewrite/instances -d
      Output
      {
        "delete": [ “block_list_rule_1" ]
      }'

      Publish an operation

      Input
      curl -u {usr}:{pw} -XPUT -H "Content-type:application/json" http://fusion-host:6764/api/apps/{app_id}/query-rewrite/publish
      Loading API specification...