49
49
import org .opensearch .client .indices .CreateIndexRequest ;
50
50
import org .opensearch .client .indices .CreateIndexResponse ;
51
51
import org .opensearch .client .indices .GetIndexRequest ;
52
- import org .opensearch .common .Strings ;
53
52
import org .opensearch .common .settings .Settings ;
54
- import org .opensearch .common .unit .ByteSizeUnit ;
55
- import org .opensearch .common .unit .ByteSizeValue ;
56
53
import org .opensearch .common .unit .TimeValue ;
57
54
import org .opensearch .common .xcontent .XContentType ;
55
+ import org .opensearch .core .common .Strings ;
56
+ import org .opensearch .core .common .unit .ByteSizeUnit ;
57
+ import org .opensearch .core .common .unit .ByteSizeValue ;
58
58
import org .opensearch .index .query .QueryBuilder ;
59
59
import org .opensearch .index .query .QueryBuilders ;
60
60
import org .opensearch .search .builder .SearchSourceBuilder ;
@@ -229,7 +229,7 @@ public boolean indexDocument(String index, String documentId, String documentSou
229
229
if (!Strings .isNullOrEmpty (documentId )) {
230
230
indexRequest .id (documentId );
231
231
}
232
- indexRequest . type ( config . getTypeName ());
232
+
233
233
indexRequest .source (documentSource , XContentType .JSON );
234
234
235
235
IndexResponse indexResponse = client .index (indexRequest , RequestOptions .DEFAULT );
@@ -245,7 +245,7 @@ public boolean indexDocument(String index, String documentId, String documentSou
245
245
public boolean deleteDocument (String index , String documentId ) throws IOException {
246
246
DeleteRequest deleteRequest = Requests .deleteRequest (index );
247
247
deleteRequest .id (documentId );
248
- deleteRequest . type ( config . getTypeName ());
248
+
249
249
DeleteResponse deleteResponse = client .delete (deleteRequest , RequestOptions .DEFAULT );
250
250
if (log .isDebugEnabled ()) {
251
251
log .debug ("delete result {}" , deleteResponse .getResult ());
@@ -301,7 +301,7 @@ public void appendIndexRequest(BulkProcessor.BulkIndexRequest request) throws IO
301
301
if (!Strings .isNullOrEmpty (request .getDocumentId ())) {
302
302
indexRequest .id (request .getDocumentId ());
303
303
}
304
- indexRequest . type ( config . getTypeName ());
304
+
305
305
indexRequest .source (request .getDocumentSource (), XContentType .JSON );
306
306
if (log .isDebugEnabled ()) {
307
307
log .debug ("append index request id={}, type={}, source={}" , request .getDocumentId (), config .getTypeName (),
@@ -314,7 +314,7 @@ public void appendIndexRequest(BulkProcessor.BulkIndexRequest request) throws IO
314
314
public void appendDeleteRequest (BulkProcessor .BulkDeleteRequest request ) throws IOException {
315
315
DeleteRequest deleteRequest = new DeleteRequestWithPulsarRecord (request .getIndex (), request .getRecord ());
316
316
deleteRequest .id (request .getDocumentId ());
317
- deleteRequest . type ( config . getTypeName ());
317
+
318
318
if (log .isDebugEnabled ()) {
319
319
log .debug ("append delete request id={}, type={}" , request .getDocumentId (), config .getTypeName ());
320
320
}
0 commit comments