Skip to content

Commit

Permalink
move to correct place
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Jul 7, 2020
1 parent a6d3837 commit 091ce24
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions processor/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
PhraseHeavyBoost = 20
SpaceBoundBoost = 5
ExactMatchBoost = 5
RelevanceCutoff = 10000
)

type bestMatch struct {
Expand All @@ -41,8 +42,6 @@ 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 @@ -86,8 +85,8 @@ func extractRelevantV3(res *FileJob, documentFrequencies map[string]int, relLeng

// 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) > relevanceCutOff {
rv3 = rv3[:relevanceCutOff]
if len(rv3) > RelevanceCutoff {
rv3 = rv3[:RelevanceCutoff]
}

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

0 comments on commit 091ce24

Please sign in to comment.