@@ -77,7 +77,7 @@ func TestBM25(t *testing.T) {
7777 query : & query.Substring {Pattern : "example" },
7878 content : exampleJava ,
7979 language : "Java" ,
80- // keyword -score:1.69 (sum-tf: 7.00, length-ratio: 2.00)
80+ // bm25 -score:1.69 (sum-tf: 7.00, length-ratio: 2.00)
8181 wantScore : 1.69 ,
8282 }, {
8383 // Matches only on content
@@ -89,7 +89,7 @@ func TestBM25(t *testing.T) {
8989 }},
9090 content : exampleJava ,
9191 language : "Java" ,
92- // keyword -score:5.75 (sum-tf: 56.00, length-ratio: 2.00)
92+ // bm25 -score:5.75 (sum-tf: 56.00, length-ratio: 2.00)
9393 wantScore : 5.75 ,
9494 },
9595 {
@@ -98,15 +98,15 @@ func TestBM25(t *testing.T) {
9898 query : & query.Substring {Pattern : "java" },
9999 content : exampleJava ,
100100 language : "Java" ,
101- // keyword -score:1.07 (sum-tf: 2.00, length-ratio: 2.00)
101+ // bm25 -score:1.07 (sum-tf: 2.00, length-ratio: 2.00)
102102 wantScore : 1.07 ,
103103 },
104104 {
105105 // Matches only on filename, and content is missing
106106 fileName : "a/b/c/config.go" ,
107107 query : & query.Substring {Pattern : "config.go" },
108108 language : "Go" ,
109- // keyword -score:1.91 (sum-tf: 2.00, length-ratio: 0.00)
109+ // bm25 -score:1.91 (sum-tf: 2.00, length-ratio: 0.00)
110110 wantScore : 1.91 ,
111111 },
112112 }
@@ -584,7 +584,7 @@ func skipIfCTagsUnavailable(t *testing.T, parserType ctags.CTagsParserType) {
584584 }
585585}
586586
587- func checkScoring (t * testing.T , c scoreCase , keywordScoring bool , parserType ctags.CTagsParserType ) {
587+ func checkScoring (t * testing.T , c scoreCase , useBM25 bool , parserType ctags.CTagsParserType ) {
588588 skipIfCTagsUnavailable (t , parserType )
589589
590590 name := c .language
@@ -625,9 +625,9 @@ func checkScoring(t *testing.T, c scoreCase, keywordScoring bool, parserType cta
625625 defer ss .Close ()
626626
627627 srs , err := ss .Search (context .Background (), c .query , & zoekt.SearchOptions {
628- UseKeywordScoring : keywordScoring ,
629- ChunkMatches : true ,
630- DebugScore : true })
628+ UseBM25Scoring : useBM25 ,
629+ ChunkMatches : true ,
630+ DebugScore : true })
631631 if err != nil {
632632 t .Fatal (err )
633633 }
0 commit comments