From 1e891198b73c284a16d4f51ec59702afa1e33532 Mon Sep 17 00:00:00 2001 From: Simon Let Date: Fri, 8 May 2020 21:59:48 +0200 Subject: [PATCH] make query a bit more important in score --- cmd/cli/item.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/cli/item.go b/cmd/cli/item.go index b30c513..1d1fb24 100644 --- a/cmd/cli/item.go +++ b/cmd/cli/item.go @@ -115,6 +115,7 @@ func (i item) drawItemColumns(compactRendering bool) itemColumns { if debug { hitsStr := fmt.Sprintf("%.1f", i.score) flags += " S" + hitsStr + flagsWithColor += " S" + hitsStr } if i.sameGitRepo { flags += " G" @@ -218,12 +219,12 @@ func properMatch(str, term, padChar string) bool { // newItemFromRecordForQuery creates new item from record based on given query // returns error if the query doesn't match the record func newItemFromRecordForQuery(record records.CliRecord, query query, debug bool) (item, error) { - const hitScore = 1.0 + const hitScore = 1.2 const hitScoreConsecutive = 0.1 const properMatchScore = 0.3 const actualPwdScore = 0.9 - const nonZeroExitCodeScorePenalty = 0.5 - const sameGitRepoScore = 0.7 + const nonZeroExitCodeScorePenalty = 0.4 + const sameGitRepoScore = 0.6 // const sameGitRepoScoreExtra = 0.0 const differentHostScorePenalty = 0.2