Skip to content

Commit

Permalink
fixup! feat(cardano-services): implement new fuzzy search options
Browse files Browse the repository at this point in the history
  • Loading branch information
iccicci committed May 9, 2024
1 parent 4700bad commit 4533fd0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const DEFAULT_FUZZY_SEARCH_OPTIONS: FuzzyOptions = {
minMatchCharLength: 1,
threshold: 0.3,
useExtendedSearch: false,
weights: { description: 4, homepage: 1, name: 6, poolId: 0, ticker: 10 }
weights: { description: 4, homepage: 1, name: 6, poolId: 1, ticker: 10 }
};

/** Properties that are need to create TypeormStakePoolProvider */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('TypeormStakePoolProvider utils', () => {
it('correctly parse a valid options object', () =>
expect(
validateFuzzyOptions(
'{"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":1,"ticker":10}}'
)
).toStrictEqual(DEFAULT_FUZZY_SEARCH_OPTIONS));
});
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":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}}';
'{"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":1,"ticker":10}}';

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

0 comments on commit 4533fd0

Please sign in to comment.