Skip to content

Commit

Permalink
feat(cardano-services): implement new fuzzy search options
Browse files Browse the repository at this point in the history
  • Loading branch information
mchappell committed May 9, 2024
1 parent 5a51904 commit 4700bad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ import {
import Fuse from 'fuse.js';

export const DEFAULT_FUZZY_SEARCH_OPTIONS: FuzzyOptions = {
distance: 100,
distance: 255,
fieldNormWeight: 1,
ignoreFieldNorm: false,
ignoreLocation: false,
location: 0,
minMatchCharLength: 3,
threshold: 0.4,
minMatchCharLength: 1,
threshold: 0.3,
useExtendedSearch: false,
weights: { description: 1, homepage: 2, name: 3, poolId: 4, ticker: 4 }
weights: { description: 4, homepage: 1, name: 6, poolId: 0, ticker: 10 }
};

/** Properties that are need to create TypeormStakePoolProvider */
Expand Down
2 changes: 1 addition & 1 deletion packages/cardano-services/test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ describe('CLI', () => {

describe('fuzzyOptions', () => {
const FUZZY_OPTIONS =
'{"distance":100,"fieldNormWeight":1,"ignoreFieldNorm":false,"ignoreLocation":false,"location":0,"minMatchCharLength":3,"threshold":0.4,"useExtendedSearch":false,"weights":{"description":1,"homepage":2,"name":3,"poolId":4,"ticker":4}}';
'{"distance":255,"fieldNormWeight":1,"ignoreFieldNorm":false,"ignoreLocation":false,"location":0,"minMatchCharLength":1,"threshold":0.3,"useExtendedSearch":false,"weights":{"description":4,"homepage":1,"name":6,"poolId":0,"ticker":10}}';

testCli('has a default value', 'provider', {
expectedArgs: { args: { fuzzyOptions: DEFAULT_FUZZY_SEARCH_OPTIONS } }
Expand Down

0 comments on commit 4700bad

Please sign in to comment.