Skip to content

Commit

Permalink
Merge pull request #95 from tminaorg/undef-fix
Browse files Browse the repository at this point in the history
fixed undefined bug
  • Loading branch information
k4lizen authored Oct 2, 2023
2 parents d777c4d + 3a5a10f commit f4b4302
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/rank/rank.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ func SetRank(result *result.Result) {
func Rank(resMap map[string]*result.Result) []result.Result {
results := make([]result.Result, 0, len(resMap))
for _, res := range resMap {
res.EngineRanks = res.EngineRanks[0:res.TimesReturned:res.TimesReturned]
results = append(results, *res)
}

//setup retrieved rank here
FillRetrievedRank(results)

for ind := range results {
Expand All @@ -44,9 +44,6 @@ func FillRetrievedRank(results []result.Result) {
RetRank: er,
RRInd: rrind,
}
if er.SearchEngine == engines.Undefined { //this should be fixed. TODO
continue
}
engResults[er.SearchEngine] = append(engResults[er.SearchEngine], rf)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/search/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func PerformSearch(query string, options engines.Options, config *config.Config)
type EngineSearch func(context.Context, string, *bucket.Relay, engines.Options, config.Settings) error

func runEngines(engineMap map[string]config.Engine, query string, worker *conc.WaitGroup, relay *bucket.Relay, options engines.Options) {
log.Info().Msgf("Enabled engines: %v", config.EnabledEngines)
log.Info().Msgf("Enabled engines (%v): %v", len(config.EnabledEngines), config.EnabledEngines)

engineStarter := NewEngineStarter()
for name, engine := range engineMap {
Expand Down

0 comments on commit f4b4302

Please sign in to comment.