新建索引(1.1.6)-凯发k8国际娱乐官网入口
功能介绍
根据给定的indexname,indextype等信息创建索引。目前支持的索引:复合索引。
- 复合索引有全局点索引(globalcompositevertexindex)和全局边索引(globalcompositeedgeindex)。复合索引可在label和property上创建索引,使用索引查询可以加快速度。
索引特性
特性 |
模糊查询 |
速度 |
灵活度 |
---|---|---|---|
复合索引 |
不支持 |
快速 |
仅限于固定组合属性键 |
uri
参数 |
是否必选 |
类型 |
说明 |
---|---|---|---|
project_id |
是 |
string |
项目id。获取方法请参见。 |
graph_name |
是 |
string |
图名称。 |
请求示例
post http://{server_url}/ges/v1.0/{project_id}/graphs/{graph_name}/indices { "indexname":"ageindex", "indextype": "globalcompositevertexindex", "haslabel": "true", "indexproperty": ["age"] }
server_url:图的访问地址,取值请参考。
请求参数
参数 |
是否必选 |
类型 |
说明 |
---|---|---|---|
indexname |
是 |
string |
索引名称。只能包含字母,数字,-和_。不能包含其他字符。索引名称的长度需在63字符以内。 |
indextype |
是 |
string |
索引的类型。区分大小写。“globalcompositevertexindex”为全局的composite类型的点索引。 |
haslabel |
否 |
string |
是否有label,默认为false。
|
indexproperty |
否(若haslabel为false或null,则该项为必选) |
string |
索引的属性列表。 可以创建索引的属性类型有: integer、 float、 double、 long、 enum、 char array、 string、 date。 |
如果属性类型为string或者char array,属性长度建议不要超过40个字节,超出的部分会被截断。
响应参数
参数 |
类型 |
说明 |
---|---|---|
errormessage |
string |
系统提示信息。
|
errorcode |
string |
系统提示信息。
|
jobid |
string |
执行该异步任务的jobid。
说明:
|
jobtype |
string |
执行该异步任务的jobtype。 |
result |
string |
成功时result值为success。 |
响应示例
状态码: 200
成功响应示例
http status code: 200 { "jobid": "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232", "jobtype": 8 }
状态码: 400
失败响应示例
http status code: 400 { "errormessage": "graph [demo] is not found", "errorcode": "ges.8603" }
状态码
返回值 |
说明 |
---|---|
400 bad request |
请求错误。 |
401 unauthorized |
鉴权失败。 |
403 forbidden |
没有操作权限。 |
404 not found |
找不到资源。 |
500 internal server error |
服务内部错误。 |
503 service unavailable |
服务不可用。 |
错误码
请参见。
意见反馈
文档内容是否对您有帮助?
如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨