lrf 7 kuukautta sitten
vanhempi
commit
6036271486

+ 3 - 1
src/controller/contactSearch.controller.ts

@@ -23,7 +23,9 @@ export class ContactSearchController {
     const achievementConfig = { index: 'achievement', fields: ['name', 'tags', 'brief'] };
     // const ares = await this.csService.search(keyword, achievementConfig, 'demand', id);
     const ares = await this.csService.newSearch(keyword, achievementConfig, 'demand', id);
-    return sres || ares;
+    const projectConfig = { index: 'project' };
+    const pres = await this.csService.newSearch(keyword, projectConfig, 'demand', id);
+    return sres || ares || pres;
   }
 
   /**

+ 2 - 2
src/service/accurateMatching.service.ts

@@ -41,7 +41,7 @@ export class AccurateMatchingService {
   // 由需求信息查询
   async forSupplySearch(keyword: string, skip = 0, limit = 10, id) {
     const fields = ['name', 'tags', 'brief'];
-    const config = { index: ['demand', 'achievement'], fields };
+    const config = { index: ['demand'], fields };
     const origin_index = 'supply';
     return await this.manyIndexsSearch(keyword, config, skip, limit, origin_index, id);
   }
@@ -175,7 +175,7 @@ export class AccurateMatchingService {
           boost: 0.6,
         },
       },
-      // min_score: 3,
+      min_score: 3,
       size: limit,
       from: skip,
       explain: true,

+ 1 - 1
src/service/contactSearch.service.ts

@@ -77,7 +77,7 @@ export class ContactSearchService {
       // 先看下正向匹配(由 浏览数据的 标题 作为关键词, 到用户审核过的数据中进行查询)
       const recommend = get(data, '_recommend', 0);
       const firRecommend = recommend >= 3;
-      // 如果大于等于4,则返回成功
+      // 如果大于等于3,则返回成功
       if (firRecommend) return true;
     }
     return false;