Skip to content

Commit

Permalink
refactor: add threshold in followers search apis
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Mar 29, 2024
1 parent ecf43c0 commit 4cf6140
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/backend/analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ export default (apiUrl: string) => ({
* @param {string} analysisID - The Analysis process ID
* @param {number} from The 0-based index of the first Expert Reference object to list
* @param {number} howMany The number of the Expert Reference objects to list
* @param {number=} threshold Threshold between 0.0 and 1.0. User objects whose match level is below this threshold will be discarded. If null, all User objects will be returned.
*/
getUserQueryMatches: async (
authToken: string,
analysisID: string,
from: number,
howMany: number
howMany: number,
threshold?: number
) =>
apiFetcher(
`/Analysis/AnalyzeUserQuery/${authToken}/${analysisID}/${from}/${howMany}`,
`/Analysis/AnalyzeUserQuery/${authToken}/${analysisID}/${from}/${howMany}${
threshold ? `/${threshold}` : ''
}`,
{
apiUrl,
method: 'GET',
Expand Down
10 changes: 10 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,17 @@ export interface ImportWarning {
}

export interface AnalysisParams {
/**
* @type {string}
* Query to be matched with User objects in the analysis.
*/
query: string;
/**
* @type {number=}
* Threshold between 0.0 and 1.0. User objects whose match level is below this threshold will be discarded.
* If null, all User objects will be returned.
*/
threshold?: number;
}

export interface AnalysisWarning {
Expand Down

0 comments on commit 4cf6140

Please sign in to comment.