WindowsでMSSQLバックエンドを使用してSonarQube 5.3を実行しています。SonarQubeが不正な(?)ElasticSearchクエリを使用してScmAccountToUserを取得します
新しい問題を作成するときに、SonarQubeはそのElasticSearchユーザーインデックスを照会し、問題を示す行の "git blame"情報の作成者ログインを取得します。
以下は/server/sonar-server/src/main/java/org/sonar/server/computation/issue/IssueAssigner.javaで起こる:
=> "gitの責任" の情報は、著者を返します。影響を受けた行の、(匿名化)私の例では:
steve [email protected]
=>この値は、レイジーElasticSearchインデックス「ユーザー」を照会ScmAccountToUser、中に検索されます。
{
"size": 3,
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"bool": {
"must": {
"term": {
"active": true
}
},
"should": [
{
"term": {
"login": "steve [email protected]"
}
},
{
"term": {
"email": "steve [email protected]"
}
},
{
"term": {
"scmAccounts": "steve [email protected]"
}
}
]
}
}
}
}
}
このクエリは0の結果を返します。
{ -
"took": 4,
"timed_out": false,
"_shards": { -
"total": 5,
"successful": 5,
"failed": 0
},
"hits": { -
"total": 39,
"max_score": 1,
"hits": [ -
{ -
// snip
},
// snip
{ -
"_index": "users",
"_type": "user",
"_id": "steve.smith",
"_score": 1,
"_source": { -
"createdAt": 1442988141642,
"name": "Steve Smith",
"active": true,
"login": "steve.smith",
"scmAccounts": [ -
"
",
"steve [email protected]
",
"[email protected]
"
],
"email": "[email protected]",
"updatedAt": 1450088380632
}
},
// snip
]
}
}
この問題は、現在の私のSonarQubeインスタンスを妨げている問題の多くを自動割り当て:私は、全体の指数を列挙するとき
は対照的に、私は一般的にが試合は、このユーザーすべきヒットを取得します。私は、以前に成功したオートアサインメントのように、いつ、どのように壊れたかを把握しています。
これはクエリまたはデータでエラーですか?どういうわけかこの問題を回避することはできますか?
'scmAccounts'フィールドのマッピングは何ですか? 'not_analyzed'文字列フィールドでなければ、それが理由です。異なる、 // ... - { "ストリング" "インデックス" ::: "not_analyzed"、 "タイプ"} // ... "scmAccountsを": – Val
マッピングが指定し他のフィールドから、例えばログイン: "ログイン":{ - "インデックス": "not_analyzed"、 "タイプ": "文字列"、 "フィールド":{ - "ngrams":{ - "search_analyzer": "search_ngrams" 、 "index_analyzer": "index_ngrams"、 "タイプ": "文字列" }} }、 これは、マッピングの設定ミスですか?私はすでにインデックスを完全に復元しているので、問題は引き続き表示されます。 – ThePadawan
根本原因はscmアカウントの空白のようです。あなたは確認しますか? –