Skip to content

Commit

Permalink
tweak weights so "http server" still has good results
Browse files Browse the repository at this point in the history
  • Loading branch information
keegancsmith committed Jan 17, 2024
1 parent 6aa80e8 commit 0523334
Show file tree
Hide file tree
Showing 16 changed files with 133 additions and 131 deletions.
6 changes: 3 additions & 3 deletions contentprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,9 @@ const (
// Used for ordering line and chunk matches within a file.
scoreLineOrderFactor = 1.0

scoreQueryContentAtomsCountFactor = 3000.0
scoreQueryContentAtomsRunFactor = 1000.0
scoreQueryFilenameAtomsCountFactor = 1000.0
scoreQueryContentAtomsCountFactor = 1500.0
scoreQueryContentAtomsRunFactor = 1500.0
scoreQueryFilenameAtomsCountFactor = 1500.0
)

// findSection checks whether a section defined by offset and size lies within
Expand Down
24 changes: 13 additions & 11 deletions internal/e2e/testdata/bufio_buffer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@ 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 {
25: ErrBufferFull = errors.New("bufio: buffer full")
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"

github.com/sourcegraph/sourcegraph/lib/codeintel/lsif/protocol/writer/writer.go
26: bufferedWriter *bufio.Writer
33:const channelBufferSize = 512
36:const writerBufferSize = 4096
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

github.com/golang/go/src/bufio/bufio_test.go
1020:func TestReadEmptyBuffer(t *testing.T) {
5:package bufio_test
826:func TestBufferFull(t *testing.T) {
hidden 83 more line matches

github.com/golang/go/src/bufio/example_test.go
23:func ExampleWriter_AvailableBuffer() {
5:package bufio_test
8: "bufio"
hidden 12 more line matches

hidden 112 more file matches
12 changes: 6 additions & 6 deletions internal/e2e/testdata/bufio_flush_writer.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
queryString: bufio flush writer
query: (and substr:"bufio" substr:"flush" substr:"writer")
targetRank: 6
targetRank: 10

github.com/golang/go/src/bufio/bufio.go
635:func (b *Writer) Flush() error {
Expand Down Expand Up @@ -32,10 +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
github.com/golang/go/src/image/jpeg/writer.go
211:type writer interface {
231:func (e *encoder) flush() {
212: Flush() error
hidden 11 more line matches

hidden 77 more file matches
24 changes: 12 additions & 12 deletions internal/e2e/testdata/bytes_buffer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,27 @@ 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) {
5:package bytes
hidden 126 more line matches

github.com/sourcegraph/sourcegraph/lib/output/block.go
49: buffer bytes.Buffer
41: for _, line := range bytes.Split(bytes.TrimRight(b.writer.buffer.Bytes(), "\n"), []byte("\n")) {
4: "bytes"
hidden 2 more line matches
github.com/golang/go/src/bytes/buffer_test.go
76:func fillBytes(t *testing.T, testname string, buf *Buffer, s string, n int, fub []byte) string {
92:func TestNewBuffer(t *testing.T) {
477:func TestReadBytes(t *testing.T) {
hidden 113 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/sourcegraph/sourcegraph/lib/output/block.go
49: buffer bytes.Buffer
41: for _, line := range bytes.Split(bytes.TrimRight(b.writer.buffer.Bytes(), "\n"), []byte("\n")) {
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) {
Expand All @@ -32,10 +38,4 @@ github.com/golang/go/src/encoding/json/decode_test.go
1379: ByteSlice []byte
hidden 17 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) {
40:type decBuffer struct {
hidden 39 more line matches

hidden 494 more file matches
22 changes: 11 additions & 11 deletions internal/e2e/testdata/coverage_data_writer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@ targetRank: 1
37: r := &CoverageDataWriter{
hidden 41 more line matches

github.com/golang/go/src/internal/coverage/stringtab/stringtab.go
19:type Writer struct {
27:func (stw *Writer) InitWriter() {
15:// for use in emitting and reading/decoding coverage meta-data and
hidden 16 more line matches

github.com/golang/go/src/runtime/coverage/emit.go
447:func writeMetaData(w io.Writer, metalist []rtcov.CovMetaBlob, cmode coverage.CounterMode, gran coverage.CounterGranularity, finalHash [16]byte) error {
341:func (s *emitState) emitCounterDataToWriter(w io.Writer) error {
5:package coverage
hidden 125 more line matches

github.com/golang/go/src/internal/coverage/stringtab/stringtab.go
19:type Writer struct {
27:func (stw *Writer) InitWriter() {
15:// for use in emitting and reading/decoding coverage meta-data and
hidden 16 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

github.com/golang/go/src/internal/coverage/encodemeta/encode.go
24:type CoverageMetaDataBuilder struct {
Expand All @@ -32,10 +38,4 @@ github.com/golang/go/src/internal/coverage/encodemeta/encodefile.go
32: r := &CoverageMetaFileWriter{
hidden 14 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
26 changes: 13 additions & 13 deletions internal/e2e/testdata/generate_unit_test.txt
Original file line number Diff line number Diff line change
@@ -1,12 +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**
14:export class GenerateTest implements Recipe {
15: public id: RecipeID = 'generate-unit-test'
16: public title = 'Generate Unit Test'
hidden 3 more line matches
targetRank: 3

github.com/golang/go/src/cmd/internal/testdir/testdir_test.go
273:type test struct {
Expand All @@ -20,22 +14,28 @@ github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing/internal/infe
6: patterns = { pattern.new_path_basename "sg-test" },
hidden 1 more line matches

**github.com/sourcegraph/cody/lib/shared/src/chat/recipes/generate-test.ts**
14:export class GenerateTest implements Recipe {
15: public id: RecipeID = 'generate-unit-test'
16: public title = 'Generate Unit Test'
hidden 3 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/runtime/metrics/description_test.go
87:var generate = flag.Bool("generate", false, "update doc.go for go generate")
32:func TestNames(t *testing.T) {
89:func TestDocs(t *testing.T) {
hidden 11 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
10 changes: 5 additions & 5 deletions internal/e2e/testdata/graphql_type_User.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ hidden 11 more line matches

**github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/schema.graphql**
6376:type User implements Node & SettingsSubject & Namespace {
6337:type UserConnection {
6840:type UserEmail {
3862: type: GitRefType
5037: type: GitRefType!
hidden 460 more line matches

github.com/sourcegraph/sourcegraph/internal/types/types.go
850:type User struct {
867:type UserForSCIM struct {
921:type UserRole struct {
1372: Type *SearchCountStatistics
1766: Type string
hidden 234 more line matches

github.com/sourcegraph/sourcegraph/cmd/frontend/internal/batches/resolvers/apitest/types.go
52:type User struct {
68:type UserOrg struct {
364: User *User
393: Type string
hidden 68 more line matches

github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/user.go
Expand Down
34 changes: 17 additions & 17 deletions internal/e2e/testdata/r_cody_sourcegraph_url.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
queryString: r:cody sourcegraph url
query: (and repo:cody substr:"sourcegraph" substr:"url")
targetRank: 4
targetRank: 2

github.com/sourcegraph/cody/e2e/src/sourcegraph-api.ts
41: const sourcegraphApiUrl = `${sourcegraphEndpoint}/.api/graphql`
3:const SOURCEGRAPH_GRAPHQL_SEARCH_QUERY = `
40: const sourcegraphEndpoint = process.env.SRC_ENDPOINT ?? ''
hidden 5 more line matches

**github.com/sourcegraph/cody/lib/shared/src/sourcegraph-api/graphql/client.ts**
611: const url = buildGraphQLUrl({ request: query, baseUrl: this.config.serverEndpoint })
626: const url = buildGraphQLUrl({ request: query, baseUrl: this.dotcomUrl.href })
641: const url = 'http://localhost:49300/.api/testLogging'
hidden 51 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 => {
Expand All @@ -20,22 +26,16 @@ github.com/sourcegraph/cody/lib/shared/src/sourcegraph-api/environments.ts
3:export const LOCAL_APP_URL = new URL('http://localhost:3080')
hidden 6 more line matches

**github.com/sourcegraph/cody/lib/shared/src/sourcegraph-api/graphql/client.ts**
611: const url = buildGraphQLUrl({ request: query, baseUrl: this.config.serverEndpoint })
626: const url = buildGraphQLUrl({ request: query, baseUrl: this.dotcomUrl.href })
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/lib/shared/src/sourcegraph-api/completions/client.ts
23:export abstract class SourcegraphCompletionsClient {
21: * Access the chat based LLM APIs via a Sourcegraph server instance.
36: return new URL('/.api/completions/stream', this.config.serverEndpoint).href
hidden 1 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/completions/browserClient.ts
8:export class SourcegraphBrowserCompletionsClient extends SourcegraphCompletionsClient {
5:import { SourcegraphCompletionsClient } from './client'
20: headersInstance.set('X-Sourcegraph-Should-Trace', 'true')
hidden 1 more line matches

hidden 71 more file matches
6 changes: 3 additions & 3 deletions internal/e2e/testdata/rank_stats.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
queries: 13
recall@1: 5 (38%)
recall@5: 9 (69%)
mrr: 0.526579
recall@1: 4 (31%)
recall@5: 10 (77%)
mrr: 0.503846
22 changes: 11 additions & 11 deletions internal/e2e/testdata/sourcegraphserver_docker_image_build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ 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

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/dev/sg/internal/images/images_test.go
1:package images
102: "index.docker.io/sourcegraph/server:3.36.2@sha256:07d7407fdc656d7513aa54cdffeeecb33aa4e284eea2fd82e27342411430e5f2",
112: "index.docker.io/sourcegraph/server:3.36.2",
hidden 16 more line matches

github.com/sourcegraph/sourcegraph/internal/conf/deploy/deploytype.go
66:func IsDeployTypePureDocker(deployType string) bool {
12: SingleDocker = "docker-container"
13: DockerCompose = "docker-compose"
hidden 19 more line matches

github.com/sourcegraph/sourcegraph/schema/schema.go
2621: ExecutorsBatcheshelperImage string `json:"executors.batcheshelperImage,omitempty"`
2627: ExecutorsLsifGoImage string `json:"executors.lsifGoImage,omitempty"`
2631: ExecutorsSrcCLIImage string `json:"executors.srcCLIImage,omitempty"`
hidden 22 more line matches

hidden 15 more file matches
22 changes: 11 additions & 11 deletions internal/e2e/testdata/test_server.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
queryString: test server
query: (and substr:"test" substr:"server")
targetRank: 82
targetRank: 5

github.com/golang/go/test/fixedbugs/issue33355.go
38:type Server struct {
Expand All @@ -25,16 +25,16 @@ github.com/sourcegraph/sourcegraph/cmd/worker/internal/outboundwebhooks/handler_
157:type mockServer struct {
hidden 25 more line matches

github.com/golang/go/src/cmd/vendor/golang.org/x/mod/sumdb/test.go
26:type TestServer struct {
21:func NewTestServer(signer string, gosum func(path, vers string) ([]byte, error)) *TestServer {
37:type testHashes []tlog.Hash
hidden 10 more line matches
**github.com/golang/go/src/net/http/httptest/server.go**
26:type Server struct {
105:func NewServer(handler http.Handler) *Server {
117:func NewUnstartedServer(handler http.Handler) *Server {
hidden 62 more line matches

github.com/sourcegraph/sourcegraph/internal/gitserver/addrs.go
99:type testGitserverConns struct {
47:type TestClientSourceOptions struct {
135:type testConnAndErr struct {
hidden 78 more line matches
github.com/golang/go/src/net/rpc/server.go
188:type Server struct {
656:type ServerCodec interface {
197:func NewServer() *Server {
hidden 104 more line matches

hidden 494 more file matches
Loading

0 comments on commit 0523334

Please sign in to comment.