Closed SteamShon closed 8 years ago
test data
curl -XPOST localhost:9000/graphs/edges/insert -H 'Content-Type: Application/json' -d '
[
{"timestamp": 1, "from": 10001, "to": 10, "label": "s2graph_label_test_weak", "props": {"time": 10}},
{"timestamp": 1, "from": 10001, "to": 11, "label": "s2graph_label_test_weak", "props": {"time": 20}},
{"timestamp": 2, "from": 10001, "to": 12, "label": "s2graph_label_test_weak", "props": {"time": 30}},
{"timestamp": 3, "from": 10001, "to": 13, "label": "s2graph_label_test_weak", "props": {"time": 40}},
{"timestamp": 1, "from": 10002, "to": 11, "label": "s2graph_label_test_weak", "props": {"time": 10}},
{"timestamp": 2, "from": 10002, "to": 12, "label": "s2graph_label_test_weak", "props": {"time": -10}},
{"timestamp": 3, "from": 10002, "to": 13, "label": "s2graph_label_test_weak", "props": {"time": -30}}
]
'
and here is improved filterOut functions.
{
"select": [
"label",
"time"
],
"filterOutFields": [
"label",
"time"
],
"filterOut": {
"srcVertices": [
{
"serviceName": "s2graph",
"columnName": "user_id_test",
"id": 10002
}
],
"steps": [
{
"step": [
{
"label": "s2graph_label_test_weak",
"direction": "out",
"offset": 0,
"limit": 10,
"duplicate": "raw"
}
]
}
]
},
"srcVertices": [
{
"serviceName": "s2graph",
"columnName": "user_id_test",
"id": 10001
}
],
"steps": [
{
"step": [
{
"label": "s2graph_label_test_weak",
"direction": "out",
"offset": 0,
"limit": 10,
"duplicate": "raw"
}
]
}
]
}
then expected result would be edges start from 10001, and time in (20, 30, 40)
{
"size": 3,
"degrees": [],
"results": [
{
"label": "s2graph_label_test_weak",
"props": {
"weight": 0,
"timestamp": 3,
"is_blocked": false,
"is_hidden": false,
"time": 40
}
},
{
"label": "s2graph_label_test_weak",
"props": {
"weight": 0,
"timestamp": 2,
"is_blocked": false,
"is_hidden": false,
"time": 30
}
},
{
"label": "s2graph_label_test_weak",
"props": {
"weight": 0,
"timestamp": 1,
"is_blocked": false,
"is_hidden": false,
"time": 20
}
}
],
"impressionId": 1972178414
}
This issue is resolved by https://github.com/kakao/s2graph/pull/134
current implementation only cares about _to field value for filtering out. (https://github.com/kakao/s2graph/blob/develop/app/controllers/PostProcess.scala#L73)
maybe it is more intuitive to filterout queryResult based on (from, label, dir, to) which is reference of edge.