
# 带一般过滤条件最短路径（filtered_shortest_path）(2.2.4)
#### 请求
- 参数说明
表1parameters参数说明 
| 参数         | 是否必选 | 类型      | 说明                                                       |
|:---|:---|:---|:---|
| source     | 是    | String  | 输入路径的起点ID。                                               |
| target     | 是    | String  | 输入路径的终点ID。                                               |
| directed   | 否    | Boolean | 是否考虑边的方向。默认值为false。                                      |
| num_thread | 否    | Integer | 并发线程数。范围为\[1,40\]，小于"1"会自动置为"1"，大于"40"则自动置为"40"。默认值为"4"。 |
   
- 请求样例
  - 同步
    ```
    {
        "executionMode": "sync",
        "algorithmName": "filtered_shortest_path",
        "edge_filter": {
            "property_filter": {
                "leftvalue": {
                    "label_name": "labelName"
                },
                "predicate": "IN",
                "rightvalue": {
                    "value": [
                        "xxx",
                        "rate"
                    ]
                }
            }
        },
        "vertex_filter": {
            "property_filter": {
                "leftvalue": {
                    "property_name": "title"
                },
                "predicate": "PREFIX",
                "rightvalue": {
                    "value": "tr_"
                }
            }
        },
        "parameters": {
            "source": "tr_1",
            "target": "tr_117",
            "directed": true
        }
    }
    ```
    
  
  
  - 异步
    ```
    {
        "executionMode": "async",
        "algorithmName": "filtered_shortest_path",
        "edge_filter": {
            "property_filter": {
                "leftvalue": {
                    "label_name": "labelName"
                },
                "predicate": "IN",
                "rightvalue": {
                    "value": [
                        "xxx",
                        "rate"
                    ]
                }
            }
        },
        "vertex_filter": {
            "property_filter": {
                "leftvalue": {
                    "property_name": "title"
                },
                "predicate": "PREFIX",
                "rightvalue": {
                    "value": "tr_"
                }
            }
        },
        "parameters": {
            "source": "tr_1",
            "target": "tr_117",
            "directed": true
        }
    }
    ```
    
    
 
#### 响应
- 同步参数说明
  表2response_data参数说明 
  | 参数      | 是否必选 | 类型     | 说明                                        |
  |:---|:---|:---|:---|
  | path    | 是    | List   | 点的结果集合。filters最后一层为点过滤时，data中将包含vertices。 |
  | source  | 是    | String | 源节点ID。                                    |
  | target  | 是    | String | 目标节点ID。                                   |
  | runtime | 是    | Double | 算法运行时间 。                                  |
     
  
- 响应样例
  - 同步成功响应样例
    ```
    {
        "data": {
            "outputs": {
                "path": [
                    "tr_1",
                    "tr_5",
                    "tr_26",
                    "tr_117"
                ],
                "runtime": 0.735766,
                "source": "tr_1",
                "target": "tr_117"
            }
        }
    }
    ```
    
  
  
  
  - 同步失败响应样例
    ```
    {
    "errorMessage": "graph [tesdt_117] is not found",
    "errorCode": "GES.8402"
    }
    ```
    
   
 
- 异步返回参数
  表3response_data参数说明 
  | 参数           | 是否必选 | 类型      | 说明                                                                                                                                       |
  |:---|:---|:---|:---|
  | errorMessage | 否    | String  | 系统提示信息，执行成功时，字段可能为空。执行失败时，用于显示错误信息。                                                                                                      |
  | errorCode    | 否    | String  | 系统提示信息，执行成功时，字段可能为空。执行失败时，用于显示错误码。                                                                                                       |
  | jobId        | 否    | String  | **参数解释**： 执行算法任务ID。请求失败时，该字段为空。 **取值范围**： 不涉及。 |
  | jobType      | 否    | Integer | **参数解释**： 任务类型。请求失败时，该字段为空。 **取值范围**： 不涉及。     |
     
  
- 响应样例
  - 异步成功响应样例
    ```
    {
    "jobId": "500dea8f-9651-41fe-8299-c20f13a032ea",
    "jobType": 2
    }
    ```
    
    
  
  - 异步失败响应样例
    ```
    {
        "errorMessage": "Not found. Please check the input parameters.",
        "errorCode": "GES.8000"
    }
    ```
    
   
 
