请考虑以下json响应。
如果运行图形查询g.V().hasLabel('customer'),响应是:
[
{
"id": "75b9bddc-4008-43d7-a24c-8b138735a36a",
"label": "customer",
"type": "vertex",
"properties": {
"partitionKey": [
{
"id": "75b9bddc-4008-43d7-a24c-8b138735a36a|partitionKey",
"value": 1
}
]
}
}
]如果运行sql查询select * from c where c.label = 'customer',响应是:
[
{
"label": "customer",
"partitionKey": 1,
"id": "75b9bddc-4008-43d7-a24c-8b138735a36a",
"_rid": "0osWAOso6VYBAAAAAAAAAA==",
"_self": "dbs/0osWAA==/colls/0osWAOso6VY=/docs/0osWAOso6VYBAAAAAAAAAA==/",
"_etag": "\"2400985f-0000-0c00-0000-5e2066190000\"",
"_attachments": "attachments/",
"_ts": 1579181593
}
]Q:在partitionKey部分的结构上存在差异,在索引策略中应该将其引用为/properties/partitionKey/*还是/partitionKey/??
目前我用.
{
"indexingMode": "consistent",
"automatic": true,
"includedPaths": [{
"path": "/properties/partitionKey/*"
},{
"path": "/partitionKey/?"
},{
"path": "/label/?"
}
],
"excludedPaths": [{
"path": "/*"
},{
"path": "/\"_etag\"/?"
}
]
}蒂娅!
发布于 2020-01-16 18:51:28
这应该作为"/partitionKey“存储在索引策略中,而不是"/properties/partitionKey”
顺便说一句,这里要指出的另一件事是,通常情况下,最好只排除您永远不会查询的路径,而不是包含您将查询的路径。这样,如果将属性添加到图形中,就不必重新构建索引来查询新属性。
https://stackoverflow.com/questions/59771407
复制相似问题