• Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • None
    • None
    • 15
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Summary

      A repository can not be searched for with the word that comes after a underscore, '_', from the repository search field. You can search for any other words in the repository name.

      Environment

      Bitbucket 4.12 or 5.2.2 with built in ElasticSearch.

      Steps to Reproduce

      1. Create repository with the name first_second-third.
      2. Search for first or third in the repository search field to confirm the repository appears.
      3. Search for second in the repository search field.

      Expected Results

      A search for the the word "Second" would return the repository first_second-third.

      Actual Results

      first_second-third is not returned.

      Here are the results from ElasticSearch directly:

      curl -u bitbucket:<> -XPOST 'http://localhost:7992/bitbucket-search-v1/_search' -d '{"query":{"bool":{"should":[{"function_score":{"filter":{"term":{"quickSearchProjectName":"test"}},"field_value_factor":{"field":"quickSearchProjectName.length","modifier":"reciprocal"}}},{"function_score":{"filter":{"term":{"quickSearchRepositoryName":"first"}},"boost":5,"field_value_factor":{"field":"quickSearchRepositoryName.length","modifier":"reciprocal"}}}]}},"from":0,"size":9}'
      
      {"took":4,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.027238352,"hits":[{"_index":"bitbucket-search-v1","_type":"repository","_id":"155","_score":0.027238352,"_source":{"slug":"first_second-third","name":"first_second-third","quickSearchRepositoryName":"first_second-third","public":false,"fork":false,"quickSearchProjectName":"Underscore Test","projectId":124}}]}}
      
      curl -u bitbucket:<> -XPOST 'http://localhost:7992/bitbucket-search-v1/_search' -d '{"query":{"bool":{"should":[{"function_score":{"filter":{"term":{"quickSearchProjectName":"test"}},"field_value_factor":{"field":"quickSearchProjectName.length","modifier":"reciprocal"}}},{"function_score":{"filter":{"term":{"quickSearchRepositoryName":"second"}},"boost":5,"field_value_factor":{"field":"quickSearchRepositoryName.length","modifier":"reciprocal"}}}]}},"from":0,"size":9}'
      
      {"took":4,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
      
      curl -u bitbucket:<> -XPOST 'http://localhost:7992/bitbucket-search-v1/_search' -d '{"query":{"bool":{"should":[{"function_score":{"filter":{"term":{"quickSearchProjectName":"test"}},"field_value_factor":{"field":"quickSearchProjectName.length","modifier":"reciprocal"}}},{"function_score":{"filter":{"term":{"quickSearchRepositoryName":"third"}},"boost":5,"field_value_factor":{"field":"quickSearchRepositoryName.length","modifier":"reciprocal"}}}]}},"from":0,"size":9
      
      {"took":4,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.027238352,"hits":[{"_index":"bitbucket-search-v1","_type":"repository","_id":"155","_score":0.027238352,"_source":{"slug":"first_second-third","name":"first_second-third","quickSearchRepositoryName":"first_second-third","public":false,"fork":false,"quickSearchProjectName":"Underscore Test","projectId":124}}]}}
      

      Workaround

      Rename the repository with another character

            [BSERV-10033] Unable to search for repository for word after underscore

            Christian Glockner added a comment - https://getsupport.atlassian.com/browse/PS-138965

            I still experience this issue with Bitbucket v5.12.1 

            My problem is following: I have a repository client_showcase_npm_npm-scripts. I want to jump into the repository from the "Search for code, commits or repositories.." searchbox. I type in "%showcase". I get exactly 0 results. If I search for "%scripts" I do get this repository. 

            So this bugreport is not about the Code-search, it's about jumping into the repositories. This used to work with older Bitbucket (Without code search) and it still works in the dialog in Jira where I can create a new branch from a ticket. 

            Deleted Account (Inactive) added a comment - I still experience this issue with Bitbucket v5.12.1  My problem is following: I have a repository client_showcase_npm_npm-scripts . I want to jump into the repository from the "Search for code, commits or repositories.." searchbox. I type in "%showcase". I get exactly 0 results. If I search for "%scripts" I do get this repository.  So this bugreport is not about the Code-search, it's about jumping into the repositories. This used to work with older Bitbucket (Without code search) and it still works in the dialog in Jira where I can create a new branch from a ticket. 

            Abernacky added a comment -

            Note for anyone looking for this, it is supposed to be corrected in 5.7

            Abernacky added a comment - Note for anyone looking for this, it is supposed to be corrected in 5.7

            Mark Ellis added a comment - - edited

            Hey dlaser, currently this is by design. It's something we may revisit though at some point.

            Mark Ellis added a comment - - edited Hey dlaser , currently this is by design. It's something we may revisit though at some point.

              Unassigned Unassigned
              dlaser dlaser (Inactive)
              Votes:
              20 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated: