Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support P.textcontains() for rest-api query #1312

Merged
merged 1 commit into from
Jan 5, 2021
Merged

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Dec 25, 2020

how to use:
/graphs/hugegraph/graph/vertices?properties={"city": "P.textcontains(\"shanghai\")"}

note query format by gremlin: g.V().has("city", Text.contains("shanghai"))

improve: #1309
Change-Id: I2d7c0b8c58c6ac53cd6b99414859cb0510393f6c

how to use:
/graphs/hugegraph/graph/vertices?properties={"city":"P.textcontains(\"shanghai\")"}

improve: #1309
Change-Id: I2d7c0b8c58c6ac53cd6b99414859cb0510393f6c
@javeme
Copy link
Contributor Author

javeme commented Dec 25, 2020

init test data:

graph.schema().propertyKey('name').asText().ifNotExist().create();
graph.schema().propertyKey('city').asText().ifNotExist().create();
graph.schema().vertexLabel('person').properties('name','city').useCustomizeNumberId().ifNotExist().create();
graph.schema().indexLabel('personByName').secondary().onV('person').by('name').ifNotExist().create();
graph.schema().indexLabel('personByCity').search().onV('person').by('city').ifNotExist().create();
g.addV('person').property(id,1).property('name','Jermy').property('city','Beijing Haidian')
 .addV('person').property(id,2).property('name','jleaf').property('city','Shanghai Zhangjiang')
 .addV('person').property(id,3).property('name','jewel').property('city','Shanghai Pudong');

test api:
http://127.0.0.1:8080/graphs/hugegraph/graph/vertices?limit=10&properties={"city":"P.textcontains(\"shanghai\")"}

@codecov
Copy link

codecov bot commented Dec 25, 2020

Codecov Report

Merging #1312 (2b19239) into master (f6c9850) will increase coverage by 0.64%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1312      +/-   ##
============================================
+ Coverage     61.67%   62.32%   +0.64%     
- Complexity     5752     5772      +20     
============================================
  Files           377      377              
  Lines         31501    31510       +9     
  Branches       4413     4413              
============================================
+ Hits          19428    19638     +210     
+ Misses        10088     9878     -210     
- Partials       1985     1994       +9     
Impacted Files Coverage Δ Complexity Δ
...a/com/baidu/hugegraph/backend/query/Condition.java 78.10% <0.00%> (-0.29%) 32.00 <0.00> (ø)
...du/hugegraph/backend/tx/GraphIndexTransaction.java 81.13% <0.00%> (-0.19%) 203.00 <0.00> (ø)
...baidu/hugegraph/traversal/optimize/ConditionP.java 57.14% <ø> (ø) 3.00 <0.00> (ø)
...du/hugegraph/traversal/optimize/TraversalUtil.java 56.65% <0.00%> (-0.62%) 122.00 <0.00> (ø)
.../baidu/hugegraph/backend/query/ConditionQuery.java 86.40% <0.00%> (+0.40%) 106.00% <0.00%> (+1.00%)
.../backend/store/cassandra/CassandraSessionPool.java 57.14% <0.00%> (+1.02%) 11.00% <0.00%> (ø%)
...om/baidu/hugegraph/backend/store/BackendTable.java 73.33% <0.00%> (+48.50%) 11.00% <0.00%> (ø%)
...h/backend/store/scylladb/ScyllaDBTablesWithMV.java 96.03% <0.00%> (+96.03%) 10.00% <0.00%> (+10.00%)
...graph/backend/store/scylladb/ScyllaDBFeatures.java 100.00% <0.00%> (+100.00%) 3.00% <0.00%> (+3.00%)
.../backend/store/scylladb/ScyllaDBStoreProvider.java 100.00% <0.00%> (+100.00%) 7.00% <0.00%> (+7.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6c9850...2b19239. Read the comment docs.

@zhoney zhoney merged commit 26ac664 into master Jan 5, 2021
@zhoney zhoney deleted the rest-query-textContains branch January 5, 2021 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants