Call POST request for https://<bitbucket_server>/rest/search/latest/search endpoint:
Option 1: with parameters {"query":"\"<file_name_with_extension>\"","entities":{"code":{"start":1,"limit":10}}}
OR
Option 2: with parameters {"query":"<part_of_file_name> ext:<file_extension>","entities":{"code":{"start":1,"limit":10}}}
where start is page number, limit is number of the results on the page.
In my case I used Option 2, because I needed to search file containing some keyword in the name.
This request returns JSON.
UPD 17th Feb: mentioned above search happens in default branches only. So, if you need to search in all branches, then there is option to go through all files in each branch.
发布评论
评论(1)
我找到了BitBucket服务器的此选项:
call
发布
请求https:///lt; bitbucket_server&gt;/rest/reast/search/search/最终/search/search
endpoint选项1: 带有参数
{“ query”:“ \”&lt; file_name_with_extension&gt; \; \“”,“ entities”:{“ code”:{“ start”:1,“ limit”:10}}}}}}}}}}} < /code>
或
选项2:带有参数
{“ query”:“&lt; part_of_file_name&gt; ext:&lt; file_extension&gt;“,“ entities”,“ entities”:{“ code”:“ code”:“ :1,“限制”:10}}}
其中
开始
是页码,limit
是页面上结果的数字。在我的情况下,我使用了选项2,因为我需要在名称中搜索包含一些关键字的文件。
此请求返回JSON。
UPD 2月17日:上面提到的搜索仅在默认分支中发生。因此,如果您需要在所有分支中进行搜索,则可以选择通过每个分支中的所有文件。
I found this option for Bitbucket Server:
Call
POST
request forhttps://<bitbucket_server>/rest/search/latest/search
endpoint:Option 1: with parameters
{"query":"\"<file_name_with_extension>\"","entities":{"code":{"start":1,"limit":10}}}
OR
Option 2: with parameters
{"query":"<part_of_file_name> ext:<file_extension>","entities":{"code":{"start":1,"limit":10}}}
where
start
is page number,limit
is number of the results on the page.In my case I used Option 2, because I needed to search file containing some keyword in the name.
This request returns JSON.
UPD 17th Feb: mentioned above search happens in default branches only. So, if you need to search in all branches, then there is option to go through all files in each branch.