linwe
2024-07-15 8f5aeec641d916806553ef9772d55e17e93db150
src/main/java/org/springblade/es/service/ElasticsearchDocumentService.java
@@ -18,7 +18,10 @@
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.reindex.*;
import org.elasticsearch.index.reindex.BulkByScrollResponse;
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.index.reindex.UpdateByQueryRequest;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptType;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
@@ -46,7 +49,6 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.elasticsearch.script.Script;
import java.io.IOException;
import java.util.ArrayList;
@@ -429,6 +431,10 @@
   @Async
   public void addHousehold(EsParam esParam, HouseholdEntity household) {
      if (elasticsearchSync) {
         // 如果关系为空,则默认为19
         if (household.getRelationship() == null) {
            household.setRelationship(19);
         }
         try {
            indexDocument(esParam.getIndexName(),
               "tableId", household.getId().toString(),