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

Configure Feed

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

ranking: boost Go interfaces (#463)

A couple of test searches revelead that interfaces should rank higher
most of the time. With this change we move interfaces to the top.

+25 -3
+22
build/e2e_test.go
··· 951 951 fileName: "src/net/http/client.go", 952 952 content: []byte(` 953 953 package http 954 + type aInterface interface {} 955 + `), 956 + query: &query.Substring{Content: true, Pattern: "aInterface"}, 957 + wantLanguage: "Go", 958 + // 7000 (full base match) + 1000 (Go interface) + 500 (word) + 400 (atom) + 10 (file order) 959 + wantScore: 8910, 960 + }, 961 + { 962 + fileName: "src/net/http/client.go", 963 + content: []byte(` 964 + package http 965 + type aStruct struct {} 966 + `), 967 + query: &query.Substring{Content: true, Pattern: "aStruct"}, 968 + wantLanguage: "Go", 969 + // 7000 (full base match) + 950 (Go interface) + 500 (word) + 400 (atom) + 10 (file order) 970 + wantScore: 8860, 971 + }, 972 + { 973 + fileName: "src/net/http/client.go", 974 + content: []byte(` 975 + package http 954 976 func Get() { 955 977 panic("") 956 978 }
+3 -3
contentprovider.go
··· 684 684 } 685 685 case "Go": 686 686 switch kind { 687 - case "struct": // structs 687 + case "interface": // interfaces 688 688 factor = 10 689 - case "talias": // type aliases 689 + case "struct": // structs 690 690 factor = 9.5 691 - case "interface": // interfaces 691 + case "talias": // type aliases 692 692 factor = 9 693 693 case "methodSpec": // interface method specification 694 694 factor = 8.5