Bitbucket search syntax

This page explains Bitbucket Data Center and Server's search syntax to help you find exactly what you're looking for. 

考慮事項

検索の実行ではいくつかの制限事項があります。

  • Searches may include "." and "_", but all other punctuation characters are ignored. (e.g. !"#$%&'()*+,-/:;<=>?@[\]^`{|}~)
  • To search for multiple words in exact order, put them in quotes (e.g. "find this phrase"). As with other queries, all punctuation except "." and "_" is ignored (e.g. "find-this-phrase" effectively searches for "find this phrase").
  • Only the default branch is searchable (for most repositories the default branch will be master or main).
  • Wildcard searches (e.g. qu?ck buil*) and regular expressions in queries are not supported.
  • Single characters within search terms are ignored as they’re not indexed by Bitbucket for performance reasons (e.g. searching for “foo a bar” is the same as searching for just “foo bar” as the character “a” in the search is ignored).
  • 大文字と小文字は区別されません (ただし、検索演算子はすべて大文字にする必要があります)。
  • クエリには最大で 9 つの式 (単語と演算子の組み合わせ) を設定できます。
  • クエリの長さを 250 文字以上にすることはできません。
  • 512 KiB 未満のファイルのみを検索できます。
  • 閲覧権限を持っているコードのみが検索結果に表示されます。

A query in Bitbucket has to contain at least one search term, which can either be a single word or a phrase surrounded by quotes.

演算子

検索演算子は、検索に追加できる、検索結果の絞り込みに役立つ単語です。演算子はすべて大文字にする必要があります。ファイルの検索には次の検索演算子を使用できます。

  • AND
  • OR
  • NOT
  • -
  • (  )

Multiple terms can be used, and they form a boolean query that implicitly uses the AND operator. So a query for "bitbucket server" is equivalent to   "bitbucket AND server".

用語クエリ例用途
ANDbitbucket AND serverMatches files that contain both "bitbucket" and "server".
ORbitbucket OR serverMatches files that contain either "bitbucket" or "server" (or both).
NOTbitbucket NOT jiraMatches files that contain "bitbucket" but don't contain "jira".
-bitbucket -jiraUse before a term, matches files that contain "bitbucket" but don't contain "jira".
( )bitbucket AND (server OR cloud)

Matches files that contain "bitbucket" and either "server" or "cloud"

修飾子

Modifiers can be used to further restrict search results. Use a modifier in the form "key:value". If there are multiple modifiers in a query they are implicitly combined using "AND" and apply to the whole search expression. These are the search modifiers that can be used to search for files.

リポジトリおよびプロジェクト修飾子

repo: <reponame> or repository: <reponame>

Search within a particular repository. Must be used with a project: modifier.

用語クエリ例用途
repo:

jira repo:bitbucket
project:atlassian

または

jira repository:bitbucket
project:atlassian 

または

jira repo:atlassian/bitbucket

Matches files within the "bitbucket" repository within the "atlassian" project that contain the term "jira".


project: <プロジェクト キー / 名前>

特定のプロジェクト内のすべてのリポジトリで、検索語を検索します。

用語クエリ例用途
project:

jira project:atlassian 

Matches files within the "atlassian" project that contain the term "jira".

パス修飾子

path: <directory or file name>

Restrict search to only consider files with the search term in their path.

用語クエリ例用途
path:react path:frontendMatches files within directories named frontend containing the term react.

react path:frontend/*/package.lockMatches package.lock files within directories named frontend containing the term react.

言語およびファイル拡張子の修飾子

lang: or language: <language>

Code search can be restricted to only consider a particular language or a particular file extension. For some languages adding a lang criteria is equivalent to specifying the file extension. For example, "lang:java" is equivalent to "ext:java". For other languages multiple file extensions are mapped to a single language. For example, ".hs", ".lhs" and ".hs-bootare" file extensions are used for the Haskell programming language, and will be matched when specifying "lang:haskell".

用語クエリ例用途
lang: 

jira lang:java

または

jira language:java

Matches files that contain the term "jira" within Java files, files with .java, .class, or .jar extension.
ext: or extension: <file extension>
用語クエリ例用途
ext:

jira ext:lhs

または

jira extension:lhs

Matches files that contain the term "jira" within Haskell files with the .lhs extension.


フォーク修飾子

fork: <true or false>

リポジトリの検索結果をフォークかどうかに基づいて除外します。

用語クエリ例用途
fork:fork:trueフォークであるリポジトリからの結果のみを含めます。

fork:false
フォークではないリポジトリからの結果のみを含めます。
最終更新日 2022 年 5 月 9 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.