This commit is contained in:
2025-12-03 10:11:21 +01:00
parent 3346486b6b
commit 77fca5e47c
5 changed files with 17 additions and 9 deletions
@@ -154,7 +154,9 @@ export default function sqlGenerator<
let fullTextMatchStr = genObject?.fullTextSearch
? ` MATCH(${genObject.fullTextSearch.fields
.map((f) => (genObject.join ? `${tableName}.${f}` : `${f}`))
.map((f) =>
genObject.join ? `${tableName}.${String(f)}` : `${String(f)}`
)
.join(",")}) AGAINST (?)`
: undefined;
+5 -3
View File
@@ -1013,12 +1013,14 @@ export type ServerQueryParam<
join?: ServerQueryParamsJoin<K>[];
group?: (keyof T)[];
countSubQueries?: ServerQueryParamsCount[];
fullTextSearch?: ServerQueryParamFullTextSearch;
fullTextSearch?: ServerQueryParamFullTextSearch<T>;
[key: string]: any;
};
export type ServerQueryParamFullTextSearch = {
fields: string[];
export type ServerQueryParamFullTextSearch<
T extends { [k: string]: any } = { [k: string]: any }
> = {
fields: (keyof T)[];
searchTerm: string;
/** Field Name to user to Rank the Score of Search Results */
scoreAlias: string;