dosubot[bot] commented on issue #2788: URL: https://github.com/apache/incubator-hugegraph/issues/2788#issuecomment-2953808264
<!-- Answer --> ConditionP.contains 只支持单个参数(即每次只能判断集合中是否包含某一个值),不支持一次匹配多个参数(比如“涉案”或“涉诈”)[源码实现参考](https://github.com/apache/incubator-hugegraph/blob/337dc86567834acd717a2240a79fef2815d4bb6f/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/ConditionP.java)。 如果你要匹配多个值,可以用 or 组合多个条件,例如: ```groovy .has("tags", ConditionP.contains("涉案")).or().has("tags", ConditionP.contains("涉诈")) ``` 或者在 where 里用 __.or(...) 组合: ```groovy .where( __.or( has("tags", ConditionP.contains("涉案")), has("tags", ConditionP.contains("涉诈")) ) ) ``` 这样可以实现“tags 包含其中任意一个值”的效果。如果还有其他需求可以继续问! <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/97255deb-f3ff-41b1-8183-28b0967244a7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/97255deb-f3ff-41b1-8183-28b0967244a7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/97255deb-f3ff-41b1-8183-28b0967244a7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/97255deb-f3ff-41b1-8183-28b0967244a7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/97255deb-f3ff-41b1-8183-28b0967244a7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/97255deb-f3ff-41b1-8183-28b0967244a7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/97255deb-f3ff-41b1-8183-28b0967244a7?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [! [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/2788) -- 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]
