Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-10033

Unable to search for repository for word after underscore

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • None
    • None
    • 14
    • 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

              Unassigned Unassigned
              dlaser dlaser (Inactive)
              Votes:
              19 Vote for this issue
              Watchers:
              15 Start watching this issue

                Created:
                Updated: