diff --git a/contentprovider.go b/contentprovider.go index 71c8fb42c..45ebd3cfa 100644 --- a/contentprovider.go +++ b/contentprovider.go @@ -558,8 +558,9 @@ const ( // Used for ordering line and chunk matches within a file. scoreLineOrderFactor = 1.0 - scoreQueryAtomsCountFactor = 3000.0 - scoreQueryAtomsRunFactor = 1000.0 + scoreQueryContentAtomsCountFactor = 3000.0 + scoreQueryContentAtomsRunFactor = 1000.0 + scoreQueryFilenameAtomsCountFactor = 1000.0 ) // findSection checks whether a section defined by offset and size lies within diff --git a/internal/e2e/testdata/Repository_metadata_Write_rbac.txt b/internal/e2e/testdata/Repository_metadata_Write_rbac.txt index 0c8585fdd..381a830b8 100644 --- a/internal/e2e/testdata/Repository_metadata_Write_rbac.txt +++ b/internal/e2e/testdata/Repository_metadata_Write_rbac.txt @@ -14,18 +14,18 @@ github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/repository_metada 134:func (r *schemaResolver) DeleteRepoMetadata(ctx context.Context, args struct { hidden 30 more line matches -github.com/sourcegraph/sourcegraph/client/web/src/repo/tree/TreePageContent.tsx -666:interface RepositoryContributorNodeProps extends QuerySpec { -53:import { canWriteRepoMetadata } from '../../util/rbac' -213: const [enableRepositoryMetadata] = useFeatureFlag('repository-metadata', true) -hidden 46 more line matches - github.com/sourcegraph/sourcegraph/doc/admin/repo/metadata.md 1:# Custom repository metadata 18:## Adding metadata 8:### Repository owners hidden 14 more line matches +github.com/sourcegraph/sourcegraph/client/web/src/repo/tree/TreePageContent.tsx +666:interface RepositoryContributorNodeProps extends QuerySpec { +53:import { canWriteRepoMetadata } from '../../util/rbac' +213: const [enableRepositoryMetadata] = useFeatureFlag('repository-metadata', true) +hidden 46 more line matches + github.com/sourcegraph/sourcegraph/client/web/src/repo/repoContainerRoutes.tsx 3:import { canWriteRepoMetadata } from '../util/rbac' 24:const RepositoryMetadataPage = lazyComponent(() => import('./RepoMetadataPage'), 'RepoMetadataPage') diff --git a/internal/e2e/testdata/assets_are_not_configured_for_this_binary.txt b/internal/e2e/testdata/assets_are_not_configured_for_this_binary.txt index b3149d11b..ad1c2f9dc 100644 --- a/internal/e2e/testdata/assets_are_not_configured_for_this_binary.txt +++ b/internal/e2e/testdata/assets_are_not_configured_for_this_binary.txt @@ -14,18 +14,6 @@ github.com/sourcegraph/sourcegraph/schema/schema.go 1538:type Notifications struct { hidden 668 more line matches -github.com/sourcegraph/sourcegraph/doc/admin/executors/deploy_executors.md -118:## Confirm executors are working -194:### Configuring the auth config for use in executors -216:### Adding certificates to a binary deployment -hidden 47 more line matches - -github.com/sourcegraph/sourcegraph/doc/getting-started/github-vs-sourcegraph.md -8:## Which is best for you? -110:### Searching repositories, branches, and forks -28:For a high-level overview of how Sourcegraph compares to GitHub code search, see this [document](https://storage.googleapis.com/sourcegraph-assets/docs/PDFs/Sourcegraph%20vs.%20GitHub%20code%20search%20chart.pdf). -hidden 66 more line matches - github.com/sourcegraph/sourcegraph/doc/admin/executors/deploy_executors_terraform.md 1:# Deploying Sourcegraph executors using Terraform on AWS or GCP 56:## Terraform Version @@ -38,4 +26,16 @@ github.com/sourcegraph/sourcegraph/doc/dev/background-information/sg/reference.m 726:* `--skip-upgrade-validation`: Do not attempt to compare the previous instance version with the target instance version for upgrade compatibility. Please refer to https://docs.sourcegraph.com/admin/updates#update-policy for our instance upgrade compatibility policy. hidden 265 more line matches +github.com/sourcegraph/sourcegraph/doc/admin/executors/deploy_executors.md +118:## Confirm executors are working +194:### Configuring the auth config for use in executors +216:### Adding certificates to a binary deployment +hidden 47 more line matches + +github.com/sourcegraph/sourcegraph/doc/getting-started/github-vs-sourcegraph.md +8:## Which is best for you? +110:### Searching repositories, branches, and forks +28:For a high-level overview of how Sourcegraph compares to GitHub code search, see this [document](https://storage.googleapis.com/sourcegraph-assets/docs/PDFs/Sourcegraph%20vs.%20GitHub%20code%20search%20chart.pdf). +hidden 66 more line matches + hidden 3 more file matches diff --git a/internal/e2e/testdata/bufio_buffer.txt b/internal/e2e/testdata/bufio_buffer.txt index 3128df635..e593ab3ec 100644 --- a/internal/e2e/testdata/bufio_buffer.txt +++ b/internal/e2e/testdata/bufio_buffer.txt @@ -14,6 +14,12 @@ hidden 108 more line matches 25:// large to fit in the buffer. When a scan stops, the reader may have hidden 21 more line matches +github.com/golang/go/src/bufio/bufio.go +8:package bufio +25: ErrBufferFull = errors.New("bufio: buffer full") +665:func (b *Writer) AvailableBuffer() []byte { +hidden 89 more line matches + github.com/golang/go/test/fixedbugs/issue5089.go 13:func (b *bufio.Reader) Buffered() int { // ERROR "non-local|redefinition" 11:import "bufio" @@ -24,16 +30,10 @@ github.com/sourcegraph/sourcegraph/lib/codeintel/lsif/protocol/writer/writer.go 36:const writerBufferSize = 4096 hidden 8 more line matches -github.com/golang/go/src/bufio/bufio.go -8:package bufio -25: ErrBufferFull = errors.New("bufio: buffer full") -665:func (b *Writer) AvailableBuffer() []byte { -hidden 89 more line matches - -github.com/golang/go/src/cmd/doc/pkg.go -59: bytes.Buffer -56:type pkgBuffer struct { -8: "bufio" -hidden 8 more line matches +github.com/golang/go/src/bufio/scan_test.go +526:func TestHugeBuffer(t *testing.T) { +5:package bufio_test +8: . "bufio" +hidden 9 more line matches hidden 112 more file matches diff --git a/internal/e2e/testdata/bufio_flush_writer.txt b/internal/e2e/testdata/bufio_flush_writer.txt index b5d58f809..0646dab9f 100644 --- a/internal/e2e/testdata/bufio_flush_writer.txt +++ b/internal/e2e/testdata/bufio_flush_writer.txt @@ -1,12 +1,6 @@ queryString: bufio flush writer query: (and substr:"bufio" substr:"flush" substr:"writer") -targetRank: 1 - -**github.com/golang/go/src/net/http/transfer.go** -1113:type bufioFlushWriter struct{ w io.Writer } -59:type transferWriter struct { -76:func newTransferWriter(r any) (t *transferWriter, err error) { -hidden 36 more line matches +targetRank: 6 github.com/golang/go/src/bufio/bufio.go 635:func (b *Writer) Flush() error { @@ -38,4 +32,10 @@ github.com/sourcegraph/sourcegraph/lib/codeintel/lsif/protocol/writer/writer.go 20: Flush() error hidden 18 more line matches +**github.com/golang/go/src/net/http/transfer.go** +1113:type bufioFlushWriter struct{ w io.Writer } +59:type transferWriter struct { +76:func newTransferWriter(r any) (t *transferWriter, err error) { +hidden 36 more line matches + hidden 77 more file matches diff --git a/internal/e2e/testdata/bytes_buffer.txt b/internal/e2e/testdata/bytes_buffer.txt index b21ff7689..f324ff2a9 100644 --- a/internal/e2e/testdata/bytes_buffer.txt +++ b/internal/e2e/testdata/bytes_buffer.txt @@ -1,6 +1,12 @@ queryString: bytes buffer query: (and substr:"bytes" substr:"buffer") -targetRank: 5 +targetRank: 1 + +**github.com/golang/go/src/bytes/buffer.go** +54:func (b *Buffer) Bytes() []byte { return b.buf[b.off:] } +20:type Buffer struct { +430:func (b *Buffer) ReadBytes(delim byte) (line []byte, err error) { +hidden 126 more line matches github.com/sourcegraph/sourcegraph/lib/output/block.go 49: buffer bytes.Buffer @@ -8,30 +14,24 @@ github.com/sourcegraph/sourcegraph/lib/output/block.go 4: "bytes" hidden 2 more line matches -github.com/golang/go/src/compress/flate/huffman_bit_writer.go -82: bytes [bufferSize]byte -166:func (w *huffmanBitWriter) writeBytes(bytes []byte) { -29: bufferFlushSize = 240 -hidden 63 more line matches - github.com/sourcegraph/sourcegraph/client/browser/src/types/webextension-polyfill/index.d.ts 1708: bytes?: ArrayBuffer 501: bytesReceived: number 502: totalBytes: number hidden 9 more line matches +github.com/golang/go/src/compress/flate/huffman_bit_writer.go +82: bytes [bufferSize]byte +166:func (w *huffmanBitWriter) writeBytes(bytes []byte) { +29: bufferFlushSize = 240 +hidden 63 more line matches + github.com/golang/go/src/encoding/json/decode_test.go 1784: Buffer bytes.Buffer 1777: PBuffer *bytes.Buffer // has methods, just not relevant ones 1379: ByteSlice []byte hidden 17 more line matches -**github.com/golang/go/src/bytes/buffer.go** -54:func (b *Buffer) Bytes() []byte { return b.buf[b.off:] } -20:type Buffer struct { -430:func (b *Buffer) ReadBytes(delim byte) (line []byte, err error) { -hidden 126 more line matches - github.com/golang/go/src/encoding/gob/decode.go 74:func (d *decBuffer) Bytes() []byte { 79:func (d *decBuffer) SetBytes(data []byte) { diff --git a/internal/e2e/testdata/coverage_data_writer.txt b/internal/e2e/testdata/coverage_data_writer.txt index 0e6e5cf71..f51a238cc 100644 --- a/internal/e2e/testdata/coverage_data_writer.txt +++ b/internal/e2e/testdata/coverage_data_writer.txt @@ -32,10 +32,10 @@ github.com/golang/go/src/internal/coverage/encodemeta/encodefile.go 32: r := &CoverageMetaFileWriter{ hidden 14 more line matches -github.com/golang/go/src/cmd/cover/func.go -149:func (f *FuncExtent) coverage(profile *cover.Profile) (num, den int64) { -32:// as output the coverage data broken down by function, like this: -30:// funcOutput takes two file names as arguments, a coverage profile to read as input and an output -hidden 8 more line matches +github.com/golang/go/src/cmd/link/internal/ld/data.go +1522: data [sym.SXREF][]loader.Sym +1524: dataMaxAlign [sym.SXREF]int32 +1196:func addstrdata(arch *sys.Arch, l *loader.Loader, name, value string) { +hidden 334 more line matches hidden 35 more file matches diff --git a/internal/e2e/testdata/generate_unit_test.txt b/internal/e2e/testdata/generate_unit_test.txt index 211607ccf..03626ec79 100644 --- a/internal/e2e/testdata/generate_unit_test.txt +++ b/internal/e2e/testdata/generate_unit_test.txt @@ -1,12 +1,6 @@ queryString: generate unit test query: (and substr:"generate" substr:"unit" substr:"test") -targetRank: 2 - -github.com/sourcegraph/sourcegraph/doc/cody/quickstart.md -72:## 1. Generate a unit test -5:1. Try the `Generate Unit Tests` command -74:To ensure code quality and early bug detection, one of the most useful commands that Cody offers is `Generate Unit Tests`. It quickly helps you write a test code for any snippet that you have highlighted. To generate a unit test for our example function: -hidden 12 more line matches +targetRank: 1 **github.com/sourcegraph/cody/lib/shared/src/chat/recipes/generate-test.ts** 14:export class GenerateTest implements Recipe { @@ -14,28 +8,34 @@ hidden 12 more line matches 16: public title = 'Generate Unit Test' hidden 3 more line matches -github.com/sourcegraph/sourcegraph/cmd/frontend/internal/insights/resolvers/insight_series_resolver.go -300:func (j *seriesResolverGenerator) Generate(ctx context.Context, series types.InsightViewSeries, baseResolver baseInsightResolver, filters types.InsightViewFilters, options types.SeriesDisplayOptions) ([]graphqlbackend.InsightSeriesResolver, error) { -275: Generate(ctx context.Context, series types.InsightViewSeries, baseResolver baseInsightResolver, filters types.InsightViewFilters, options types.SeriesDisplayOptions) ([]graphqlbackend.InsightSeriesResolver, error) -286: generateResolver resolverGenerator -hidden 16 more line matches - -github.com/golang/go/src/cmd/vendor/github.com/google/pprof/internal/report/report.go -87:func Generate(w io.Writer, rpt *Report, obj plugin.ObjTool) error { -187:func (rpt *Report) selectOutputUnit(g *graph.Graph) { -75: SampleUnit string // Unit for the sample data from the profile. -hidden 48 more line matches - github.com/golang/go/src/cmd/internal/testdir/testdir_test.go 273:type test struct { 74:func Test(t *testing.T) { 263:type testCommon struct { hidden 120 more line matches -github.com/golang/go/src/cmd/vendor/github.com/google/pprof/profile/profile.go -65: Unit string // seconds, nanoseconds, bytes, etc -77: NumUnit map[string][]string -68: unitX int64 -hidden 44 more line matches +github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing/internal/inference/lua/test.lua +9: generate = function(_, paths) +8: -- Invoked as part of unit tests for the autoindexing service +6: patterns = { pattern.new_path_basename "sg-test" }, +hidden 1 more line matches + +github.com/golang/go/src/runtime/mgcpacer_test.go +891:func unit(amp float64) float64Stream { +760:type gcExecTest struct { +16:func TestGcPacer(t *testing.T) { +hidden 72 more line matches + +github.com/golang/go/src/debug/dwarf/entry_test.go +284:func TestUnitIteration(t *testing.T) { +15:func TestSplit(t *testing.T) { +48:func TestReaderSeek(t *testing.T) { +hidden 60 more line matches + +github.com/sourcegraph/sourcegraph/internal/license/license_test.go +75:func TestGenerateParseSignedKey(t *testing.T) { +11:func TestParseTagsInput(t *testing.T) { +32:func TestInfo_EncodeDecode(t *testing.T) { +hidden 21 more line matches hidden 244 more file matches diff --git a/internal/e2e/testdata/graphql_type_User.txt b/internal/e2e/testdata/graphql_type_User.txt index d24249dd9..7eb0fc937 100644 --- a/internal/e2e/testdata/graphql_type_User.txt +++ b/internal/e2e/testdata/graphql_type_User.txt @@ -26,16 +26,16 @@ github.com/sourcegraph/sourcegraph/cmd/frontend/internal/batches/resolvers/apite 364: User *User hidden 68 more line matches -github.com/sourcegraph/sourcegraph/internal/extsvc/github/common.go -2030:type User struct { -2036:type UserEmail struct { -66: User *Actor `json:"User,omitempty"` -hidden 136 more line matches +github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/user.go +239: User graphql.ID +643: User graphql.ID +681: User graphql.ID +hidden 166 more line matches -github.com/sourcegraph/sourcegraph/cmd/frontend/internal/authz/resolvers/permissions_info.go -238:func (r permissionsInfoUserResolver) User(ctx context.Context) *graphqlbackend.UserResolver { -171:func (r *permissionsInfoResolver) Users(ctx context.Context, args graphqlbackend.PermissionsInfoUsersArgs) (*graphqlutil.ConnectionResolver[graphqlbackend.PermissionsInfoUserResolver], error) { -229:type permissionsInfoUserResolver struct { -hidden 38 more line matches +github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/rbac.go +49: User *graphql.ID +56: User *graphql.ID +65: User graphql.ID +hidden 24 more line matches hidden 494 more file matches diff --git a/internal/e2e/testdata/r_cody_sourcegraph_url.txt b/internal/e2e/testdata/r_cody_sourcegraph_url.txt index bf6d5e82c..eb6c99a5f 100644 --- a/internal/e2e/testdata/r_cody_sourcegraph_url.txt +++ b/internal/e2e/testdata/r_cody_sourcegraph_url.txt @@ -1,6 +1,6 @@ queryString: r:cody sourcegraph url query: (and repo:cody substr:"sourcegraph" substr:"url") -targetRank: 6 +targetRank: 4 github.com/sourcegraph/cody/e2e/src/sourcegraph-api.ts 41: const sourcegraphApiUrl = `${sourcegraphEndpoint}/.api/graphql` @@ -8,18 +8,6 @@ github.com/sourcegraph/cody/e2e/src/sourcegraph-api.ts 40: const sourcegraphEndpoint = process.env.SRC_ENDPOINT ?? '' hidden 5 more line matches -github.com/sourcegraph/cody/vscode/src/chat/chat-view/ChatPanelProvider.ts -303: const sourcegraphSearchURL = new URL( -307: void this.openExternalLinks(sourcegraphSearchURL) -3:import { CodyPrompt, CustomCommandType } from '@sourcegraph/cody-shared/src/chat/prompts' -hidden 4 more line matches - -github.com/sourcegraph/cody/vscode/src/chat/chat-view/SidebarChatProvider.ts -423: const sourcegraphSearchURL = new URL( -195: const DOWNLOAD_URL = -427: void this.openExternalLinks(sourcegraphSearchURL) -hidden 14 more line matches - github.com/sourcegraph/cody/lib/shared/src/sourcegraph-api/graphql/url.ts 7: baseUrl: string 12:export const buildGraphQLUrl = ({ request, baseUrl }: BuildGraphQLUrlOptions): string => { @@ -38,4 +26,16 @@ hidden 6 more line matches 641: const url = 'http://localhost:49300/.api/testLogging' hidden 51 more line matches +github.com/sourcegraph/cody/vscode/src/chat/chat-view/ChatPanelProvider.ts +303: const sourcegraphSearchURL = new URL( +307: void this.openExternalLinks(sourcegraphSearchURL) +3:import { CodyPrompt, CustomCommandType } from '@sourcegraph/cody-shared/src/chat/prompts' +hidden 4 more line matches + +github.com/sourcegraph/cody/vscode/src/chat/chat-view/SidebarChatProvider.ts +423: const sourcegraphSearchURL = new URL( +195: const DOWNLOAD_URL = +427: void this.openExternalLinks(sourcegraphSearchURL) +hidden 14 more line matches + hidden 71 more file matches diff --git a/internal/e2e/testdata/rank_stats.txt b/internal/e2e/testdata/rank_stats.txt index 6be22f4d1..d53787b22 100644 --- a/internal/e2e/testdata/rank_stats.txt +++ b/internal/e2e/testdata/rank_stats.txt @@ -1,4 +1,4 @@ queries: 13 -recall@1: 4 (31%) +recall@1: 5 (38%) recall@5: 9 (69%) -mrr: 0.484271 +mrr: 0.526579 diff --git a/internal/e2e/testdata/sourcegraphserver_docker_image_build.txt b/internal/e2e/testdata/sourcegraphserver_docker_image_build.txt index cbb555251..c73d42c5f 100644 --- a/internal/e2e/testdata/sourcegraphserver_docker_image_build.txt +++ b/internal/e2e/testdata/sourcegraphserver_docker_image_build.txt @@ -2,24 +2,30 @@ queryString: sourcegraph/server docker image build query: (and substr:"sourcegraph/server" substr:"docker" substr:"image" substr:"build") targetRank: 12 -github.com/sourcegraph/sourcegraph/internal/updatecheck/handler.go -40: latestReleaseDockerServerImageBuild = newPingResponse("5.1.8") -45: latestReleaseKubernetesBuild = newPingResponse("5.1.8") -50: latestReleaseDockerComposeOrPureDocker = newPingResponse("5.1.8") -hidden 19 more line matches - github.com/sourcegraph/sourcegraph/dev/sg/internal/images/images.go 458: Build int 545:const dockerImageTagsURL = "https://index.docker.io/v2/%s/tags/list" 234:type ImageReference struct { hidden 118 more line matches +github.com/sourcegraph/sourcegraph/internal/updatecheck/handler.go +40: latestReleaseDockerServerImageBuild = newPingResponse("5.1.8") +45: latestReleaseKubernetesBuild = newPingResponse("5.1.8") +50: latestReleaseDockerComposeOrPureDocker = newPingResponse("5.1.8") +hidden 19 more line matches + github.com/sourcegraph/sourcegraph/doc/admin/external_services/postgres.md 41:### sourcegraph/server 192:### sourcegraph/server 53:### Docker Compose hidden 19 more line matches +github.com/sourcegraph/sourcegraph/doc/admin/deploy/docker-single-container/index.md +1:# Docker Single Container Deployment +294:### Insiders build +238:### File system performance on Docker for Mac +hidden 52 more line matches + github.com/sourcegraph/sourcegraph/internal/conf/deploy/deploytype.go 66:func IsDeployTypePureDocker(deployType string) bool { 12: SingleDocker = "docker-container" @@ -32,10 +38,4 @@ github.com/sourcegraph/sourcegraph/schema/schema.go 2631: ExecutorsSrcCLIImage string `json:"executors.srcCLIImage,omitempty"` hidden 22 more line matches -github.com/sourcegraph/sourcegraph/doc/admin/deploy/docker-single-container/index.md -1:# Docker Single Container Deployment -294:### Insiders build -238:### File system performance on Docker for Mac -hidden 52 more line matches - hidden 15 more file matches diff --git a/score.go b/score.go index 56fad0cfb..d6e7a5fa4 100644 --- a/score.go +++ b/score.go @@ -15,8 +15,16 @@ import ( // For example a FileMatch which contains a match from every atom in the tree // is a better match than a FileMatch which only matches one atom. type matchTreeScorer struct { - // contentAtomLen is the number of atoms seen. Because we are storing this - // in a bitset, we bound this by 64. + // filenameQueryAtoms is a bitset of filename query atoms. The bit is set if + // we found matches on it. + filenameQueryAtoms uint64 + + // filenameAtomLen is the number of filename atoms seen. Because we are + // storing this in a bitset, we bound this by 64. + filenameAtomLen uint8 + + // contentAtomLen is the number of content atoms seen. Because we are + // storing this in a bitset, we bound this by 64. contentAtomLen uint8 } @@ -32,6 +40,19 @@ type matchTreeScorer struct { // for the bitset values to be useful. func (mts *matchTreeScorer) setQueryAtoms(cands []*candidateMatch, filename bool) []*candidateMatch { if filename { + // in the rare case we have more than 64 filename atoms, we ignore the + // remaining. + if mts.filenameAtomLen >= 64 { + return cands + } + + // Set the bit if we match + if len(cands) > 0 { + mts.filenameQueryAtoms = mts.filenameQueryAtoms | (1 << mts.filenameAtomLen) + } + + mts.filenameAtomLen++ + return cands } @@ -50,6 +71,19 @@ func (mts *matchTreeScorer) setQueryAtoms(cands []*candidateMatch, filename bool } func (mts *matchTreeScorer) score(ms []*candidateMatch, debug bool) (score float64, what string) { + var scoreFilename float64 + if mts.filenameQueryAtoms != 0 { + scoreFilename = float64(bits.OnesCount64(mts.filenameQueryAtoms)) * scoreQueryFilenameAtomsCountFactor / float64(mts.filenameAtomLen) + if debug { + what += fmt.Sprintf("%s:%.2f, ", "queryFilenameAtomsCount", scoreFilename) + } + } + + // Rest of scorer has to do with content, skip if there is none. + if mts.contentAtomLen == 0 { + return scoreFilename, what + } + queryAtoms := uint64(0) last := uint64(0) run := 0 @@ -70,15 +104,15 @@ func (mts *matchTreeScorer) score(ms []*candidateMatch, debug bool) (score float last = qa } - scoreCount := float64(bits.OnesCount64(queryAtoms)) * scoreQueryAtomsCountFactor / float64(mts.contentAtomLen) - scoreRun := float64(maxRun) * scoreQueryAtomsRunFactor / float64(mts.contentAtomLen) + scoreCount := float64(bits.OnesCount64(queryAtoms)) * scoreQueryContentAtomsCountFactor / float64(mts.contentAtomLen) + scoreRun := float64(maxRun) * scoreQueryContentAtomsRunFactor / float64(mts.contentAtomLen) if debug && scoreCount > 0 { - what += fmt.Sprintf("%s:%.2f, ", "queryAtomsCount", scoreCount) + what += fmt.Sprintf("%s:%.2f, ", "queryContentAtomsCount", scoreCount) } if debug && scoreRun > 0 { - what += fmt.Sprintf("%s:%.2f, ", "queryAtomsRun", scoreRun) + what += fmt.Sprintf("%s:%.2f, ", "queryContentAtomsRun", scoreRun) } - return scoreCount + scoreRun, what + return scoreFilename + scoreCount + scoreRun, what }