chuweiqiang пре 1 година
родитељ
комит
0acf7383eb

+ 3 - 1
.idea/workspace.xml

@@ -2,9 +2,11 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/Expedite.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Expedite.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/runtime/log/single.log" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/log/single.log" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/runtime/log/single_error.log" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/log/single_error.log" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runtime/log/single_sql.log" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/log/single_sql.log" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -481,7 +483,7 @@
       <workItem from="1700526499424" duration="11662000" />
       <workItem from="1700613253175" duration="10732000" />
       <workItem from="1700699350870" duration="25020000" />
-      <workItem from="1700785845814" duration="3121000" />
+      <workItem from="1700785845814" duration="3180000" />
     </task>
     <servers />
   </component>

+ 18 - 18
application/api/controller/Expedite.php

@@ -1483,16 +1483,16 @@ class Expedite extends Base
         if($module)             $where['body']['query']['bool']['must'][] = ['match' =>['module'=> $module]];
         if($module == 'demand' && $is_over != -1 )  $where['body']['query']['bool']['must'][] = ['match' =>['is_over'=> $is_over]];
         if($module == 'recruit' && $city )          $where['body']['query']['bool']['must'][] = ['match' =>['city'=> $city]];
-//        if($search) $where['body']['query']['bool']['must'][] = ['bool' =>[
-//            'should'=> [
-//                'multi_match' => [
-//                    'fields'=> ['title','label','desc','content','detail'],
-//                    'query'=> $search,
-//                    "fuzziness"=>"AUTO",
-//                    'type'=> 'best_fields',
-//                ]]]];
-        if($search) $where['body']['query']['bool']['must'][] = [
-            'bool' =>[
+        if($search) $where['body']['query']['bool']['must'][] = ['bool' =>[
+            'should'=> [
+                'multi_match' => [
+                    'fields'=> ['title','label','desc','content','detail'],
+                    'query'=> $search,
+                    "fuzziness"=>"AUTO",
+                    'type'=> 'best_fields',
+                ]]]];
+//        if($search) $where['body']['query']['bool']['must'][] = [
+//            'bool' =>[
 //            'should'=> [
 //                'match_phrase'=>[
 //                    'title' => [
@@ -1500,15 +1500,15 @@ class Expedite extends Base
 //                        'slop' => 5
 //                    ]
 //                ],
-                'multi_match' => [
-                    'fields'=> ['title','label','desc','content','detail'],
-                    'query'=> $search,
-                    "fuzziness"=>"AUTO",
-                    'type'=> 'best_fields',
-                ]
-            ]
+//                'multi_match' => [
+//                    'fields'=> ['title','label','desc','content','detail'],
+//                    'query'=> $search,
+//                    "fuzziness"=>"AUTO",
+//                    'type'=> 'best_fields',
+//                ]
+//            ]
 //        ]
-        ];
+//        ];
 
 //        return json($where);
         $list = Elastic::select($index,$where);

+ 27 - 0
runtime/log/single.log

@@ -53034,3 +53034,30 @@
   'page_num' => '20',
   'sort_type' => '1',
 )
+---------------------------------------------------------------
+
+[2023-11-24T09:25:44+08:00] 127.0.0.1 POST gaoyx.com/api/Expedite/ElasticSearch
+[运行时间:2.653910s] [吞吐率:0.38req/s] [内存消耗:8,331.65kb] [文件加载:238]
+[ info ] [ LANG ] D:\project\gyx\gaoyixia\vendor\zoujingli\think-library\src/lang/zh-cn.php
+[ info ] [ LANG ] D:\project\gyx\gaoyixia\vendor\zoujingli\think-library\src/lang/en-us.php
+[ info ] [ LANG ] D:\project\gyx\gaoyixia\thinkphp\lang\zh-cn.php
+[ info ] [ ROUTE ] array (
+)
+[ info ] [ HEADER ] array (
+  'content-length' => '490',
+  'content-type' => 'multipart/form-data; boundary=--------------------------612038272169542168448106',
+  'host' => 'gaoyx.com',
+  'connection' => 'keep-alive',
+  'accept-encoding' => 'gzip, deflate, br',
+  'accept' => '*/*',
+  'authorization' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjQ3OSwiaXNzIjoiaHR0cHM6XC9cL3phaW4uY29tIiwiYXVkIjoiaHR0cHM6XC9cL3phaW4uY29tIiwiaWF0IjoxNzAwNzAwNjk3LCJuYmYiOjE3MDA3MDA2OTcsImV4cCI6MTcwMjE0MDY5NywiZmFjaWxpdHlfY29kZSI6ImRtbDJiMVl5TVRFNFFUTXhNVEk9IiwibG9naW5fdHlwZSI6IjEifQ.5lzYUqWdfHPV9rjS6UPHBfgozBSAjzpQBLDqgC9LPC8',
+  'cache-control' => 'no-cache',
+  'user-agent' => 'PostmanRuntime-ApipostRuntime/1.1.0',
+)
+[ info ] [ PARAM ] array (
+  'search' => '测试1',
+  'page' => '1',
+  'page_num' => '20',
+  'sort_type' => '1',
+)
+[ info ] [ DB ] INIT mysql

+ 4 - 0
runtime/log/single_error.log

@@ -251,3 +251,7 @@
 
 [2023-11-24T09:25:02+08:00] 127.0.0.1 POST gaoyx.com/api/Expedite/ElasticSearch
 [ error ] [0]语法解析错误: syntax error, unexpected ']'[D:\project\gyx\gaoyixia\application\api\controller\Expedite.php:1511]
+---------------------------------------------------------------
+
+[2023-11-24T09:25:44+08:00] 127.0.0.1 POST gaoyx.com/api/Expedite/ElasticSearch
+[ error ] [400]{"error":{"root_cause":[{"type":"x_content_parse_exception","reason":"[1:170] [bool] unknown field [multi_match]"}],"type":"x_content_parse_exception","reason":"[1:184] [bool] failed to parse field [must]","caused_by":{"type":"x_content_parse_exception","reason":"[1:170] [bool] unknown field [multi_match]"}},"status":400}[D:\project\gyx\gaoyixia\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php:693]

+ 14 - 0
runtime/log/single_sql.log

@@ -15466,3 +15466,17 @@
 [ sql ] [ SQL ] SELECT `id`,`account_type`,`group_id`,`is_first`,`group_first` FROM `dd_store_member` WHERE  `id` = 479 LIMIT 1 [ RunTime:0.107983s ]
 [ sql ] [ SQL ] SHOW COLUMNS FROM `dd_user_level_rank` [ RunTime:0.111277s ]
 [ sql ] [ SQL ] SELECT MAX(`level_id`) AS tp_max FROM `dd_user_level_rank` WHERE  `user_id` = 479  AND `end_time` > 1700789028 [ RunTime:0.111964s ]
+---------------------------------------------------------------
+
+[2023-11-24T09:25:44+08:00] 127.0.0.1 POST gaoyx.com/api/Expedite/ElasticSearch
+[ sql ] [ DB ] CONNECT:[ UseTime:0.187953s ] mysql:host=120.79.86.50;port=3306;dbname=gaoyixia_hdlkeji;charset=utf8mb4
+[ sql ] [ SQL ] SHOW COLUMNS FROM `dd_system_config` [ RunTime:0.124431s ]
+[ sql ] [ SQL ] SELECT `name`,`value` FROM `dd_system_config` [ RunTime:1.223457s ]
+[ sql ] [ SQL ] SHOW COLUMNS FROM `dd_store_member` [ RunTime:0.120147s ]
+[ sql ] [ SQL ] SELECT * FROM `dd_store_member` WHERE  `id` = 479 LIMIT 1 [ RunTime:0.120737s ]
+[ sql ] [ SQL ] SHOW COLUMNS FROM `dd_user_search` [ RunTime:0.115853s ]
+[ sql ] [ SQL ] SELECT * FROM `dd_user_search` WHERE  `user_id` = 479  AND `type` = 0  AND `title` = '测试1' LIMIT 1 [ RunTime:0.115926s ]
+[ sql ] [ SQL ] UPDATE `dd_user_search`  SET `user_id` = 479 , `title` = '测试1' , `type` = 0 , `create_at` = '2023-11-24 09:25:44'  WHERE  `user_id` = 479  AND `type` = 0  AND `title` = '测试1' [ RunTime:0.118325s ]
+[ sql ] [ SQL ] SELECT `id`,`account_type`,`group_id`,`is_first`,`group_first` FROM `dd_store_member` WHERE  `id` = 479 LIMIT 1 [ RunTime:0.116483s ]
+[ sql ] [ SQL ] SHOW COLUMNS FROM `dd_user_level_rank` [ RunTime:0.118623s ]
+[ sql ] [ SQL ] SELECT MAX(`level_id`) AS tp_max FROM `dd_user_level_rank` WHERE  `user_id` = 479  AND `end_time` > 1700789144 [ RunTime:0.117323s ]