dosubot[bot] commented on issue #2780:
URL: 
https://github.com/apache/incubator-hugegraph/issues/2780#issuecomment-2921165718

   <!-- Answer -->
   HugeGraph 的 properties 支持多种比较操作符,包括你提到的 `=`, `>`, `<`, `!=`, `in`, 以及 
`contains` 等。这些操作符在 HugeGraph 的查询系统中有明确实现,例如:
   
   - `=`(等于):如 `"city": "Beijing"`
   - `>`(大于):如 `"age": {">": 20}`
   - `<`(小于):如 `"age": {"<": 30}`
   - `!=`(不等于):如 `"name": {"!=": "Alice"}`
   - `in`(在列表中):如 `"age": {"in": [20, 30]}`
   - `contains`(集合属性包含):如 `"tags": {"contains": "VIP"}`
   
   这些操作符在 HugeGraph 的底层通过 `Condition.java` 中的 `RelationType` 枚举实现,支持 EQ (`==`), 
GT (`>`), GTE (`>=`), LT (`<`), LTE (`<=`), NEQ (`!=`), IN (`in`), NOT_IN 
(`notin`), CONTAINS (`contains`), TEXT_CONTAINS (`textcontains`) 
等多种操作符,适用于属性过滤和复杂查询需求。具体实现可参考 [Condition.java 
源码](https://github.com/apache/incubator-hugegraph/blob/337dc86567834acd717a2240a79fef2815d4bb6f/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/Condition.java)。
   
   对于集合属性(如 SET 或 LIST),可以使用 `CONTAINS` 或 `TEXT_CONTAINS` 操作符进行查询。例如,Gremlin 
查询中可以这样写:
   
   ```groovy
   g.V().hasLabel("org").has("alias", CONTAINS, "广州软件")
   ```
   
   需要注意,使用 `CONTAINS` 或 `TEXT_CONTAINS` 时,相关属性需建立 Search 
Index,否则无法生效。详细用法和注意事项可参考 [相关 issue 
讨论](https://github.com/apache/incubator-hugegraph/issues/2753)。
   
   此外,HugeGraph 
支持二级索引、范围索引、分片索引和全文索引,分别对应不同类型的属性过滤和检索场景,进一步提升查询灵活性和性能。更多索引类型说明见 
[这里](https://github.com/apache/incubator-hugegraph/discussions/2739)。
   
   如需具体语法或更多示例,可补充说明你的实际查询场景。
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/f2757565-87d4-4446-a4e5-bbb454c1f3cf?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/f2757565-87d4-4446-a4e5-bbb454c1f3cf?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/f2757565-87d4-4446-a4e5-bbb454c1f3cf?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/f2757565-87d4-4446-a4e5-bbb454c1f3cf?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/f2757565-87d4-4446-a4e5-bbb454c1f3cf?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/f2757565-87d4-4446-a4e5-bbb454c1f3cf?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/f2757565-87d4-4446-a4e5-bbb454c1f3cf?feedback_type=other)</sup>&nbsp;&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[!
 [Share on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-hugegraph/issues/2780)


-- 
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]

Reply via email to