Skip to content

Commit

Permalink
lower value
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Jul 7, 2020
1 parent e244958 commit a6d3837
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions processor/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ type Snippet struct {
LineEnd int
}

var relevanceCutOff = 10000

// Looks though the locations using a sliding window style algorithm
// where it "brute forces" the solution by iterating over every location we have
// and look for all matches that fall into the supplied length and ranking
Expand Down Expand Up @@ -83,9 +85,9 @@ func extractRelevantV3(res *FileJob, documentFrequencies map[string]int, relLeng
rv3 := convertToRelevant(res)

// if we have a huge amount of matches we want to reduce it because otherwise it takes forever
// to return something if the search has many matches
if len(rv3) > 20000 {
rv3 = rv3[:20000]
// to return something if the search has many matches.
if len(rv3) > relevanceCutOff {
rv3 = rv3[:relevanceCutOff]
}

// Slide around looking for matches that fit in the length
Expand Down

0 comments on commit a6d3837

Please sign in to comment.