Class ElasticContentRequestBuilder
- java.lang.Object
-
- org.exoplatform.commons.search.es.client.ElasticContentRequestBuilder
-
public class ElasticContentRequestBuilder extends Object
Created by The eXo Platform SAS Author : Thibault Clement tclement@exoplatform.com 9/3/15
-
-
Constructor Summary
Constructors Constructor Description ElasticContentRequestBuilder()ElasticContentRequestBuilder(org.exoplatform.container.configuration.ConfigurationManager configurationManager, org.exoplatform.container.xml.InitParams initParams)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCreateDocumentRequestContent(ElasticIndexingServiceConnector connector, String id)Get an ES create document content to insert in a bulk request For instance: { "create" : { "_index" : "blog", "_type" : "post", "_id" : "blog_post_1" } } { "field1" : "value3" }StringgetCreateIndexRequestContent(ElasticIndexingServiceConnector connector)Get an ES create Index request contentStringgetCreatePipelineDocumentRequestContent(ElasticIndexingServiceConnector connector, String id)Get an ES create/update document content to put into a pipeline The content of the request will update the full document (and not partially) For instance: { "field1" : "value3" }StringgetDefaultSettings()StringgetDeleteAllDocumentsRequestContent()Get a deleteAll ES queryStringgetDeleteDocumentRequestContent(ElasticIndexingServiceConnector connector, String id)Get an ES delete document content to insert in a bulk request For instance: { "delete" : { "_index" : "blog", "_type" : "post", "_id" : "blog_post_1" } }StringgetUpdateDocumentRequestContent(ElasticIndexingServiceConnector connector, String id)Get an ES update document content to insert in a bulk request We use the create api to reindex the full document (and not partially) For instance: { "create" : { "_index" : "blog", "_type" : "post", "_id" : "blog_post_1" } } { "field1" : "value3" }
-
-
-
Method Detail
-
getCreateIndexRequestContent
public String getCreateIndexRequestContent(ElasticIndexingServiceConnector connector)
Get an ES create Index request content- Parameters:
connector- ES connector- Returns:
- JSON containing a create index request content
-
getDeleteAllDocumentsRequestContent
public String getDeleteAllDocumentsRequestContent()
Get a deleteAll ES query- Returns:
- JSON containing a delete request
-
getDeleteDocumentRequestContent
public String getDeleteDocumentRequestContent(ElasticIndexingServiceConnector connector, String id)
Get an ES delete document content to insert in a bulk request For instance: { "delete" : { "_index" : "blog", "_type" : "post", "_id" : "blog_post_1" } }- Returns:
- JSON containing a delete request
-
getCreateDocumentRequestContent
public String getCreateDocumentRequestContent(ElasticIndexingServiceConnector connector, String id)
Get an ES create document content to insert in a bulk request For instance: { "create" : { "_index" : "blog", "_type" : "post", "_id" : "blog_post_1" } } { "field1" : "value3" }- Returns:
- JSON containing a create document request
-
getCreatePipelineDocumentRequestContent
public String getCreatePipelineDocumentRequestContent(ElasticIndexingServiceConnector connector, String id)
Get an ES create/update document content to put into a pipeline The content of the request will update the full document (and not partially) For instance: { "field1" : "value3" }- Returns:
- JSON containing a create/update Document to inject to a pipeline
-
getUpdateDocumentRequestContent
public String getUpdateDocumentRequestContent(ElasticIndexingServiceConnector connector, String id)
Get an ES update document content to insert in a bulk request We use the create api to reindex the full document (and not partially) For instance: { "create" : { "_index" : "blog", "_type" : "post", "_id" : "blog_post_1" } } { "field1" : "value3" }- Returns:
- JSON containing an update document request
-
getDefaultSettings
public String getDefaultSettings()
-
-