z-yuxie commented on issue #2753: URL: https://github.com/apache/incubator-hugegraph/issues/2753#issuecomment-2801359682
> Hello [@z-yuxie](https://github.com/z-yuxie)! I'm here to help you with any bugs or questions you have. Feel free to ask anything while you wait for a human maintainer. > > To match nodes or edges based on a value within a set or list property in HugeGraph, you need to use the `CONTAINS` or `TEXT_CONTAINS` operators. These operators are specifically designed for querying properties with cardinality of `SET` or `LIST`. Here's how you can use them in your Gremlin query: > > 1. **Ensure Search Index is Configured**: First, make sure that a Search index is configured for the `alias` property. This is necessary for using full-text search capabilities like `CONTAINS` or `TEXT_CONTAINS`. > 2. **Use the Correct Query Syntax**: Modify your Gremlin query to use the `CONTAINS` operator. For example, to find vertices where the `alias` property contains a specific value, you can use: > g.V().hasLabel("org").has("alias", CONTAINS, "广州软件").limit(10) > > > Alternatively, if you want to use `TEXT_CONTAINS`, the syntax would be: > g.V().hasLabel("org").has("alias", TEXT_CONTAINS, "广州软件").limit(10) > > These operators will allow you to match vertices based on the presence of a specific value within the `alias` set property. Ensure that the index type for `alias` supports these operations, as secondary indices are typically used for such queries [[1]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/ConditionP.java)[[2]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/Condition.java). > > _To continue talking to [Dosu](https://dosu.dev), mention [@dosu](https://github.com/dosu)._ > > Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/feb61db2-0b8e-4605-806e-e835a95e3417?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/feb61db2-0b8e-4605-806e-e835a95e3417?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/feb61db2-0b8e-4605-806e-e835a95e3417?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/feb61db2-0b8e-4605-806e-e835a95e3417?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/feb61db2-0b8e-4605-806e-e835a95e3417?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/feb61db2-0b8e-4605-806e-e835a95e3417?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/feb61db2-0b8e-4605-806e-e835a95e3417?feedback_type=other) 使用上述建议方法得到了新的报错提示: 开始执行HugeGraph查询测试... 执行Gremlin查询: g.V().hasLabel('org').has('alias', CONTAINS, '广州软件') 执行Gremlin查询时发生错误: No such property: CONTAINS for class: Script128 查询耗时: 140ms 查询结果数量: 0 开始执行HugeGraph查询测试... 执行Gremlin查询: g.V().hasLabel('org').has('alias', TEXT_CONTAINS, '广州软件') 执行Gremlin查询时发生错误: No such property: TEXT_CONTAINS for class: Script129 查询耗时: 101ms 查询结果数量: 0 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
