|
|
@@ -963,17 +963,17 @@ class ElasticsearchDelegator implements SearchDelegator<Data, ESTermsKey, ESQuer
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- async search(data: SearchableData<ESQueryTerms>, user, userGroups, option): Promise<ISearchResult<unknown>> {
|
|
|
+ async search(data: SearchableData<ESQueryTerms>, user, userGroups, option?): Promise<ISearchResult<unknown>> {
|
|
|
const { queryString, terms } = data;
|
|
|
|
|
|
if (terms == null) {
|
|
|
throw Error('Cannnot process search since terms is undefined.');
|
|
|
}
|
|
|
|
|
|
- const from = option.offset || null;
|
|
|
- const size = option.limit || null;
|
|
|
- const sort = option.sort || null;
|
|
|
- const order = option.order || null;
|
|
|
+ const from = option?.offset ?? null;
|
|
|
+ const size = option?.limit ?? null;
|
|
|
+ const sort = option?.sort ?? null;
|
|
|
+ const order = option?.order ?? null;
|
|
|
const query = this.createSearchQuery();
|
|
|
this.appendCriteriaForQueryString(query, terms);
|
|
|
|