linwe
2024-07-08 7a1e4d9fe3fe2172d5c4fba524f17ffd73ffbb3e
src/main/java/org/springblade/es/service/ElasticsearchDocumentService.java
@@ -173,9 +173,9 @@
               // 刷新索引,确保文档可搜索
               client.indices().refresh(new RefreshRequest(esParam.getIndexName()), RequestOptions.DEFAULT);
            } catch (IOException e) {
               e.printStackTrace();
//               e.printStackTrace();
            }
            System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
//            System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
         }
      }
      // 返回
@@ -226,9 +226,9 @@
               // 刷新索引,确保文档可搜索
               client.indices().refresh(new RefreshRequest(esParam.getIndexName()), RequestOptions.DEFAULT);
            } catch (IOException e) {
               e.printStackTrace();
//               e.printStackTrace();
            }
            System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
//            System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
         }
      }
      // 返回
@@ -261,6 +261,7 @@
                  "tableId", household.getId().toString(),
                  "tableName", "jczz_household",
                  "title", household.getName(),
                  "relationship", household.getRelationship(),
                  "name", household.getName(),
                  "phone", household.getPhoneNumber(),
                  "idCard", household.getIdCard(),
@@ -277,9 +278,9 @@
               // 刷新索引,确保文档可搜索
               client.indices().refresh(new RefreshRequest(esParam.getIndexName()), RequestOptions.DEFAULT);
            } catch (IOException e) {
               e.printStackTrace();
//               e.printStackTrace();
            }
            System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
//            System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
         }
      }
      // 返回
@@ -328,9 +329,9 @@
               // 刷新索引,确保文档可搜索
               client.indices().refresh(new RefreshRequest(esParam.getIndexName()), RequestOptions.DEFAULT);
            } catch (IOException e) {
               e.printStackTrace();
//               e.printStackTrace();
            }
            System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
//            System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
         }
      }
      // 返回
@@ -362,7 +363,7 @@
               "articleType", article.getArticleType()
            );
         } catch (IOException e) {
            e.printStackTrace();
//            e.printStackTrace();
         }
      }
   }
@@ -388,7 +389,7 @@
               "communityCode", placeService.getCommunityCode(place.getId())
            );
         } catch (IOException e) {
            e.printStackTrace();
//            e.printStackTrace();
         }
      }
   }
@@ -414,7 +415,7 @@
               "communityCode", houseService.getCommunityCode(house.getId())
            );
         } catch (IOException e) {
            e.printStackTrace();
//            e.printStackTrace();
         }
      }
   }
@@ -441,7 +442,7 @@
               "communityCode", householdService.getCommunityCode(household.getId())
            );
         } catch (IOException e) {
            e.printStackTrace();
//            e.printStackTrace();
         }
      }
   }
@@ -618,9 +619,9 @@
               // 输出操作结果
               boolean acknowledged = deleteResponse.isAcknowledged();
               System.out.println("索引删除成功: " + acknowledged);
//               System.out.println("索引删除成功: " + acknowledged);
            } catch (IOException e) {
               e.printStackTrace();
//               e.printStackTrace();
            }
         }
      }
@@ -638,7 +639,7 @@
      try {
         indexDocument(esParam.getIndexName(), str);
      } catch (IOException e) {
         e.printStackTrace();
//         e.printStackTrace();
      }
      return true;
   }
@@ -688,7 +689,7 @@
            // 刷新索引,确保文档可搜索
            client.indices().refresh(new RefreshRequest(esParam.getIndexName()), RequestOptions.DEFAULT);
         } catch (IOException e) {
            e.printStackTrace();
//            e.printStackTrace();
         }
      }
   }
@@ -772,7 +773,7 @@
            BulkByScrollResponse bulkResponse =
               client.deleteByQuery(deleteByQueryRequest, RequestOptions.DEFAULT);
         } catch (IOException e) {
            e.printStackTrace();
//            e.printStackTrace();
         }
      }
      return true;