unipop
unipop copied to clipboard
g.V().hasLabel("USER").limit(2).id().toList() can't work
fragment of the mapping file:
"vertices": [
{
"index": "*",
"id": "@user",
"label": "USER",
"properties": {
"user": "@user"
}
},
code:
System.out.println(g.V().hasLabel("USER").id().limit(2).toList());
System.out.println(g.V().hasLabel("USER").limit(2).id().toList());
System.out.println(g.V().has("user").id().limit(2).toList());
System.out.println(g.V().has("user").limit(2).id().toList());
System.out.println(g.V().hasLabel("USER").valueMap().limit(2).toList());
System.out.println(g.V().hasLabel("USER").limit(2).valueMap().toList());
System.out.println(g.V().has("user").valueMap().limit(2).toList());
System.out.println(g.V().has("user").limit(2).valueMap().toList());
output:
[Tom, Rose]
[]
[Tom, Rose]
[Tom, Rose]
[{user=[Tom]}, {user=[Rose]}]
[]
[{user=[Tom]}, {user=[Rose]}]
[{user=[Tom]}, {user=[Rose]}]
Problem: Why are these two queries that don't work?
g.V().hasLabel("USER").limit(2).id().toList()
g.V().hasLabel("USER").limit(2).valueMap().toList()
Both queries work for me using your mapping can you provide me with sample data from your es cluster?
And these:
System.out.println(g.V().hasLabel("USER").toList()); // ok
System.out.println(g.V().hasLabel("USER").limit(2).toList()); // got nothing
System.out.println(g.V("小明").valueMap().toList()); // got nothing
System.out.println(g.V("Tom").valueMap().toList()); // ok
The special thing of my data is: some user named in chinese.
Maybe it's because the field "USER" has been analyzed into tokens. We found that if a string field is setted with "not_analyzed", the queries are right.
This was probably the issue is it OK to close?
I think this is a bug that needs fixing. It should support the analyzed fields.