dosubot[bot] commented on issue #2753:
URL:
https://github.com/apache/incubator-hugegraph/issues/2753#issuecomment-2801352823
<!-- Greeting -->
Hello @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.
<!-- Answer -->
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:
```java
g.V().hasLabel("org").has("alias", CONTAINS, "广州软件").limit(10)
```
Alternatively, if you want to use `TEXT_CONTAINS`, the syntax would be:
```java
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
<sup>[[1]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/ConditionP.java)</sup><sup>[[2]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/Condition.java)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>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)</sup>
--
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]