<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 使用的對象 ``` @Autowired private ElasticsearchOperations restTemplate; ``` # 添加索引的相關api ``` IndexOperations indexOperations = restTemplate.indexOps(TestIndex.class); // 判斷是否已經有索引 boolean exists = indexOperations.exists(); System.out.println(exists); // 創建索引, 但是這個是沒有做映射的("mappings" 無信息) boolean b = indexOperations.create(); System.out.println(b); // 根據實體類獲取映射關系 Document mapping = indexOperations.createMapping(TestIndex.class); // 把映射關系添加到索引中 indexOperations.putMapping(mapping); ``` # 刪除索引 ``` IndexOperations indexOperations = restTemplate.indexOps(TestIndex.class); boolean delete = indexOperations.delete(); System.out.println(delete); ``` # TestIndex ``` import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.DateFormat; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; @AllArgsConstructor @NoArgsConstructor @Builder @Data // 索引名稱 @Document(indexName = "test_index") public class TestIndex implements Serializable { private static final long serialVersionUID = 1L; /** 數據來源是 CompanyContacts 表 和 CompanyContactsQcc 表 , sql 又不放一張表了 **/ @Id /** 業務id, CompanyContactsQcc 的主鍵 */ @Field(type = FieldType.Keyword) private String id; /**更新日期*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @Field(type = FieldType.Date, format = DateFormat.basic_date) private Date updateTime; /**企業名稱 設置為text 可以分詞 */ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String companyName; public void setCompanyName(String companyName) { if (StringUtils.isNotBlank(companyName)) { this.companyName = companyName; if (companyName.length() > 10) { this.companyNameSort = companyName.substring(0, 10); } else { this.companyNameSort = companyName; } } } /**企業名稱 用來排序的 存放 company 前10個字*/ @Field(type = FieldType.Keyword) private String companyNameSort; /**法定代表人 */ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String legalPerson; /**姓名 手動設置為keyword 但同時也就不能分詞 */ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String realname; /** 職務 **/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String post; /**手機號*/ @Field(type = FieldType.Keyword) private String phone; /**更多手機號*/ @Field(type = FieldType.Keyword) private String morePhone; /**企業地址*/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String companyAddress; /**行業*/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String industry; /**所屬省份*/ @Field(type = FieldType.Keyword) private String pname; /**所屬城市*/ @Field(type = FieldType.Keyword) private String cityname; /**所屬區縣*/ @Field(type = FieldType.Keyword) private String adname; /**統一社會信用代碼*/ @Field(type = FieldType.Keyword) private String usci; /**登記狀態*/ @Field(type = FieldType.Keyword) private String registrationStatus; /**注冊資本*/ @Field(type = FieldType.Auto) private BigDecimal registrationCapital; /**成立日期*/ @Field(type = FieldType.Date, format = DateFormat.basic_date) @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") private Date registrationDate; /**核準日期*/ @Field(type = FieldType.Date, format = DateFormat.basic_date) @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") private Date approvalDate; /**郵箱*/ @Field(type = FieldType.Keyword) private String email; /**更多郵箱*/ @Field(type = FieldType.Keyword) private String moreEmail; /**納稅人識別號*/ @Field(type = FieldType.Keyword) private String taxpayerId; /**注冊號*/ @Field(type = FieldType.Keyword) private String registrationNumber; /**組織機構代碼*/ @Field(type = FieldType.Keyword) private String organizationCode; /**參保人數*/ @Field(type = FieldType.Integer) private Integer contributorsIn; /**企業類型*/ @Field(type = FieldType.Keyword) private String companyType; /**曾用名*/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String usedName; /**英文名*/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String englishName; /**網址*/ @Field(type = FieldType.Keyword) private String website; /**最新年報地址*/ @Field(type = FieldType.Keyword) private String annalsAddress; /**經營范圍*/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String businessScope; /**來源 source =0 是 企查查, source = 1 是 內部數據 */ @Field(type = FieldType.Integer) @ApiModelProperty(value = "來源 source =0 是 企查查, source = 1 是 內部數據") private Integer source; /** CompanyContacts 表獨有的擴展字段 **/ /**擴展字段1*/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String field1; /**擴展字段2*/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String field2; /**擴展字段3*/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String field3; /**擴展字段4*/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String field4; /**擴展字段5*/ @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_max_word") private String field5; } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看