Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

Bug searching by repository name with a dot in the name

When a repository has a dot in the name, like `this-is-my.new-repository`, the search doesn't work when you search for the word after the dot.

  • [NO OK] Search: new
  • [OK] Search: this
  • [OK] Search: is
  • [OK] Search: my
  • [OK] Search: this-is-my
  • [OK] Search: my.new
  • [OK] Search: this-is-my.new-repository

Looking for why this happens, it is because of the indexation of the name into ElasticSearch. Bitbucket is using a field that is not tokenized, so the search will work only for full match of the field or match of the words separated by hyphen or underscore, but doesn't for dots. In Elasticsearch, for fields of type string, the word before the dot, the dot and the word after the dot is tokenized as a full word. So you for the repository name used before, Elasitcsearch will tokenize into this words:

  • this
  • is
  • my.new
  • repository

 

Here you can see the query executed by Bitbucket to find projects and repositories by name.

Query executed to find the repository name in Elasticsearch

{
"from": 0,
"size": 25,
"query":
{
"bool":
{
"should": [
{
"function_score":
{
"query":
{
"bool":
{
"filter": [
{
"term":
{
"quickSearchProjectName":
{
"value": "new",
"boost": 1.0
}
}
}],
"disable_coord": false,
"adjust_pure_negative": true,
"boost": 1.0
}
},
"functions": [
{
"filter":
{
"match_all":
{
"boost": 1.0
}
},
"weight": 1.5,
"field_value_factor":
{
"field": "quickSearchProjectName.length",
"factor": 1.0,
"modifier": "reciprocal"
}
}],
"score_mode": "multiply",
"boost_mode": "replace",
"max_boost": 3.4028235E38,
"boost": 1.0
}
},
{
"function_score":
{
"query":
{
"bool":
{
"filter": [
{
"term":
{
"quickSearchRepositoryName":
{
"value": "new",
"boost": 1.0
}
}
}],
"disable_coord": false,
"adjust_pure_negative": true,
"boost": 1.0
}
},
"functions": [
{
"filter":
{
"match_all":
{
"boost": 1.0
}
},
"weight": 5.0,
"field_value_factor":
{
"field": "quickSearchRepositoryName.length",
"factor": 1.0,
"modifier": "reciprocal"
}
}],
"score_mode": "multiply",
"boost_mode": "replace",
"max_boost": 3.4028235E38,
"boost": 1.0
}
}],
"disable_coord": false,
"adjust_pure_negative": true,
"boost": 1.0
}
},
"sort": [
{
"_score":
{
"order": "desc"
}
},
{
"quickSearchProjectName.raw":
{
"order": "asc"
}
},
{
"quickSearchRepositoryName.raw":
{
"order": "asc"
}
}]
}

 

2 comments

Hi @aferrandini_vocento,

Thanks for your detailed report (awesome job there).

 

With the Bitbucket Server release 5.7, we have introduced some functionalities to support "Punctuation aware code search". However, this was mainly focusing around the search in the code and not the project or repository name. Here is the link to the request for more details:

BSERV-8782 - Punctuation aware code search

 

Could you share which version of Bitbucket Server you are using so that I can do some testing and confirm if we already have a request around this or raise one for you?

 

Cheers,

Caterina - Atlassian

Hi @Caterina Curti

We are using v5.8.1 in production, but this bug also happens in v5.11.1, the version I used to reproduce in and extract the logs and the queries.

 

Have a nice week :),

Ariel - Vocento

Hi, any news about this?

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,615 views 0 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you