|
@@ -13,6 +13,48 @@ export class SearchService {
|
|
const esClient = new Client(this.esConfig);
|
|
const esClient = new Client(this.esConfig);
|
|
this.esClient = esClient;
|
|
this.esClient = esClient;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**信息检索-总数查看 */
|
|
|
|
+ async total(keyword: string) {
|
|
|
|
+ const list = [
|
|
|
|
+ { key: '1', tab: '企业', index: 'company', skip: 0, limit: 1, others: { status: '1' }, fields: ['industry', 'tags', 'name', 'pattern', 'scale', 'type', 'area', 'email', 'address', 'brief', 'products'] },
|
|
|
|
+ {
|
|
|
|
+ key: '2',
|
|
|
|
+ tab: '项目',
|
|
|
|
+ index: 'project',
|
|
|
|
+ skip: 0,
|
|
|
|
+ limit: 1,
|
|
|
|
+ others: { status: '1', is_use: '0' },
|
|
|
|
+ fields: ['tags', 'name', 'maturity', 'skill', 'type', 'area', 'field', 'cooperate', 'brief', 'main', 'progress', 'track_unit', 'source', 'industry'],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ key: '3',
|
|
|
|
+ tab: '需求',
|
|
|
|
+ index: 'demand',
|
|
|
|
+ skip: 0,
|
|
|
|
+ limit: 1,
|
|
|
|
+ others: { status: '1', is_use: '0' },
|
|
|
|
+ fields: ['industry', 'tags', 'name', 'field', 'urgent', 'method', 'area', 'brief', 'demand_status', 'company', 'company_brief', 'contacts', 'tec_name', 'question'],
|
|
|
|
+ },
|
|
|
|
+ { key: '4', tab: '供给', index: 'supply', skip: 0, limit: 1, others: { status: '1', is_use: '0' }, fields: ['industry', 'tags', 'name', 'field', 'urgent', 'method', 'area', 'brief', 'demand_status'] },
|
|
|
|
+ {
|
|
|
|
+ key: '5',
|
|
|
|
+ tab: '成果',
|
|
|
|
+ index: 'achievement',
|
|
|
|
+ skip: 0,
|
|
|
|
+ limit: 1,
|
|
|
|
+ others: { status: '1', is_use: '0' },
|
|
|
|
+ fields: ['industry', 'tags', 'name', 'patent', 'attribute', 'sell', 'mature', 'field', 'technology', 'area', 'brief', 'achievement_status', 'source'],
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ for (const val of list) {
|
|
|
|
+ const result = await this.oneIndexSearch(keyword, val.index, val.fields, val.skip, val.limit, val.others);
|
|
|
|
+ const total = get(result, 'total', 0);
|
|
|
|
+ val.tab = `${val.tab}(${total})`;
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**信息检索-企业查询 */
|
|
/**信息检索-企业查询 */
|
|
async company(keyword: string, skip = 0, limit = 10, others: object) {
|
|
async company(keyword: string, skip = 0, limit = 10, others: object) {
|
|
const index = 'company';
|
|
const index = 'company';
|