fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

Remove redundant phrase boost logic

+38 -109
+1 -5
internal/e2e/e2e_rank_test.go
··· 119 119 t.Fatal(err) 120 120 } 121 121 122 - // q is marshalled as part of the test, so avoid our rewrites for 123 - // ranking. 124 - qSearch := query.ExpirementalPhraseBoost(q, rq.Query, query.ExperimentalPhraseBoostOptions{}) 125 - 126 122 sOpts := zoekt.SearchOptions{ 127 123 // Use the same options sourcegraph has by default 128 124 ChunkMatches: true, ··· 133 129 134 130 DebugScore: *debugScore, 135 131 } 136 - result, err := ss.Search(context.Background(), qSearch, &sOpts) 132 + result, err := ss.Search(context.Background(), q, &sOpts) 137 133 if err != nil { 138 134 t.Fatal(err) 139 135 }
+2 -2
internal/e2e/testdata/assets_are_not_configured_for_this_binary.txt
··· 3 3 targetRank: 1 4 4 5 5 **github.com/sourcegraph/sourcegraph/ui/assets/assets.go** 6 - 30: return nil, errors.New("assets are not configured for this binary, please see ui/assets") 7 - 34: panic("assets are not configured for this binary, please see ui/assets") 8 6 33:func (p FailingAssetsProvider) Assets() http.FileSystem { 7 + 14: Assets() http.FileSystem 8 + 1:package assets 9 9 hidden 12 more line matches 10 10 11 11 github.com/sourcegraph/sourcegraph/schema/schema.go
+25 -25
internal/e2e/testdata/generate_unit_test.txt
··· 1 1 queryString: generate unit test 2 2 query: (and substr:"generate" substr:"unit" substr:"test") 3 - targetRank: 1 4 - 5 - **github.com/sourcegraph/cody/lib/shared/src/chat/recipes/generate-test.ts** 6 - 16: public title = 'Generate Unit Test' 7 - 14:export class GenerateTest implements Recipe { 8 - 15: public id: RecipeID = 'generate-unit-test' 9 - hidden 3 more line matches 10 - 11 - github.com/sourcegraph/sourcegraph/client/jetbrains/README.md 12 - 40:- Generate unit test 13 - 41:- Generate docstring 14 - 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. 15 - hidden 7 more line matches 16 - 17 - github.com/sourcegraph/cody/vscode/CHANGELOG.md 18 - 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) 19 - 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) 20 - 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) 21 - hidden 17 more line matches 22 - 23 - github.com/sourcegraph/sourcegraph/doc/cody/overview/install-jetbrains.md 24 - 158:- Generate unit test 25 - 138:Log in to your Sourcegraph instance and go to `settings` / `access token` (`https://<your-instance>.sourcegraph.com/users/<your-instance>/settings/tokens`). From here, generate a new access token. 26 - 159:- Generate docstring 27 - hidden 3 more line matches 3 + targetRank: 11 28 4 29 5 github.com/sourcegraph/sourcegraph/cmd/frontend/internal/insights/resolvers/insight_series_resolver.go 30 6 300:func (j *seriesResolverGenerator) Generate(ctx context.Context, series types.InsightViewSeries, baseResolver baseInsightResolver, filters types.InsightViewFilters, options types.SeriesDisplayOptions) ([]graphqlbackend.InsightSeriesResolver, error) { ··· 37 13 187:func (rpt *Report) selectOutputUnit(g *graph.Graph) { 38 14 75: SampleUnit string // Unit for the sample data from the profile. 39 15 hidden 48 more line matches 16 + 17 + github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing/internal/inference/lua/test.lua 18 + 9: generate = function(_, paths) 19 + 6: patterns = { pattern.new_path_basename "sg-test" }, 20 + 8: -- Invoked as part of unit tests for the autoindexing service 21 + hidden 1 more line matches 22 + 23 + github.com/golang/go/src/cmd/internal/testdir/testdir_test.go 24 + 273:type test struct { 25 + 74:func Test(t *testing.T) { 26 + 263:type testCommon struct { 27 + hidden 120 more line matches 28 + 29 + github.com/golang/go/src/cmd/vendor/github.com/google/pprof/profile/profile.go 30 + 65: Unit string // seconds, nanoseconds, bytes, etc 31 + 77: NumUnit map[string][]string 32 + 68: unitX int64 33 + hidden 44 more line matches 34 + 35 + github.com/golang/go/src/cmd/link/internal/loader/loader.go 36 + 79: unit *sym.CompilationUnit 37 + 1544:func (l *Loader) SymUnit(i Sym) *sym.CompilationUnit { 38 + 228: generatedSyms Bitmap // symbols that generate their content, indexed by ext sym idx 39 + hidden 50 more line matches 40 40 41 41 hidden 245 more file matches
+3 -3
internal/e2e/testdata/rank_stats.txt
··· 1 1 queries: 15 2 - recall@1: 10 (67%) 3 - recall@5: 12 (80%) 4 - mrr: 0.730017 2 + recall@1: 8 (53%) 3 + recall@5: 10 (67%) 4 + mrr: 0.607506
+7 -6
internal/e2e/testdata/sourcegraphserver_docker_image_build.txt
··· 1 1 queryString: sourcegraph/server docker image build 2 2 query: (and substr:"sourcegraph/server" substr:"docker" substr:"image" substr:"build") 3 - targetRank: 1 4 - 5 - **github.com/sourcegraph/sourcegraph/dev/tools.go** 6 - 7: // zoekt-* used in sourcegraph/server docker image build 7 - 1://go:build tools 8 - 2:// +build tools 3 + targetRank: 14 9 4 10 5 github.com/sourcegraph/sourcegraph/dev/sg/internal/images/images.go 11 6 458: Build int ··· 36 31 45: latestReleaseKubernetesBuild = newPingResponse("5.1.8") 37 32 50: latestReleaseDockerComposeOrPureDocker = newPingResponse("5.1.8") 38 33 hidden 19 more line matches 34 + 35 + github.com/sourcegraph/sourcegraph/doc/admin/deploy/docker-single-container/index.md 36 + 1:# Docker Single Container Deployment 37 + 294:### Insiders build 38 + 238:### File system performance on Docker for Mac 39 + hidden 52 more line matches 39 40 40 41 hidden 15 more file matches
-61
query/boost.go
··· 1 - package query 2 - 3 - type ExperimentalPhraseBoostOptions struct { 4 - // The phrase needs to contain atleast this many terms. This is based on the 5 - // parsed query. 6 - // 7 - // Defaults to 3. 8 - MinTerms int 9 - 10 - // Boost is how much to multiply the phrase match scores by. 11 - // 12 - // Defaults to 20. 13 - Boost float64 14 - } 15 - 16 - // ExperimentalPhraseBoost transforms q into a query containing exact matches 17 - // to phrase boosted. opts control how and when the boosting is done. 18 - // 19 - // Note: This is a temporary API and will be removed in future commits. 20 - func ExpirementalPhraseBoost(q Q, phrase string, opts ExperimentalPhraseBoostOptions) Q { 21 - if opts.MinTerms == 0 { 22 - opts.MinTerms = 3 23 - } 24 - if opts.Boost == 0 { 25 - opts.Boost = 20 26 - } 27 - 28 - contentAtoms := 0 29 - caseSensitive := false 30 - VisitAtoms(q, func(q Q) { 31 - switch s := q.(type) { 32 - case *Regexp: 33 - // Check atom is for content 34 - if s.Content || (s.Content == s.FileName) { 35 - caseSensitive = s.CaseSensitive 36 - contentAtoms++ 37 - } 38 - case *Substring: 39 - if s.Content || (s.Content == s.FileName) { 40 - caseSensitive = s.CaseSensitive 41 - contentAtoms++ 42 - } 43 - } 44 - }) 45 - 46 - if contentAtoms < opts.MinTerms { 47 - return q 48 - } 49 - 50 - return NewOr( 51 - &Boost{ 52 - Boost: opts.Boost, 53 - Child: &Substring{ 54 - Pattern: phrase, 55 - Content: true, 56 - CaseSensitive: caseSensitive, 57 - }, 58 - }, 59 - q, 60 - ) 61 - }
-7
web/server.go
··· 240 240 return nil, err 241 241 } 242 242 243 - // Experimental: The query string and boost exact phrases of it. 244 - if phraseBoost, err := strconv.ParseFloat(qvals.Get("phrase-boost"), 64); err == nil { 245 - q = query.ExpirementalPhraseBoost(q, queryStr, query.ExperimentalPhraseBoostOptions{ 246 - Boost: phraseBoost, 247 - }) 248 - } 249 - 250 243 repoOnly := true 251 244 query.VisitAtoms(q, func(q query.Q) { 252 245 _, ok := q.(*query.Repo)