Code search in Bitbucket Server
we are pleased to share the news, which I hope will please some of the readers of Habra: Bitbucket Server here will be able to search through the code. A few days went release for the early access program (EAP).
I'll start with the free translation handling product Manager, published in blog Atlassian
How often has it happened to you: you see the error message, but don't know which part of the code it occurs, or do you know the name of the function, but not the repository, the code in which it is defined. Many of you requested add to Bitbucket Server search code, and I am pleased to report that your wait is coming to an end. Today we invite our users to try out search by code in Bitbucket Server using early access program (EAP). Now you can search and find the right code using the search string:
How it works?
We understand that many of the command huge amount of code. So we made it so that you can easily limit search results to a particular project or repository by using the search filters. You can also look for code in the specified language (for example,lang:java
) or in files with a specific extension (for example,ext:css
).
The operatorsAND
,OR
andNOT
will help to clarify the request, they are useful to further filter search results in the case where too many of them.
What to do to get started?
I'm glad you asked! Here you can redownload Bitbucket Server EAP-enabled search for the code, and with the launch and adjustment needs to help prepared by us step by step guide. We will appreciate if you will tell about your impressions of EAP distro — your feedback is important to us. Filling this short and simple questionnaire, you will help us improve the searching for you and other users to the Bitbucket its official release.
We are working to soon to please you with great opportunities. Happy searching!
the Stephen king
TL;DR
In a brief retelling, the instruction on installation is the following steps:
-
the
- to Install Git and Perl (about installing Git more tut) the
- Download the desired distribution from the page EAP the
- Run the installer (in the case of using ZIP distribution before starting the Bitbucket Server will have to manually perform a few preliminary steps) the
- Go through the setup procedure and wait for the launch of the Bitbucket Server the
- ??? the
- PROFIT!!!
How search?
As you can see from the help pages and content distribution, storage index, which osushestvlyaetsya search used Elasticsearch. He, in turn, is based on a famous library Apache Lucene.
In Bitbucket Server search provide two modules: the first deals with the indexation of repositories, the second serves search requests from users. Indexing happens continuously in the background. If you updating Bitbucket Server, which already contains a certain number of repositories, the initial indexing may take some time, however once it is complete, subsequent changes are processed very quickly. It should be noted that the search is available immediately, but while there is indexing, the results may be incomplete. In addition, to optimize performance introduced a small delay between the moment of changing the repository (e.g., commit new code) and the moment when the change is reflected in the search results. By default, this delay can be up to 15 seconds.
Installation procedure, compared to previous versions of the Bitbucket Server, has not changed: all of the configuration steps required for a search operation are performed automatically. At the same time, not necessarily to use the embedded Elasticsearch instance: if you want, you can set the desired configuration yourself.
What to look for?
Search has a number of limitations:
the
-
the
- index only files of the main branches (in most repositories it is
master
, although this is not a rule)
the - Indexed text files smaller than 512 KB the
- doesn't support search by mask (e.g.
qu?ck buil*
)
the - you cannot search for regular expressions the
- All punctuation marks are removed from the query the
- case insensitive Search the
- query cannot be more than ten expressions — combinations of terms and operators the
- Maximum query length limited to 250 characters
Search query must contain at least one term that can be a word or quoted phrase.
Operators
Operators can be added to the query to Refine the search. Here is their current list:
the the the the the the
Operator | Example | Value |
---|---|---|
AND |
bitbucket AND server |
Corresponds to the files that contain both words "bitbucket" and "server" |
OR |
bitbucket OR server |
Corresponds to the files that contain at least one of the words "bitbucket" or "server" |
NOT |
NOT jira-bitbucket |
Corresponds to the files that contain the word "bitbucket", but not containing the word "jira" |
- |
bitbucket -jira |
is Used in front of the Terme; match files that contain the word "bitbucket", but not containing the word "jira" |
( ) |
bitbucket AND (server OR cloud) |
Corresponds to the files that contain the word "bitbucket" and any of the words "server" or "cloud" |
the Query may contain multiple terms, and by default, they are implicitly combined using the logical operators AND
. That is, the query bitbucket server
is equivalent to bitbucket AND server
.
Modifiers
Modifiers help to narrow the search. They are written in the format modifier:
. If the query contains multiple modifiers, they are implicitly combined using the operator AND
and apply to the entire expression. At the moment supported by the following modifiers:
the
-
the
repo:
orrepository:<clase>
— search a specific repository. Requires a modifierproj:
that identifies the project. For example, to find files in the repository "bitbucket" project "atlassian", that contain the word "jira", you can use any of the following search queries:
the-
the
jira repo:bitbucket proj:atlassian
the jira repository:bitbucket project:atlassian
the repo jira:atlassian/bitbucket
the proj:
orproject<clact/Lucie>
— search in all repositories of a particular project. For example, to find files in a project "atlassian", containing the word "jira", you can use any of these search queries:
the-
the
proj jira:atlassian
the jira project:atlassian
Modifiers the extension and language file
the Search can be restricted to the languages and file extensions. For some languages, these two criteria are identical: for example, the modifiers lang:clojure
and ext:clj
will lead to the same result. However, there are languages that correspond to several extensions: for example, the extension .hs
and .lhs
are used in Haskell, and files with any of these extensions will be included in the search results with a modifier lang:haskell
.
the
-
the
lang:
orlanguage:<language>
— search files for a specific language. The language corresponds to the set of extensions. For example, the following queries will find the file in LaTeX format (i.e., with the extension.ltx
,.tex
or.text
) that contain the word "jira"
thelang jira:latex
the jira language:latex
the
ext:
or extension:<rasshireniye>
— search files with a specific extension. For example, to find files that contain "jira" and has the extension .lhs
, you can use any of these queries:the
-
the
jira ext:lhs
the jira extension:lhs
In any case, I note that the instructions on the help pages in the near future will be further developed to make the procedures of installation, configuration and use of search in Bitbucket Server even better. Let me remind you that your comments regarding any aspects of the use of EAP release warmly welcome.
For me, this news is especially pleasant and important because I participate directly in the development of search. I will be glad to answer any questions and comments.
Комментарии
Отправить комментарий