Skip to content

Commit

Permalink
Merge pull request #532 from adamdecaf/add-env-search-maxworkers
Browse files Browse the repository at this point in the history
feat: add SEARCH_MAX_WORKERS
  • Loading branch information
adamdecaf authored Jan 29, 2024
2 parents 24725c8 + ba83fbd commit b1cb347
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,16 @@ You should get this response:
PONG
```

### Configuration settings
### Configuration settings

| Environmental Variable | Description | Default |
|-----|-----|-----|
| `DATA_REFRESH_INTERVAL` | Interval for data redownload and reparse. `off` disables this refreshing. | 12h |
| `INITIAL_DATA_DIRECTORY` | Directory filepath with initial files to use instead of downloading. Periodic downloads will replace the initial files. | Empty |
| `SEARCH_MAX_WORKERS` | Maximum number of goroutines used for search. | 1024 |
| `ADJACENT_SIMILARITY_POSITIONS` | How many nearby words to search for highest max similarly score. | 3 |
| `EXACT_MATCH_FAVORITISM` | Extra weighting assigned to exact matches. | 0.0 |
| `LENGTH_DIFFERENCE_CUTOFF_FACTOR` | Minimum ratio for the length of two matching tokens, before they score is penalised. | 0.9 |
| `LENGTH_DIFFERENCE_CUTOFF_FACTOR` | Minimum ratio for the length of two matching tokens, before they score is penalised. | 0.9 |
| `LENGTH_DIFFERENCE_PENALTY_WEIGHT` | Weight of penalty applied to scores when two matching tokens have different lengths. | 0.3 |
| `DIFFERENT_LETTER_PENALTY_WEIGHT` | Weight of penalty applied to scores when two matching tokens begin with different letters. | 0.9 |
| `UNMATCHED_INDEX_TOKEN_WEIGHT` | Weight of penalty applied to scores when part of the indexed name isn't matched. | 0.15 |
Expand Down
4 changes: 3 additions & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ func main() {
} else {
pipeline = newPipeliner(log.NewNopLogger())
}
searcher := newSearcher(logger, pipeline, *flagWorkers)

searchWorkers := readInt(os.Getenv("SEARCH_MAX_WORKERS"), *flagWorkers)
searcher := newSearcher(logger, pipeline, searchWorkers)

// Add debug routes
adminServer.AddHandler(debugSDNPath, debugSDNHandler(logger, searcher))
Expand Down
1 change: 1 addition & 0 deletions docs/usage-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ menubar: docs-menu
|-----|-----|-----|
| `DATA_REFRESH_INTERVAL` | Interval for data redownload and reparse. `off` disables this refreshing. | 12h |
| `INITIAL_DATA_DIRECTORY` | Directory filepath with initial files to use instead of downloading. Periodic downloads will replace the initial files. | Empty |
| `SEARCH_MAX_WORKERS` | Maximum number of goroutines used for search. | 1024 |
| `ADJACENT_SIMILARITY_POSITIONS` | How many nearby words to search for highest max similarly score. | 3 |
| `EXACT_MATCH_FAVORITISM` | Extra weighting assigned to exact matches. | 0.0 |
| `JARO_WINKLER_BOOST_THRESHOLD` | Jaro-Winkler boost threshold. | 0.7 |
Expand Down

0 comments on commit b1cb347

Please sign in to comment.