Class SearchEngineClient
java.lang.Object
org.codelibs.fess.opensearch.client.SearchEngineClient
- All Implemented Interfaces:
Closeable,AutoCloseable,org.opensearch.common.lease.Releasable,org.opensearch.transport.client.Client,org.opensearch.transport.client.OpenSearchClient
Client for interacting with OpenSearch search engine.
Provides document indexing, searching, and administrative operations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for creating entities from search response hits.static interfaceInterface for defining search condition logic.static classBuilder class for constructing search conditions and parameters.static interfaceInterface for building search results from response data. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.opensearch.transport.client.ClientOpenSearch client for executing operationsprotected StringName of the search engine clusterMap of configuration types to their respective configuration filesprotected final List<UnaryOperator<String>> List of rewrite rules for document mappingsprotected final List<UnaryOperator<String>> List of rewrite rules for document settingsList of index configuration files to loadprotected StringPath to index configuration resourcesprotected intMaximum retry attempts for configuration synchronization status checksprotected intMaximum retry attempts for search engine status checksprotected org.codelibs.opensearch.runner.OpenSearchRunnerOpenSearch runner for managing the embedded search engineprotected StringScroll timeout for delete operationsprotected StringScroll timeout for search operationsprotected StringScroll timeout for update operationsConfiguration settings for the search engineprotected intBatch size for delete operationsprotected intBatch size for update operationsprotected booleanWhether to use pipelines for document processingFields inherited from interface org.opensearch.transport.client.Client
CLIENT_TYPE_SETTING_S -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.opensearch.action.bulk.BulkResponseaddAll(String index, List<Map<String, Object>> docList, BiConsumer<Map<String, Object>, org.opensearch.action.index.IndexRequestBuilder> options) Adds multiple documents to the specified index in bulk.voidaddConfigFile(String index, String path) Adds a configuration file for a specific index.voidAdds a rewrite rule for document mappings.voidAdds a rewrite rule for document settings.voidaddIndexConfig(String path) Adds an index configuration file path to be loaded.voidaddMapping(String index, String docType, String indexName) Adds field mappings to an index.voidaddMapping(String index, String docType, String indexName, boolean loadBulkData) Adds field mappings and optionally loads bulk data for an index.org.opensearch.transport.client.AdminClientadmin()Gets the admin client for cluster and index administration.org.opensearch.common.action.ActionFuture<org.opensearch.action.bulk.BulkResponse> bulk(org.opensearch.action.bulk.BulkRequest request) Executes a bulk request asynchronously.voidbulk(org.opensearch.action.bulk.BulkRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.bulk.BulkResponse> listener) Executes a bulk request asynchronously with a callback.org.opensearch.common.action.ActionFuture<org.opensearch.action.search.ClearScrollResponse> clearScroll(org.opensearch.action.search.ClearScrollRequest request) Clears scroll contexts asynchronously.voidclearScroll(org.opensearch.action.search.ClearScrollRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.search.ClearScrollResponse> listener) Clears scroll contexts asynchronously with a callback.voidclose()booleancopyDocIndex(String fromIndex, String toIndex, boolean waitForCompletion) Copies documents from one index to another with optional transformation.protected voidcreateAlias(String index, String createdIndexName) Creates aliases for a newly created index.protected org.opensearch.transport.client.ClientcreateHttpClient(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, String host) Creates an HTTP client for connecting to the search engine.booleancreateIndex(String index, String indexName) Creates a new index with default settings.booleancreateIndex(String index, String indexName, String numberOfShards, String autoExpandReplicas, boolean uploadConfig) Creates a new index with specified settings.voidcreatePit(org.opensearch.action.search.CreatePitRequest createPITRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.search.CreatePitResponse> listener) Creates a point-in-time context asynchronously.booleanDeletes a document from the specified index.booleanDeletes a document from the specified index with optimistic concurrency control.org.opensearch.common.action.ActionFuture<org.opensearch.action.delete.DeleteResponse> delete(org.opensearch.action.delete.DeleteRequest request) Deletes a document asynchronously.voiddelete(org.opensearch.action.delete.DeleteRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener) Deletes a document asynchronously with a callback.longdeleteByQuery(String index, org.opensearch.index.query.QueryBuilder queryBuilder) Deletes documents in an index matching a query.booleandeleteIndex(String indexName) Deletes an index from the search engine.voiddeletePits(org.opensearch.action.search.DeletePitRequest deletePITRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.search.DeletePitResponse> listener) Deletes point-in-time contexts asynchronously.protected voiddeleteScrollContext(String scrollId) Deletes a scroll context to free resources.<Request extends org.opensearch.action.ActionRequest,Response extends org.opensearch.core.action.ActionResponse>
org.opensearch.common.action.ActionFuture<Response> execute(org.opensearch.action.ActionType<Response> action, Request request) Executes an action asynchronously.<Request extends org.opensearch.action.ActionRequest,Response extends org.opensearch.core.action.ActionResponse>
voidexecute(org.opensearch.action.ActionType<Response> action, Request request, org.opensearch.core.action.ActionListener<Response> listener) Executes an action asynchronously with a callback.booleanexistsIndex(String indexName) Checks if an index exists in the search engine.org.opensearch.common.action.ActionFuture<org.opensearch.action.explain.ExplainResponse> explain(org.opensearch.action.explain.ExplainRequest request) Executes an explain request asynchronously.voidexplain(org.opensearch.action.explain.ExplainRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.explain.ExplainResponse> listener) Executes an explain request asynchronously with a callback.org.opensearch.common.action.ActionFuture<org.opensearch.action.fieldcaps.FieldCapabilitiesResponse> fieldCaps(org.opensearch.action.fieldcaps.FieldCapabilitiesRequest request) Gets field capabilities asynchronously.voidfieldCaps(org.opensearch.action.fieldcaps.FieldCapabilitiesRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.fieldcaps.FieldCapabilitiesResponse> listener) Gets field capabilities asynchronously with a callback.org.opensearch.transport.client.ClientfilterWithHeader(Map<String, String> headers) Creates a client filtered with additional headers.voidFlushes the specified indices to ensure data is written to disk.voidflushConfigFiles(Runnable callback) Flushes configuration files to the search engine and executes a callback.protected StringgenerateNewIndexName(String configIndex) Generates a new index name with timestamp suffix.protected <T> Tget(String index, String id, SearchEngineClient.SearchCondition<org.opensearch.action.get.GetRequestBuilder> condition, SearchEngineClient.SearchResult<T, org.opensearch.action.get.GetRequestBuilder, org.opensearch.action.get.GetResponse> searchResult) Retrieves a document by ID with custom conditions and result processing.org.opensearch.common.action.ActionFuture<org.opensearch.action.get.GetResponse> get(org.opensearch.action.get.GetRequest request) Gets a document asynchronously.voidget(org.opensearch.action.get.GetRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.get.GetResponse> listener) Gets a document asynchronously with a callback.intgetAliasCount(String indexName) Gets the number of aliases attached to the specified index.voidgetAllPits(org.opensearch.action.search.GetAllPitNodesRequest getAllPitNodesRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.search.GetAllPitNodesResponse> listener) Gets all point-in-time contexts asynchronously.protected SearchEngineClient.EntityCreator<Map<String, Object>, org.opensearch.action.search.SearchResponse, org.opensearch.search.SearchHit> Gets the default entity creator for converting search hits to maps.getDocument(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition) Retrieves a single document matching the search condition.protected <T> org.dbflute.optional.OptionalEntity<T> getDocument(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition, SearchEngineClient.EntityCreator<T, org.opensearch.action.search.SearchResponse, org.opensearch.search.SearchHit> creator) Retrieves a single document with custom entity creation.longgetDocumentCount(String indexName) Gets the document count of an index.getDocumentList(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition) Retrieves a list of documents matching the search condition.protected <T> List<T> getDocumentList(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition, SearchEngineClient.EntityCreator<T, org.opensearch.action.search.SearchResponse, org.opensearch.search.SearchHit> creator) Retrieves a list of documents with custom entity creation.org.codelibs.fesen.client.EngineInfoGets information about the search engine.protected InetAddressgetInetAddressByName(String host) Resolves a hostname to an InetAddress.protected StringgetReindexRequestsPerSecound(org.codelibs.fess.mylasta.direction.FessConfig fessConfig) Calculates the requests per second setting for reindex operations.protected StringgetResourcePath(String basePath, String type, String path) Gets the resource path for configuration files, checking type-specific variants first.Gets the current cluster health status.org.opensearch.common.action.ActionFuture<org.opensearch.action.index.IndexResponse> index(org.opensearch.action.index.IndexRequest request) Indexes a document asynchronously.voidindex(org.opensearch.action.index.IndexRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.index.IndexResponse> listener) Indexes a document asynchronously with a callback.protected voidinsertBulkData(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, String configIndex, String dataPath) Inserts bulk data from a file into an index.protected voidinsertBulkData(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, String configIndex, String dataPath, boolean createOnly) Inserts bulk data from a file into an index.booleanChecks if the search engine is running in embedded mode.org.opensearch.common.action.ActionFuture<org.opensearch.action.admin.indices.view.ListViewNamesAction.Response> listViewNames(org.opensearch.action.admin.indices.view.ListViewNamesAction.Request request) Lists view names asynchronously (not implemented).voidlistViewNames(org.opensearch.action.admin.indices.view.ListViewNamesAction.Request request, org.opensearch.core.action.ActionListener<org.opensearch.action.admin.indices.view.ListViewNamesAction.Response> listener) Lists view names asynchronously (not implemented).org.opensearch.common.action.ActionFuture<org.opensearch.action.get.MultiGetResponse> multiGet(org.opensearch.action.get.MultiGetRequest request) Gets multiple documents asynchronously.voidmultiGet(org.opensearch.action.get.MultiGetRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.get.MultiGetResponse> listener) Gets multiple documents asynchronously with a callback.org.opensearch.common.action.ActionFuture<org.opensearch.action.search.MultiSearchResponse> multiSearch(org.opensearch.action.search.MultiSearchRequest request) Executes a multi-search request asynchronously.voidmultiSearch(org.opensearch.action.search.MultiSearchRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.search.MultiSearchResponse> listener) Executes a multi-search request asynchronously with a callback.org.opensearch.common.action.ActionFuture<org.opensearch.action.termvectors.MultiTermVectorsResponse> multiTermVectors(org.opensearch.action.termvectors.MultiTermVectorsRequest request) Gets term vectors for multiple documents asynchronously.voidmultiTermVectors(org.opensearch.action.termvectors.MultiTermVectorsRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.termvectors.MultiTermVectorsResponse> listener) Gets term vectors for multiple documents asynchronously with a callback.voidopen()Initializes the search engine client and configures indices.ping()Pings the search engine cluster to check connectivity and health.voidpitSegments(org.opensearch.action.admin.indices.segments.PitSegmentsRequest pitSegmentsRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.admin.indices.segments.IndicesSegmentResponse> listener) Gets point-in-time segments information asynchronously.org.opensearch.action.bulk.BulkRequestBuilderPrepares a bulk request builder.org.opensearch.action.bulk.BulkRequestBuilderprepareBulk(String globalIndex) Prepares a bulk request builder with a global index.org.opensearch.action.search.ClearScrollRequestBuilderPrepares a clear scroll request builder.org.opensearch.action.delete.DeleteRequestBuilderPrepares a delete request builder.org.opensearch.action.delete.DeleteRequestBuilderprepareDelete(String index, String id) Prepares a delete request builder for a specific document.org.opensearch.action.explain.ExplainRequestBuilderprepareExplain(String index, String id) Prepares an explain request builder for a specific document.org.opensearch.action.fieldcaps.FieldCapabilitiesRequestBuilderprepareFieldCaps(String... indices) Prepares a field capabilities request builder.org.opensearch.action.get.GetRequestBuilderPrepares a get request builder.org.opensearch.action.get.GetRequestBuilderprepareGet(String index, String id) Prepares a get request builder for a specific document.org.opensearch.action.index.IndexRequestBuilderPrepares an index request builder.org.opensearch.action.index.IndexRequestBuilderprepareIndex(String index) Prepares an index request builder for a specific index.org.opensearch.action.get.MultiGetRequestBuilderPrepares a multi-get request builder.org.opensearch.action.search.MultiSearchRequestBuilderPrepares a multi-search request builder.org.opensearch.action.termvectors.MultiTermVectorsRequestBuilderPrepares a multi-term vectors request builder.org.opensearch.action.search.SearchRequestBuilderprepareSearch(String... indices) Prepares a search request builder for specific indices.org.opensearch.action.search.SearchScrollRequestBuilderprepareSearchScroll(String scrollId) Prepares a search scroll request builder.org.opensearch.action.search.SearchRequestBuilderprepareStreamSearch(String... indices) Prepares a stream search request builder for specific indices.org.opensearch.action.termvectors.TermVectorsRequestBuilderPrepares a term vectors request builder.org.opensearch.action.termvectors.TermVectorsRequestBuilderprepareTermVectors(String index, String id) Prepares a term vectors request builder for a specific document.org.opensearch.action.update.UpdateRequestBuilderPrepares an update request builder.org.opensearch.action.update.UpdateRequestBuilderprepareUpdate(String index, String id) Prepares an update request builder for a specific document.protected StringreadIndexSetting(String fesenType, String indexConfigFile, String numberOfShards, String autoExpandReplicas) Reads and processes index settings from configuration file.voidRefreshes the specified indices to make recent changes visible for search.booleanReindexes documents from one index to another.protected booleanPerforms a reindex operation with custom source configuration.booleanreindexConfigIndices(boolean loadBulkData, Set<String> targetPrefixes) Rebuilds configuration indices with the latest mappings using atomic alias switching.<T> longscrollSearch(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition, SearchEngineClient.EntityCreator<T, org.opensearch.action.search.SearchResponse, org.opensearch.search.SearchHit> creator, BooleanFunction<T> cursor) Performs a scroll search with custom entity creation.longscrollSearch(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition, BooleanFunction<Map<String, Object>> cursor) Performs a scroll search with default entity creation.<T> Tsearch(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition, SearchEngineClient.SearchResult<T, org.opensearch.action.search.SearchRequestBuilder, org.opensearch.action.search.SearchResponse> searchResult) Performs a search with custom conditions and result processing.org.opensearch.common.action.ActionFuture<org.opensearch.action.search.SearchResponse> search(org.opensearch.action.search.SearchRequest request) Executes a search request asynchronously.voidsearch(org.opensearch.action.search.SearchRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.search.SearchResponse> listener) Executes a search request asynchronously with a callback.org.opensearch.common.action.ActionFuture<org.opensearch.action.search.SearchResponse> searchScroll(org.opensearch.action.search.SearchScrollRequest request) Executes a search scroll request asynchronously.voidsearchScroll(org.opensearch.action.search.SearchScrollRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.search.SearchResponse> listener) Executes a search scroll request asynchronously with a callback.org.opensearch.common.action.ActionFuture<org.opensearch.action.search.SearchResponse> searchView(org.opensearch.action.admin.indices.view.SearchViewAction.Request request) Searches a view asynchronously (not implemented).voidsearchView(org.opensearch.action.admin.indices.view.SearchViewAction.Request request, org.opensearch.core.action.ActionListener<org.opensearch.action.search.SearchResponse> listener) Searches a view asynchronously (not implemented).protected voidsendConfigFiles(String index) Sends configuration files to the search engine for an index.voidsetClusterName(String clusterName) Sets the name of the search engine cluster.voidsetIndexConfigPath(String indexConfigPath) Sets the path to index configuration resources.voidsetMaxConfigSyncStatusRetry(int maxConfigSyncStatusRetry) Sets the maximum retry attempts for configuration synchronization status checks.voidsetMaxEsStatusRetry(int maxEsStatusRetry) Sets the maximum retry attempts for search engine status checks.voidsetRunner(org.codelibs.opensearch.runner.OpenSearchRunner runner) Sets the OpenSearch runner for embedded mode.voidsetScrollForDelete(String scrollForDelete) Sets the scroll timeout for delete operations.voidsetScrollForSearch(String scrollForSearch) Sets the scroll timeout for search operations.voidsetScrollForUpdate(String scrollForUpdate) Sets the scroll timeout for update operations.voidsetSettings(Map<String, String> settings) Sets the configuration settings for the search engine.voidsetSizeForDelete(int sizeForDelete) Sets the batch size for delete operations.voidsetSizeForUpdate(int sizeForUpdate) Sets the batch size for update operations.org.opensearch.common.settings.Settingssettings()Gets the client settings.booleanStores a document in the specified index.protected booleanswitchAliases(String configIndex, String oldIndexName, String newIndexName) Atomically switches aliases from one index to another.org.opensearch.common.action.ActionFuture<org.opensearch.action.termvectors.TermVectorsResponse> termVectors(org.opensearch.action.termvectors.TermVectorsRequest request) Gets term vectors for a document asynchronously.voidtermVectors(org.opensearch.action.termvectors.TermVectorsRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.termvectors.TermVectorsResponse> listener) Gets term vectors for a document asynchronously with a callback.org.opensearch.threadpool.ThreadPoolGets the thread pool used by the client.booleanUpdates a specific field in a document.org.opensearch.common.action.ActionFuture<org.opensearch.action.update.UpdateResponse> update(org.opensearch.action.update.UpdateRequest request) Updates a document asynchronously.voidupdate(org.opensearch.action.update.UpdateRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.update.UpdateResponse> listener) Updates a document asynchronously with a callback.booleanupdateAlias(String newIndex) Updates index aliases to point to a new index.protected booleanupdateByIdWithScript(String index, String id, String field, Object value) Updates a document by ID using a script when pipelines are enabled.longupdateByQuery(String index, Function<org.opensearch.action.search.SearchRequestBuilder, org.opensearch.action.search.SearchRequestBuilder> option, BiFunction<org.opensearch.action.update.UpdateRequestBuilder, org.opensearch.search.SearchHit, org.opensearch.action.update.UpdateRequestBuilder> builder) Updates documents in an index using a query.voidEnables the use of ingest pipelines for document processing.protected voidWaits for the configuration synchronization service to become available.protected voidwaitForYellowStatus(org.codelibs.fess.mylasta.direction.FessConfig fessConfig) Waits for the search engine cluster to reach yellow or green status.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.transport.client.Client
bulkAsync, clearScrollAsync, deleteAsync, explainAsync, fieldCapsAsync, getAsync, getRemoteClusterClient, indexAsync, listViewNamesAsync, multiGetAsync, multiSearchAsync, multiTermVectorsAsync, searchAsync, searchScrollAsync, searchViewAsync, termVectorsAsync, updateAsync
-
Field Details
-
runner
protected org.codelibs.opensearch.runner.OpenSearchRunner runnerOpenSearch runner for managing the embedded search engine -
client
protected org.opensearch.transport.client.Client clientOpenSearch client for executing operations -
settings
Configuration settings for the search engine -
indexConfigPath
Path to index configuration resources -
indexConfigList
List of index configuration files to load -
configListMap
Map of configuration types to their respective configuration files -
scrollForSearch
Scroll timeout for search operations -
sizeForDelete
protected int sizeForDeleteBatch size for delete operations -
scrollForDelete
Scroll timeout for delete operations -
sizeForUpdate
protected int sizeForUpdateBatch size for update operations -
scrollForUpdate
Scroll timeout for update operations -
maxConfigSyncStatusRetry
protected int maxConfigSyncStatusRetryMaximum retry attempts for configuration synchronization status checks -
maxEsStatusRetry
protected int maxEsStatusRetryMaximum retry attempts for search engine status checks -
clusterName
Name of the search engine cluster -
docSettingRewriteRuleList
List of rewrite rules for document settings -
docMappingRewriteRuleList
List of rewrite rules for document mappings -
usePipeline
protected boolean usePipelineWhether to use pipelines for document processing
-
-
Constructor Details
-
SearchEngineClient
public SearchEngineClient()Default constructor.
-
-
Method Details
-
addIndexConfig
Adds an index configuration file path to be loaded.- Parameters:
path- path to the index configuration file
-
addConfigFile
Adds a configuration file for a specific index.- Parameters:
index- the index namepath- path to the configuration file
-
setSettings
Sets the configuration settings for the search engine.- Parameters:
settings- map of configuration key-value pairs
-
getStatus
Gets the current cluster health status.- Returns:
- the cluster health status name
-
setRunner
public void setRunner(org.codelibs.opensearch.runner.OpenSearchRunner runner) Sets the OpenSearch runner for embedded mode.- Parameters:
runner- the OpenSearch runner instance
-
isEmbedded
public boolean isEmbedded()Checks if the search engine is running in embedded mode.- Returns:
- true if running in embedded mode, false otherwise
-
usePipeline
public void usePipeline()Enables the use of ingest pipelines for document processing. -
getInetAddressByName
Resolves a hostname to an InetAddress.- Parameters:
host- the hostname to resolve- Returns:
- the resolved InetAddress
- Throws:
FessSystemException- if hostname resolution fails
-
open
@PostConstruct public void open()Initializes the search engine client and configures indices. Called automatically after dependency injection is complete. -
createHttpClient
protected org.opensearch.transport.client.Client createHttpClient(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, String host) Creates an HTTP client for connecting to the search engine.- Parameters:
fessConfig- the Fess configurationhost- the search engine host address- Returns:
- the configured HTTP client
-
existsIndex
Checks if an index exists in the search engine.- Parameters:
indexName- the name of the index to check- Returns:
- true if the index exists, false otherwise
-
getDocumentCount
Gets the document count of an index.- Parameters:
indexName- the name of the index- Returns:
- the number of documents in the index, or -1 if the count could not be retrieved
-
getAliasCount
Gets the number of aliases attached to the specified index.- Parameters:
indexName- the name of the index- Returns:
- the number of aliases, or 0 if none found or an error occurred
-
copyDocIndex
Copies documents from one index to another with optional transformation.- Parameters:
fromIndex- the source index nametoIndex- the destination index namewaitForCompletion- whether to wait for the operation to complete- Returns:
- true if the copy operation was successful, false otherwise
-
reindex
Reindexes documents from one index to another.- Parameters:
fromIndex- the source index nametoIndex- the destination index namewaitForCompletion- whether to wait for the operation to complete- Returns:
- true if the reindex operation was successful, false otherwise
-
reindex
protected boolean reindex(String fromIndex, String toIndex, String source, boolean waitForCompletion) Performs a reindex operation with custom source configuration.- Parameters:
fromIndex- the source index nametoIndex- the destination index namesource- the reindex configuration JSONwaitForCompletion- whether to wait for the operation to complete- Returns:
- true if the reindex operation was successful, false otherwise
-
getReindexRequestsPerSecound
protected String getReindexRequestsPerSecound(org.codelibs.fess.mylasta.direction.FessConfig fessConfig) Calculates the requests per second setting for reindex operations.- Parameters:
fessConfig- the Fess configuration- Returns:
- the requests per second value, or null for no limit
-
createIndex
Creates a new index with default settings.- Parameters:
index- the index configuration nameindexName- the actual index name to create- Returns:
- true if the index was created successfully, false otherwise
-
createIndex
public boolean createIndex(String index, String indexName, String numberOfShards, String autoExpandReplicas, boolean uploadConfig) Creates a new index with specified settings.- Parameters:
index- the index configuration nameindexName- the actual index name to createnumberOfShards- the number of primary shardsautoExpandReplicas- the auto expand replicas settinguploadConfig- whether to upload configuration files- Returns:
- true if the index was created successfully, false otherwise
-
deleteIndex
Deletes an index from the search engine.- Parameters:
indexName- the name of the index to delete- Returns:
- true if the index was deleted successfully, false otherwise
-
reindexConfigIndices
Rebuilds configuration indices with the latest mappings using atomic alias switching. Only indices matching the specified target prefixes are rebuilt. For each index: creates a backup, reindexes data, creates a new index, reindexes from backup, atomically switches aliases, then cleans up old and backup indices.- Parameters:
loadBulkData- whether to load default bulk data after rebuilding (using OpType.CREATE to skip existing documents)targetPrefixes- the set of index prefixes to rebuild (e.g., "fess_config", "fess_user", "fess_log")- Returns:
- true if all targeted indices were rebuilt successfully, false if any index rebuild failed
-
switchAliases
Atomically switches aliases from one index to another. Reads alias configuration files, removes aliases from the old index, and adds them to the new index in a single atomic operation.- Parameters:
configIndex- the index configuration nameoldIndexName- the current index name to remove aliases fromnewIndexName- the new index name to add aliases to- Returns:
- true if all aliases were switched successfully, false otherwise
-
readIndexSetting
protected String readIndexSetting(String fesenType, String indexConfigFile, String numberOfShards, String autoExpandReplicas) Reads and processes index settings from configuration file.- Parameters:
fesenType- the search engine typeindexConfigFile- the path to the index configuration filenumberOfShards- the number of primary shardsautoExpandReplicas- the auto expand replicas setting- Returns:
- the processed index settings JSON
-
addDocumentSettingRewriteRule
Adds a rewrite rule for document settings.- Parameters:
rule- the rewrite rule to apply to document settings
-
getResourcePath
Gets the resource path for configuration files, checking type-specific variants first.- Parameters:
basePath- the base path for resourcestype- the search engine typepath- the relative path to the resource- Returns:
- the full resource path
-
addMapping
Adds field mappings to an index.- Parameters:
index- the index configuration namedocType- the document typeindexName- the actual index name
-
addMapping
Adds field mappings and optionally loads bulk data for an index.- Parameters:
index- the index configuration namedocType- the document type nameindexName- the actual index nameloadBulkData- whether to load bulk data after applying mappings
-
addDocumentMappingRewriteRule
Adds a rewrite rule for document mappings.- Parameters:
rule- the rewrite rule to apply to document mappings
-
updateAlias
Updates index aliases to point to a new index.- Parameters:
newIndex- the new index to point aliases to- Returns:
- true if the alias update was successful, false otherwise
-
createAlias
Creates aliases for a newly created index.- Parameters:
index- the index configuration namecreatedIndexName- the actual index name that was created
-
sendConfigFiles
Sends configuration files to the search engine for an index.- Parameters:
index- the index configuration name
-
flushConfigFiles
Flushes configuration files to the search engine and executes a callback.- Parameters:
callback- the callback to execute after flushing
-
generateNewIndexName
Generates a new index name with timestamp suffix.- Parameters:
configIndex- the base index configuration name- Returns:
- the generated index name with timestamp
-
insertBulkData
protected void insertBulkData(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, String configIndex, String dataPath) Inserts bulk data from a file into an index.- Parameters:
fessConfig- the Fess configurationconfigIndex- the target index namedataPath- the path to the bulk data file
-
insertBulkData
protected void insertBulkData(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, String configIndex, String dataPath, boolean createOnly) Inserts bulk data from a file into an index.- Parameters:
fessConfig- the Fess configurationconfigIndex- the target index namedataPath- the path to the bulk data filecreateOnly- if true, uses OpType.CREATE to skip existing documents
-
waitForYellowStatus
protected void waitForYellowStatus(org.codelibs.fess.mylasta.direction.FessConfig fessConfig) Waits for the search engine cluster to reach yellow or green status.- Parameters:
fessConfig- the Fess configuration- Throws:
org.lastaflute.di.exception.ContainerInitFailureException- if the cluster doesn't become available
-
waitForConfigSyncStatus
protected void waitForConfigSyncStatus()Waits for the configuration synchronization service to become available.- Throws:
FessSystemException- if ConfigSync doesn't become available
-
close
@PreDestroy public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.opensearch.common.lease.Releasable
-
updateByQuery
public long updateByQuery(String index, Function<org.opensearch.action.search.SearchRequestBuilder, org.opensearch.action.search.SearchRequestBuilder> option, BiFunction<org.opensearch.action.update.UpdateRequestBuilder, org.opensearch.search.SearchHit, org.opensearch.action.update.UpdateRequestBuilder> builder) Updates documents in an index using a query.- Parameters:
index- the index nameoption- function to customize the search requestbuilder- function to build update requests from search hits- Returns:
- the number of documents processed
-
deleteByQuery
Deletes documents in an index matching a query.- Parameters:
index- the index namequeryBuilder- the query to match documents for deletion- Returns:
- the number of documents deleted
-
deleteScrollContext
Deletes a scroll context to free resources.- Parameters:
scrollId- the scroll ID to delete
-
get
protected <T> T get(String index, String id, SearchEngineClient.SearchCondition<org.opensearch.action.get.GetRequestBuilder> condition, SearchEngineClient.SearchResult<T, org.opensearch.action.get.GetRequestBuilder, org.opensearch.action.get.GetResponse> searchResult) Retrieves a document by ID with custom conditions and result processing.- Type Parameters:
T- the result type- Parameters:
index- the index nameid- the document IDcondition- the search conditionsearchResult- the result processor- Returns:
- the processed result
-
search
public <T> T search(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition, SearchEngineClient.SearchResult<T, org.opensearch.action.search.SearchRequestBuilder, org.opensearch.action.search.SearchResponse> searchResult) Performs a search with custom conditions and result processing.- Type Parameters:
T- the result type- Parameters:
index- the index namecondition- the search conditionsearchResult- the result processor- Returns:
- the processed search result
- Throws:
InvalidQueryException- if the query is invalid
-
scrollSearch
public long scrollSearch(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition, BooleanFunction<Map<String, Object>> cursor) Performs a scroll search with default entity creation.- Parameters:
index- the index namecondition- the search conditioncursor- the cursor function to process each hit- Returns:
- the number of documents processed
- Throws:
InvalidQueryException- if the query is invalid
-
scrollSearch
public <T> long scrollSearch(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition, SearchEngineClient.EntityCreator<T, org.opensearch.action.search.SearchResponse, org.opensearch.search.SearchHit> creator, BooleanFunction<T> cursor) Performs a scroll search with custom entity creation.- Type Parameters:
T- the entity type- Parameters:
index- the index namecondition- the search conditioncreator- the entity creatorcursor- the cursor function to process each entity- Returns:
- the number of documents processed
- Throws:
InvalidQueryException- if the query is invalid
-
getDocument
public org.dbflute.optional.OptionalEntity<Map<String,Object>> getDocument(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition) Retrieves a single document matching the search condition.- Parameters:
index- the index namecondition- the search condition- Returns:
- an optional containing the document if found
-
getDocument
protected <T> org.dbflute.optional.OptionalEntity<T> getDocument(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition, SearchEngineClient.EntityCreator<T, org.opensearch.action.search.SearchResponse, org.opensearch.search.SearchHit> creator) Retrieves a single document with custom entity creation.- Type Parameters:
T- the entity type- Parameters:
index- the index namecondition- the search conditioncreator- the entity creator- Returns:
- an optional containing the entity if found
-
getDocumentList
public List<Map<String,Object>> getDocumentList(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition) Retrieves a list of documents matching the search condition.- Parameters:
index- the index namecondition- the search condition- Returns:
- a list of documents
-
getDefaultEntityCreator
protected SearchEngineClient.EntityCreator<Map<String,Object>, getDefaultEntityCreator()org.opensearch.action.search.SearchResponse, org.opensearch.search.SearchHit> Gets the default entity creator for converting search hits to maps.- Returns:
- the default entity creator
-
getDocumentList
protected <T> List<T> getDocumentList(String index, SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> condition, SearchEngineClient.EntityCreator<T, org.opensearch.action.search.SearchResponse, org.opensearch.search.SearchHit> creator) Retrieves a list of documents with custom entity creation.- Type Parameters:
T- the entity type- Parameters:
index- the index namecondition- the search conditioncreator- the entity creator- Returns:
- a list of entities
-
update
Updates a specific field in a document.- Parameters:
index- the index nameid- the document IDfield- the field name to updatevalue- the new field value- Returns:
- true if the update was successful, false otherwise
- Throws:
SearchEngineClientException- if the update fails
-
updateByIdWithScript
Updates a document by ID using a script when pipelines are enabled.- Parameters:
index- the index nameid- the document IDfield- the field name to updatevalue- the new field value- Returns:
- true if the update was successful, false otherwise
- Throws:
SearchEngineClientException- if the update fails
-
refresh
Refreshes the specified indices to make recent changes visible for search.- Parameters:
indices- the indices to refresh
-
flush
Flushes the specified indices to ensure data is written to disk.- Parameters:
indices- the indices to flush
-
ping
Pings the search engine cluster to check connectivity and health.- Returns:
- the ping response with cluster information
- Throws:
SearchEngineClientException- if the ping fails
-
addAll
public org.opensearch.action.bulk.BulkResponse addAll(String index, List<Map<String, Object>> docList, BiConsumer<Map<String, Object>, org.opensearch.action.index.IndexRequestBuilder> options) Adds multiple documents to the specified index in bulk.- Parameters:
index- the target indexdocList- list of documents to addoptions- callback for customizing index request options- Returns:
- the bulk response
-
store
Stores a document in the specified index.- Parameters:
index- the index nameobj- the document object to store- Returns:
- true if the document was stored successfully, false otherwise
- Throws:
SearchEngineClientException- if the store operation fails
-
delete
Deletes a document from the specified index.- Parameters:
index- the index nameid- the document ID- Returns:
- true if the document was deleted successfully, false otherwise
-
delete
Deletes a document from the specified index with optimistic concurrency control.- Parameters:
index- the index nameid- the document IDseqNo- the sequence number for optimistic concurrency controlprimaryTerm- the primary term for optimistic concurrency control- Returns:
- true if the document was deleted successfully, false otherwise
- Throws:
SearchEngineClientException- if the delete operation fails
-
setIndexConfigPath
Sets the path to index configuration resources.- Parameters:
indexConfigPath- the path to index configuration resources
-
setClusterName
Sets the name of the search engine cluster.- Parameters:
clusterName- the cluster name
-
getEngineInfo
public org.codelibs.fesen.client.EngineInfo getEngineInfo()Gets information about the search engine.- Returns:
- the engine information
- Throws:
SearchEngineClientException- if the client is not an HttpClient
-
threadPool
public org.opensearch.threadpool.ThreadPool threadPool()Gets the thread pool used by the client.- Specified by:
threadPoolin interfaceorg.opensearch.transport.client.OpenSearchClient- Returns:
- the thread pool
-
admin
public org.opensearch.transport.client.AdminClient admin()Gets the admin client for cluster and index administration.- Specified by:
adminin interfaceorg.opensearch.transport.client.Client- Returns:
- the admin client
-
index
public org.opensearch.common.action.ActionFuture<org.opensearch.action.index.IndexResponse> index(org.opensearch.action.index.IndexRequest request) Indexes a document asynchronously.- Specified by:
indexin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the index request- Returns:
- a future for the index response
-
index
public void index(org.opensearch.action.index.IndexRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.index.IndexResponse> listener) Indexes a document asynchronously with a callback.- Specified by:
indexin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the index requestlistener- the response listener
-
prepareIndex
public org.opensearch.action.index.IndexRequestBuilder prepareIndex()Prepares an index request builder.- Specified by:
prepareIndexin interfaceorg.opensearch.transport.client.Client- Returns:
- the index request builder
-
update
public org.opensearch.common.action.ActionFuture<org.opensearch.action.update.UpdateResponse> update(org.opensearch.action.update.UpdateRequest request) Updates a document asynchronously.- Specified by:
updatein interfaceorg.opensearch.transport.client.Client- Parameters:
request- the update request- Returns:
- a future for the update response
-
update
public void update(org.opensearch.action.update.UpdateRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.update.UpdateResponse> listener) Updates a document asynchronously with a callback.- Specified by:
updatein interfaceorg.opensearch.transport.client.Client- Parameters:
request- the update requestlistener- the response listener
-
prepareUpdate
public org.opensearch.action.update.UpdateRequestBuilder prepareUpdate()Prepares an update request builder.- Specified by:
prepareUpdatein interfaceorg.opensearch.transport.client.Client- Returns:
- the update request builder
-
prepareUpdate
Prepares an update request builder for a specific document.- Specified by:
prepareUpdatein interfaceorg.opensearch.transport.client.Client- Parameters:
index- the index nameid- the document ID- Returns:
- the update request builder
-
prepareIndex
Prepares an index request builder for a specific index.- Specified by:
prepareIndexin interfaceorg.opensearch.transport.client.Client- Parameters:
index- the index name- Returns:
- the index request builder
-
delete
public org.opensearch.common.action.ActionFuture<org.opensearch.action.delete.DeleteResponse> delete(org.opensearch.action.delete.DeleteRequest request) Deletes a document asynchronously.- Specified by:
deletein interfaceorg.opensearch.transport.client.Client- Parameters:
request- the delete request- Returns:
- a future for the delete response
-
delete
public void delete(org.opensearch.action.delete.DeleteRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener) Deletes a document asynchronously with a callback.- Specified by:
deletein interfaceorg.opensearch.transport.client.Client- Parameters:
request- the delete requestlistener- the response listener
-
prepareDelete
public org.opensearch.action.delete.DeleteRequestBuilder prepareDelete()Prepares a delete request builder.- Specified by:
prepareDeletein interfaceorg.opensearch.transport.client.Client- Returns:
- the delete request builder
-
prepareDelete
Prepares a delete request builder for a specific document.- Specified by:
prepareDeletein interfaceorg.opensearch.transport.client.Client- Parameters:
index- the index nameid- the document ID- Returns:
- the delete request builder
-
bulk
public org.opensearch.common.action.ActionFuture<org.opensearch.action.bulk.BulkResponse> bulk(org.opensearch.action.bulk.BulkRequest request) Executes a bulk request asynchronously.- Specified by:
bulkin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the bulk request- Returns:
- a future for the bulk response
-
bulk
public void bulk(org.opensearch.action.bulk.BulkRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.bulk.BulkResponse> listener) Executes a bulk request asynchronously with a callback.- Specified by:
bulkin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the bulk requestlistener- the response listener
-
prepareBulk
public org.opensearch.action.bulk.BulkRequestBuilder prepareBulk()Prepares a bulk request builder.- Specified by:
prepareBulkin interfaceorg.opensearch.transport.client.Client- Returns:
- the bulk request builder
-
get
public org.opensearch.common.action.ActionFuture<org.opensearch.action.get.GetResponse> get(org.opensearch.action.get.GetRequest request) Gets a document asynchronously.- Specified by:
getin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the get request- Returns:
- a future for the get response
-
get
public void get(org.opensearch.action.get.GetRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.get.GetResponse> listener) Gets a document asynchronously with a callback.- Specified by:
getin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the get requestlistener- the response listener
-
prepareGet
public org.opensearch.action.get.GetRequestBuilder prepareGet()Prepares a get request builder.- Specified by:
prepareGetin interfaceorg.opensearch.transport.client.Client- Returns:
- the get request builder
-
prepareGet
Prepares a get request builder for a specific document.- Specified by:
prepareGetin interfaceorg.opensearch.transport.client.Client- Parameters:
index- the index nameid- the document ID- Returns:
- the get request builder
-
multiGet
public org.opensearch.common.action.ActionFuture<org.opensearch.action.get.MultiGetResponse> multiGet(org.opensearch.action.get.MultiGetRequest request) Gets multiple documents asynchronously.- Specified by:
multiGetin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the multi-get request- Returns:
- a future for the multi-get response
-
multiGet
public void multiGet(org.opensearch.action.get.MultiGetRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.get.MultiGetResponse> listener) Gets multiple documents asynchronously with a callback.- Specified by:
multiGetin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the multi-get requestlistener- the response listener
-
prepareMultiGet
public org.opensearch.action.get.MultiGetRequestBuilder prepareMultiGet()Prepares a multi-get request builder.- Specified by:
prepareMultiGetin interfaceorg.opensearch.transport.client.Client- Returns:
- the multi-get request builder
-
search
public org.opensearch.common.action.ActionFuture<org.opensearch.action.search.SearchResponse> search(org.opensearch.action.search.SearchRequest request) Executes a search request asynchronously.- Specified by:
searchin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the search request- Returns:
- a future for the search response
-
search
public void search(org.opensearch.action.search.SearchRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.search.SearchResponse> listener) Executes a search request asynchronously with a callback.- Specified by:
searchin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the search requestlistener- the response listener
-
prepareSearch
Prepares a search request builder for specific indices.- Specified by:
prepareSearchin interfaceorg.opensearch.transport.client.Client- Parameters:
indices- the indices to search- Returns:
- the search request builder
-
prepareStreamSearch
Prepares a stream search request builder for specific indices.- Specified by:
prepareStreamSearchin interfaceorg.opensearch.transport.client.Client- Parameters:
indices- the indices to search- Returns:
- the search request builder
-
searchScroll
public org.opensearch.common.action.ActionFuture<org.opensearch.action.search.SearchResponse> searchScroll(org.opensearch.action.search.SearchScrollRequest request) Executes a search scroll request asynchronously.- Specified by:
searchScrollin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the search scroll request- Returns:
- a future for the search response
-
searchScroll
public void searchScroll(org.opensearch.action.search.SearchScrollRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.search.SearchResponse> listener) Executes a search scroll request asynchronously with a callback.- Specified by:
searchScrollin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the search scroll requestlistener- the response listener
-
prepareSearchScroll
Prepares a search scroll request builder.- Specified by:
prepareSearchScrollin interfaceorg.opensearch.transport.client.Client- Parameters:
scrollId- the scroll ID- Returns:
- the search scroll request builder
-
multiSearch
public org.opensearch.common.action.ActionFuture<org.opensearch.action.search.MultiSearchResponse> multiSearch(org.opensearch.action.search.MultiSearchRequest request) Executes a multi-search request asynchronously.- Specified by:
multiSearchin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the multi-search request- Returns:
- a future for the multi-search response
-
multiSearch
public void multiSearch(org.opensearch.action.search.MultiSearchRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.search.MultiSearchResponse> listener) Executes a multi-search request asynchronously with a callback.- Specified by:
multiSearchin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the multi-search requestlistener- the response listener
-
prepareMultiSearch
public org.opensearch.action.search.MultiSearchRequestBuilder prepareMultiSearch()Prepares a multi-search request builder.- Specified by:
prepareMultiSearchin interfaceorg.opensearch.transport.client.Client- Returns:
- the multi-search request builder
-
prepareExplain
Prepares an explain request builder for a specific document.- Specified by:
prepareExplainin interfaceorg.opensearch.transport.client.Client- Parameters:
index- the index nameid- the document ID- Returns:
- the explain request builder
-
explain
public org.opensearch.common.action.ActionFuture<org.opensearch.action.explain.ExplainResponse> explain(org.opensearch.action.explain.ExplainRequest request) Executes an explain request asynchronously.- Specified by:
explainin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the explain request- Returns:
- a future for the explain response
-
explain
public void explain(org.opensearch.action.explain.ExplainRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.explain.ExplainResponse> listener) Executes an explain request asynchronously with a callback.- Specified by:
explainin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the explain requestlistener- the response listener
-
prepareClearScroll
public org.opensearch.action.search.ClearScrollRequestBuilder prepareClearScroll()Prepares a clear scroll request builder.- Specified by:
prepareClearScrollin interfaceorg.opensearch.transport.client.Client- Returns:
- the clear scroll request builder
-
clearScroll
public org.opensearch.common.action.ActionFuture<org.opensearch.action.search.ClearScrollResponse> clearScroll(org.opensearch.action.search.ClearScrollRequest request) Clears scroll contexts asynchronously.- Specified by:
clearScrollin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the clear scroll request- Returns:
- a future for the clear scroll response
-
clearScroll
public void clearScroll(org.opensearch.action.search.ClearScrollRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.search.ClearScrollResponse> listener) Clears scroll contexts asynchronously with a callback.- Specified by:
clearScrollin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the clear scroll requestlistener- the response listener
-
settings
public org.opensearch.common.settings.Settings settings()Gets the client settings.- Specified by:
settingsin interfaceorg.opensearch.transport.client.Client- Returns:
- the client settings
-
termVectors
public org.opensearch.common.action.ActionFuture<org.opensearch.action.termvectors.TermVectorsResponse> termVectors(org.opensearch.action.termvectors.TermVectorsRequest request) Gets term vectors for a document asynchronously.- Specified by:
termVectorsin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the term vectors request- Returns:
- a future for the term vectors response
-
termVectors
public void termVectors(org.opensearch.action.termvectors.TermVectorsRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.termvectors.TermVectorsResponse> listener) Gets term vectors for a document asynchronously with a callback.- Specified by:
termVectorsin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the term vectors requestlistener- the response listener
-
prepareTermVectors
public org.opensearch.action.termvectors.TermVectorsRequestBuilder prepareTermVectors()Prepares a term vectors request builder.- Specified by:
prepareTermVectorsin interfaceorg.opensearch.transport.client.Client- Returns:
- the term vectors request builder
-
prepareTermVectors
public org.opensearch.action.termvectors.TermVectorsRequestBuilder prepareTermVectors(String index, String id) Prepares a term vectors request builder for a specific document.- Specified by:
prepareTermVectorsin interfaceorg.opensearch.transport.client.Client- Parameters:
index- the index nameid- the document ID- Returns:
- the term vectors request builder
-
multiTermVectors
public org.opensearch.common.action.ActionFuture<org.opensearch.action.termvectors.MultiTermVectorsResponse> multiTermVectors(org.opensearch.action.termvectors.MultiTermVectorsRequest request) Gets term vectors for multiple documents asynchronously.- Specified by:
multiTermVectorsin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the multi-term vectors request- Returns:
- a future for the multi-term vectors response
-
multiTermVectors
public void multiTermVectors(org.opensearch.action.termvectors.MultiTermVectorsRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.termvectors.MultiTermVectorsResponse> listener) Gets term vectors for multiple documents asynchronously with a callback.- Specified by:
multiTermVectorsin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the multi-term vectors requestlistener- the response listener
-
prepareMultiTermVectors
public org.opensearch.action.termvectors.MultiTermVectorsRequestBuilder prepareMultiTermVectors()Prepares a multi-term vectors request builder.- Specified by:
prepareMultiTermVectorsin interfaceorg.opensearch.transport.client.Client- Returns:
- the multi-term vectors request builder
-
setSizeForUpdate
public void setSizeForUpdate(int sizeForUpdate) Sets the batch size for update operations.- Parameters:
sizeForUpdate- the batch size for updates
-
setScrollForUpdate
Sets the scroll timeout for update operations.- Parameters:
scrollForUpdate- the scroll timeout string
-
setSizeForDelete
public void setSizeForDelete(int sizeForDelete) Sets the batch size for delete operations.- Parameters:
sizeForDelete- the batch size for deletes
-
setScrollForDelete
Sets the scroll timeout for delete operations.- Parameters:
scrollForDelete- the scroll timeout string
-
setScrollForSearch
Sets the scroll timeout for search operations.- Parameters:
scrollForSearch- the scroll timeout string
-
setMaxConfigSyncStatusRetry
public void setMaxConfigSyncStatusRetry(int maxConfigSyncStatusRetry) Sets the maximum retry attempts for configuration synchronization status checks.- Parameters:
maxConfigSyncStatusRetry- the maximum retry attempts
-
setMaxEsStatusRetry
public void setMaxEsStatusRetry(int maxEsStatusRetry) Sets the maximum retry attempts for search engine status checks.- Parameters:
maxEsStatusRetry- the maximum retry attempts
-
filterWithHeader
Creates a client filtered with additional headers.- Specified by:
filterWithHeaderin interfaceorg.opensearch.transport.client.Client- Parameters:
headers- the headers to add to requests- Returns:
- the filtered client
-
execute
public <Request extends org.opensearch.action.ActionRequest,Response extends org.opensearch.core.action.ActionResponse> org.opensearch.common.action.ActionFuture<Response> execute(org.opensearch.action.ActionType<Response> action, Request request) Executes an action asynchronously.- Specified by:
executein interfaceorg.opensearch.transport.client.OpenSearchClient- Type Parameters:
Request- the request typeResponse- the response type- Parameters:
action- the action to executerequest- the action request- Returns:
- a future for the action response
-
execute
public <Request extends org.opensearch.action.ActionRequest,Response extends org.opensearch.core.action.ActionResponse> void execute(org.opensearch.action.ActionType<Response> action, Request request, org.opensearch.core.action.ActionListener<Response> listener) Executes an action asynchronously with a callback.- Specified by:
executein interfaceorg.opensearch.transport.client.OpenSearchClient- Type Parameters:
Request- the request typeResponse- the response type- Parameters:
action- the action to executerequest- the action requestlistener- the response listener
-
prepareFieldCaps
public org.opensearch.action.fieldcaps.FieldCapabilitiesRequestBuilder prepareFieldCaps(String... indices) Prepares a field capabilities request builder.- Specified by:
prepareFieldCapsin interfaceorg.opensearch.transport.client.Client- Parameters:
indices- the indices to check field capabilities for- Returns:
- the field capabilities request builder
-
fieldCaps
public org.opensearch.common.action.ActionFuture<org.opensearch.action.fieldcaps.FieldCapabilitiesResponse> fieldCaps(org.opensearch.action.fieldcaps.FieldCapabilitiesRequest request) Gets field capabilities asynchronously.- Specified by:
fieldCapsin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the field capabilities request- Returns:
- a future for the field capabilities response
-
fieldCaps
public void fieldCaps(org.opensearch.action.fieldcaps.FieldCapabilitiesRequest request, org.opensearch.core.action.ActionListener<org.opensearch.action.fieldcaps.FieldCapabilitiesResponse> listener) Gets field capabilities asynchronously with a callback.- Specified by:
fieldCapsin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the field capabilities requestlistener- the response listener
-
prepareBulk
Prepares a bulk request builder with a global index.- Specified by:
prepareBulkin interfaceorg.opensearch.transport.client.Client- Parameters:
globalIndex- the global index for all operations- Returns:
- the bulk request builder
-
createPit
public void createPit(org.opensearch.action.search.CreatePitRequest createPITRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.search.CreatePitResponse> listener) Creates a point-in-time context asynchronously.- Specified by:
createPitin interfaceorg.opensearch.transport.client.Client- Parameters:
createPITRequest- the create PIT requestlistener- the response listener
-
deletePits
public void deletePits(org.opensearch.action.search.DeletePitRequest deletePITRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.search.DeletePitResponse> listener) Deletes point-in-time contexts asynchronously.- Specified by:
deletePitsin interfaceorg.opensearch.transport.client.Client- Parameters:
deletePITRequest- the delete PITs requestlistener- the response listener
-
getAllPits
public void getAllPits(org.opensearch.action.search.GetAllPitNodesRequest getAllPitNodesRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.search.GetAllPitNodesResponse> listener) Gets all point-in-time contexts asynchronously.- Specified by:
getAllPitsin interfaceorg.opensearch.transport.client.Client- Parameters:
getAllPitNodesRequest- the get all PITs requestlistener- the response listener
-
pitSegments
public void pitSegments(org.opensearch.action.admin.indices.segments.PitSegmentsRequest pitSegmentsRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.admin.indices.segments.IndicesSegmentResponse> listener) Gets point-in-time segments information asynchronously.- Specified by:
pitSegmentsin interfaceorg.opensearch.transport.client.Client- Parameters:
pitSegmentsRequest- the PIT segments requestlistener- the response listener
-
searchView
public void searchView(org.opensearch.action.admin.indices.view.SearchViewAction.Request request, org.opensearch.core.action.ActionListener<org.opensearch.action.search.SearchResponse> listener) Searches a view asynchronously (not implemented).- Specified by:
searchViewin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the search view requestlistener- the response listener- Throws:
UnsupportedOperationException- always thrown as this operation is not implemented
-
searchView
public org.opensearch.common.action.ActionFuture<org.opensearch.action.search.SearchResponse> searchView(org.opensearch.action.admin.indices.view.SearchViewAction.Request request) Searches a view asynchronously (not implemented).- Specified by:
searchViewin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the search view request- Returns:
- never returns as this operation is not implemented
- Throws:
UnsupportedOperationException- always thrown as this operation is not implemented
-
listViewNames
public void listViewNames(org.opensearch.action.admin.indices.view.ListViewNamesAction.Request request, org.opensearch.core.action.ActionListener<org.opensearch.action.admin.indices.view.ListViewNamesAction.Response> listener) Lists view names asynchronously (not implemented).- Specified by:
listViewNamesin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the list view names requestlistener- the response listener- Throws:
UnsupportedOperationException- always thrown as this operation is not implemented
-
listViewNames
public org.opensearch.common.action.ActionFuture<org.opensearch.action.admin.indices.view.ListViewNamesAction.Response> listViewNames(org.opensearch.action.admin.indices.view.ListViewNamesAction.Request request) Lists view names asynchronously (not implemented).- Specified by:
listViewNamesin interfaceorg.opensearch.transport.client.Client- Parameters:
request- the list view names request- Returns:
- never returns as this operation is not implemented
- Throws:
UnsupportedOperationException- always thrown as this operation is not implemented
-