Shun Miyazawa il y a 3 ans
Parent
commit
d6affc55fe

+ 4 - 4
packages/app/src/server/service/search-delegator/elasticsearch.ts

@@ -970,10 +970,10 @@ class ElasticsearchDelegator implements SearchDelegator<Data, ESTermsKey, ESQuer
       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);