79
79
import org .elasticsearch .action .update .UpdateResponse ;
80
80
import org .elasticsearch .client .GetAliasesResponse ;
81
81
import org .elasticsearch .client .Request ;
82
- import org .elasticsearch .client .indices .CreateIndexRequest ;
83
- import org .elasticsearch .client .indices .GetFieldMappingsRequest ;
84
- import org .elasticsearch .client .indices .GetFieldMappingsResponse ;
85
- import org .elasticsearch .client .indices .GetIndexRequest ;
86
- import org .elasticsearch .client .indices .GetIndexResponse ;
87
- import org .elasticsearch .client .indices .GetIndexTemplatesRequest ;
88
- import org .elasticsearch .client .indices .GetIndexTemplatesResponse ;
89
- import org .elasticsearch .client .indices .GetMappingsRequest ;
90
- import org .elasticsearch .client .indices .GetMappingsResponse ;
91
- import org .elasticsearch .client .indices .IndexTemplatesExistRequest ;
92
- import org .elasticsearch .client .indices .PutIndexTemplateRequest ;
93
- import org .elasticsearch .client .indices .PutMappingRequest ;
82
+ import org .elasticsearch .client .indices .*;
94
83
import org .elasticsearch .common .unit .TimeValue ;
95
84
import org .elasticsearch .common .xcontent .DeprecationHandler ;
96
85
import org .elasticsearch .common .xcontent .NamedXContentRegistry ;
@@ -647,7 +636,7 @@ private RequestBodySpec sendRequest(WebClient webClient, String logId, Request r
647
636
// region indices operations
648
637
@ Override
649
638
public Mono <Boolean > createIndex (HttpHeaders headers ,
650
- org .elasticsearch .action .admin .indices .create .CreateIndexRequest createIndexRequest ) {
639
+ org .elasticsearch .action .admin .indices .create .CreateIndexRequest createIndexRequest ) {
651
640
652
641
return sendRequest (createIndexRequest , requestCreator .indexCreate (), AcknowledgedResponse .class , headers ) //
653
642
.map (AcknowledgedResponse ::isAcknowledged ) //
@@ -670,21 +659,22 @@ public Mono<Void> closeIndex(HttpHeaders headers, CloseIndexRequest closeIndexRe
670
659
}
671
660
672
661
@ Override
673
- public Mono <Boolean > existsIndex (HttpHeaders headers , org .elasticsearch .action .admin .indices .get .GetIndexRequest request ) {
662
+ public Mono <Boolean > existsIndex (HttpHeaders headers ,
663
+ org .elasticsearch .action .admin .indices .get .GetIndexRequest request ) {
674
664
675
665
return sendRequest (request , requestCreator .indexExists (), RawActionResponse .class , headers ) //
676
666
.flatMap (response -> response .releaseBody ().thenReturn (response .statusCode ().is2xxSuccessful ())) //
677
667
.next ();
678
668
}
679
669
680
- @ Override
681
- public Mono <Boolean > existsIndex (HttpHeaders headers , GetIndexRequest request ) {
682
- return sendRequest (request , requestCreator .indexExistsRequest (), RawActionResponse .class , headers ) //
683
- .flatMap (response -> response .releaseBody ().thenReturn (response .statusCode ().is2xxSuccessful ())) //
684
- .next ();
685
- }
670
+ @ Override
671
+ public Mono <Boolean > existsIndex (HttpHeaders headers , GetIndexRequest request ) {
672
+ return sendRequest (request , requestCreator .indexExistsRequest (), RawActionResponse .class , headers ) //
673
+ .flatMap (response -> response .releaseBody ().thenReturn (response .statusCode ().is2xxSuccessful ())) //
674
+ .next ();
675
+ }
686
676
687
- @ Override
677
+ @ Override
688
678
public Mono <Boolean > deleteIndex (HttpHeaders headers , DeleteIndexRequest request ) {
689
679
690
680
return sendRequest (request , requestCreator .indexDelete (), AcknowledgedResponse .class , headers ) //
@@ -701,15 +691,15 @@ public Mono<Void> flushIndex(HttpHeaders headers, FlushRequest flushRequest) {
701
691
702
692
@ Override
703
693
public Mono <org .elasticsearch .action .admin .indices .mapping .get .GetMappingsResponse > getMapping (HttpHeaders headers ,
704
- org .elasticsearch .action .admin .indices .mapping .get .GetMappingsRequest getMappingsRequest ) {
694
+ org .elasticsearch .action .admin .indices .mapping .get .GetMappingsRequest getMappingsRequest ) {
705
695
return sendRequest (getMappingsRequest , requestCreator .getMapping (),
706
- org .elasticsearch .action .admin .indices .mapping .get .GetMappingsResponse .class , headers ).next ();
696
+ org .elasticsearch .action .admin .indices .mapping .get .GetMappingsResponse .class , headers ).next ();
707
697
}
708
698
709
699
@ Override
710
700
public Mono <GetMappingsResponse > getMapping (HttpHeaders headers , GetMappingsRequest getMappingsRequest ) {
711
701
return sendRequest (getMappingsRequest , requestCreator .getMappingRequest (), GetMappingsResponse .class , headers ) //
712
- .next ();
702
+ .next ();
713
703
}
714
704
715
705
@ Override
@@ -726,7 +716,7 @@ public Mono<GetSettingsResponse> getSettings(HttpHeaders headers, GetSettingsReq
726
716
727
717
@ Override
728
718
public Mono <Boolean > putMapping (HttpHeaders headers ,
729
- org .elasticsearch .action .admin .indices .mapping .put .PutMappingRequest putMappingRequest ) {
719
+ org .elasticsearch .action .admin .indices .mapping .put .PutMappingRequest putMappingRequest ) {
730
720
731
721
return sendRequest (putMappingRequest , requestCreator .putMapping (), AcknowledgedResponse .class , headers ) //
732
722
.map (AcknowledgedResponse ::isAcknowledged ) //
@@ -735,9 +725,9 @@ public Mono<Boolean> putMapping(HttpHeaders headers,
735
725
736
726
@ Override
737
727
public Mono <Boolean > putMapping (HttpHeaders headers , PutMappingRequest putMappingRequest ) {
738
- return sendRequest (putMappingRequest , requestCreator .putMappingRequest (), AcknowledgedResponse .class , headers ) //
739
- .map (AcknowledgedResponse ::isAcknowledged ) //
740
- .next ();
728
+ return sendRequest (putMappingRequest , requestCreator .putMappingRequest (), AcknowledgedResponse .class , headers ) //
729
+ .map (AcknowledgedResponse ::isAcknowledged ) //
730
+ .next ();
741
731
}
742
732
743
733
@ Override
0 commit comments