diff --git a/internal/e2e/e2e_rank_test.go b/internal/e2e/e2e_rank_test.go index 1e4cdca6e..5e4b77932 100644 --- a/internal/e2e/e2e_rank_test.go +++ b/internal/e2e/e2e_rank_test.go @@ -119,10 +119,6 @@ func TestRanking(t *testing.T) { t.Fatal(err) } - // q is marshalled as part of the test, so avoid our rewrites for - // ranking. - qSearch := query.ExpirementalPhraseBoost(q, rq.Query, query.ExperimentalPhraseBoostOptions{}) - sOpts := zoekt.SearchOptions{ // Use the same options sourcegraph has by default ChunkMatches: true, @@ -133,7 +129,7 @@ func TestRanking(t *testing.T) { DebugScore: *debugScore, } - result, err := ss.Search(context.Background(), qSearch, &sOpts) + result, err := ss.Search(context.Background(), q, &sOpts) if err != nil { t.Fatal(err) } 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 a0e84ef88..a501118e4 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 @@ -3,9 +3,9 @@ query: (and substr:"assets" substr:"are" substr:"not" substr:"configured" substr targetRank: 1 **github.com/sourcegraph/sourcegraph/ui/assets/assets.go** -30: return nil, errors.New("assets are not configured for this binary, please see ui/assets") -34: panic("assets are not configured for this binary, please see ui/assets") 33:func (p FailingAssetsProvider) Assets() http.FileSystem { +14: Assets() http.FileSystem +1:package assets hidden 12 more line matches github.com/sourcegraph/sourcegraph/schema/schema.go diff --git a/internal/e2e/testdata/generate_unit_test.txt b/internal/e2e/testdata/generate_unit_test.txt index b545b3451..57dad53e4 100644 --- a/internal/e2e/testdata/generate_unit_test.txt +++ b/internal/e2e/testdata/generate_unit_test.txt @@ -1,30 +1,6 @@ queryString: generate unit test query: (and substr:"generate" substr:"unit" substr:"test") -targetRank: 1 - -**github.com/sourcegraph/cody/lib/shared/src/chat/recipes/generate-test.ts** -16: public title = 'Generate Unit Test' -14:export class GenerateTest implements Recipe { -15: public id: RecipeID = 'generate-unit-test' -hidden 3 more line matches - -github.com/sourcegraph/sourcegraph/client/jetbrains/README.md -40:- Generate unit test -41:- Generate docstring -61:Cody is powered by Sourcegraph’s code graph and uses context of your codebase to extend its capabilities. By using context from entire repositories, Cody is able to give more accurate answers and generate idiomatic code. -hidden 7 more line matches - -github.com/sourcegraph/cody/vscode/CHANGELOG.md -298:- The `/test` (Generate Unit Test) command was updated to use file dependencies and test examples when fetching context, in order to produce better results. To use this command, select code in your editor and run the `/test` command. It is recommended to set up test files before running the command to get optimal results. [pull/683](https://github.com/sourcegraph/cody/pull/683) [pull/602](https://github.com/sourcegraph/cody/pull/602) -218:- The `Generate Unit Tests` command has been improved with an enhanced context fetching process that produces test results with better quality. [pull/907](https://github.com/sourcegraph/cody/pull/907) -264:- The `Generate Unit Tests` command has been improved with an enhanced context fetching process that produces test results with better quality. [pull/907](https://github.com/sourcegraph/cody/pull/907) -hidden 17 more line matches - -github.com/sourcegraph/sourcegraph/doc/cody/overview/install-jetbrains.md -158:- Generate unit test -138:Log in to your Sourcegraph instance and go to `settings` / `access token` (`https://.sourcegraph.com/users//settings/tokens`). From here, generate a new access token. -159:- Generate docstring -hidden 3 more line matches +targetRank: 11 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) { @@ -38,4 +14,28 @@ github.com/golang/go/src/cmd/vendor/github.com/google/pprof/internal/report/repo 75: SampleUnit string // Unit for the sample data from the profile. hidden 48 more line matches +github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing/internal/inference/lua/test.lua +9: generate = function(_, paths) +6: patterns = { pattern.new_path_basename "sg-test" }, +8: -- Invoked as part of unit tests for the autoindexing service +hidden 1 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/golang/go/src/cmd/link/internal/loader/loader.go +79: unit *sym.CompilationUnit +1544:func (l *Loader) SymUnit(i Sym) *sym.CompilationUnit { +228: generatedSyms Bitmap // symbols that generate their content, indexed by ext sym idx +hidden 50 more line matches + hidden 245 more file matches diff --git a/internal/e2e/testdata/rank_stats.txt b/internal/e2e/testdata/rank_stats.txt index b937357cc..6280a9a34 100644 --- a/internal/e2e/testdata/rank_stats.txt +++ b/internal/e2e/testdata/rank_stats.txt @@ -1,4 +1,4 @@ queries: 15 -recall@1: 10 (67%) -recall@5: 12 (80%) -mrr: 0.730017 +recall@1: 8 (53%) +recall@5: 10 (67%) +mrr: 0.607506 diff --git a/internal/e2e/testdata/sourcegraphserver_docker_image_build.txt b/internal/e2e/testdata/sourcegraphserver_docker_image_build.txt index cf80e597e..b1c431e98 100644 --- a/internal/e2e/testdata/sourcegraphserver_docker_image_build.txt +++ b/internal/e2e/testdata/sourcegraphserver_docker_image_build.txt @@ -1,11 +1,6 @@ queryString: sourcegraph/server docker image build query: (and substr:"sourcegraph/server" substr:"docker" substr:"image" substr:"build") -targetRank: 1 - -**github.com/sourcegraph/sourcegraph/dev/tools.go** -7: // zoekt-* used in sourcegraph/server docker image build -1://go:build tools -2:// +build tools +targetRank: 14 github.com/sourcegraph/sourcegraph/dev/sg/internal/images/images.go 458: Build int @@ -37,4 +32,10 @@ github.com/sourcegraph/sourcegraph/internal/updatecheck/handler.go 50: latestReleaseDockerComposeOrPureDocker = newPingResponse("5.1.8") 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 + hidden 15 more file matches diff --git a/query/boost.go b/query/boost.go deleted file mode 100644 index 2c2291ba8..000000000 --- a/query/boost.go +++ /dev/null @@ -1,61 +0,0 @@ -package query - -type ExperimentalPhraseBoostOptions struct { - // The phrase needs to contain atleast this many terms. This is based on the - // parsed query. - // - // Defaults to 3. - MinTerms int - - // Boost is how much to multiply the phrase match scores by. - // - // Defaults to 20. - Boost float64 -} - -// ExperimentalPhraseBoost transforms q into a query containing exact matches -// to phrase boosted. opts control how and when the boosting is done. -// -// Note: This is a temporary API and will be removed in future commits. -func ExpirementalPhraseBoost(q Q, phrase string, opts ExperimentalPhraseBoostOptions) Q { - if opts.MinTerms == 0 { - opts.MinTerms = 3 - } - if opts.Boost == 0 { - opts.Boost = 20 - } - - contentAtoms := 0 - caseSensitive := false - VisitAtoms(q, func(q Q) { - switch s := q.(type) { - case *Regexp: - // Check atom is for content - if s.Content || (s.Content == s.FileName) { - caseSensitive = s.CaseSensitive - contentAtoms++ - } - case *Substring: - if s.Content || (s.Content == s.FileName) { - caseSensitive = s.CaseSensitive - contentAtoms++ - } - } - }) - - if contentAtoms < opts.MinTerms { - return q - } - - return NewOr( - &Boost{ - Boost: opts.Boost, - Child: &Substring{ - Pattern: phrase, - Content: true, - CaseSensitive: caseSensitive, - }, - }, - q, - ) -} diff --git a/web/server.go b/web/server.go index 89c9fed27..acf4dc59a 100644 --- a/web/server.go +++ b/web/server.go @@ -240,13 +240,6 @@ func (s *Server) serveSearchErr(r *http.Request) (*ApiSearchResult, error) { return nil, err } - // Experimental: The query string and boost exact phrases of it. - if phraseBoost, err := strconv.ParseFloat(qvals.Get("phrase-boost"), 64); err == nil { - q = query.ExpirementalPhraseBoost(q, queryStr, query.ExperimentalPhraseBoostOptions{ - Boost: phraseBoost, - }) - } - repoOnly := true query.VisitAtoms(q, func(q query.Q) { _, ok := q.(*query.Repo)