使用 AND 运算符
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您可以使用 AND
运算符搜索多个字词。仅当运算符两侧的字词条件都为真时,此运算符才会返回结果。
搜索多个字词时隐式使用 AND
。例如,以下搜索返回包含术语 server
的 Python 文件:
server lang:python
或者,您也可以显式提供 AND 运算符。例如:
server AND lang:python
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eMultiple terms in a search are implicitly linked by \u003ccode\u003eAND\u003c/code\u003e, meaning results must contain all terms.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAND\u003c/code\u003e can be explicitly used for clarity but functions identically to implicit multiple term searches.\u003c/p\u003e\n"],["\u003cp\u003eSearches can use operators like \u003ccode\u003elang:\u003c/code\u003e to refine results based on specific criteria such as programming language.\u003c/p\u003e\n"]]],[],null,["# Using the AND operator\n\nYou can search for multiple terms by using the [`AND`](../reference#operators)\noperator. This operator returns results only when the terms on both sides of the\noperator are true.\n\nA search for multiple terms uses `AND` implicitly. For example, the following\nsearch returns Python files that contain the term `server`: \n\n server lang:python\n\nAlternatively, you can supply the AND operator explicitly. For example: \n\n server AND lang:python"]]