@@ -165,35 +165,6 @@ func testIndexer(name string, t *testing.T, indexer internal.Indexer) {
165165 },
166166 },
167167 },
168- // Search for matches on the contents of files within the repo '62'.
169- // This scenario yields two results (both are based on contents, the first one is an exact match where as the second is a 'fuzzy' one)
170- {
171- RepoIDs : []int64 {62 },
172- Keyword : "This is not cheese" ,
173- Langs : 1 ,
174- Results : []codeSearchResult {
175- {
176- Filename : "potato/ham.md" ,
177- Content : "This is not cheese" ,
178- },
179- {
180- Filename : "ham.md" ,
181- Content : "This is also not cheese" ,
182- },
183- },
184- },
185- // Search for matches on the contents of files regardless of case.
186- {
187- RepoIDs : nil ,
188- Keyword : "dESCRIPTION" ,
189- Langs : 1 ,
190- Results : []codeSearchResult {
191- {
192- Filename : "README.md" ,
193- Content : "# repo1\n \n Description for repo1" ,
194- },
195- },
196- },
197168 // Search for an exact match on the filename within the repo '62' (case insenstive).
198169 // This scenario yields a single result (the file avocado.md on the repo '62')
199170 {
@@ -233,6 +204,47 @@ func testIndexer(name string, t *testing.T, indexer internal.Indexer) {
233204 },
234205 }
235206
207+ if name == "elastic_search" {
208+ // Additional scenarios for elastic_search only
209+ additional := []struct {
210+ RepoIDs []int64
211+ Keyword string
212+ Langs int
213+ Results []codeSearchResult
214+ }{
215+ // Search for matches on the contents of files within the repo '62'.
216+ // This scenario yields two results (both are based on contents, the first one is an exact match where as the second is a 'fuzzy' one)
217+ {
218+ RepoIDs : []int64 {62 },
219+ Keyword : "This is not cheese" ,
220+ Langs : 1 ,
221+ Results : []codeSearchResult {
222+ {
223+ Filename : "potato/ham.md" ,
224+ Content : "This is not cheese" ,
225+ },
226+ {
227+ Filename : "ham.md" ,
228+ Content : "This is also not cheese" ,
229+ },
230+ },
231+ },
232+ // Search for matches on the contents of files regardless of case.
233+ {
234+ RepoIDs : nil ,
235+ Keyword : "dESCRIPTION" ,
236+ Langs : 1 ,
237+ Results : []codeSearchResult {
238+ {
239+ Filename : "README.md" ,
240+ Content : "# repo1\n \n Description for repo1" ,
241+ },
242+ },
243+ },
244+ }
245+ keywords = append (keywords , additional ... )
246+ }
247+
236248 for _ , kw := range keywords {
237249 t .Run (kw .Keyword , func (t * testing.T ) {
238250 total , res , langs , err := indexer .Search (context .TODO (), & internal.SearchOptions {
0 commit comments