Class ScopeSearchIndexManager
- java.lang.Object
-
- com.couchbase.client.java.manager.search.ScopeSearchIndexManager
-
@Volatile public class ScopeSearchIndexManager extends Object
TheScopeSearchIndexManager
allows to manage search indexes.All management is done with scope FTS indexes. For global FTS indexes, use @
SearchIndexManager
.
-
-
Constructor Summary
Constructors Constructor Description ScopeSearchIndexManager(AsyncScopeSearchIndexManager internal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allowQuerying(String name)
Allows querying against an index.void
allowQuerying(String name, AllowQueryingSearchIndexOptions options)
Allows querying against an index.List<JsonObject>
analyzeDocument(String name, JsonObject document)
Allows to see how a document is analyzed against a specific index.List<JsonObject>
analyzeDocument(String name, JsonObject document, AnalyzeDocumentOptions options)
Allows to see how a document is analyzed against a specific index.void
disallowQuerying(String name)
Disallows querying against an index.void
disallowQuerying(String name, DisallowQueryingSearchIndexOptions options)
Disallows querying against an index.void
dropIndex(String name)
Drops an index.void
dropIndex(String name, DropSearchIndexOptions options)
Drops an index.void
freezePlan(String name)
Freeze the assignment of index partitions to nodes.void
freezePlan(String name, FreezePlanSearchIndexOptions options)
Freeze the assignment of index partitions to nodes.List<SearchIndex>
getAllIndexes()
Fetches all indexes from the server.List<SearchIndex>
getAllIndexes(GetAllSearchIndexesOptions options)
Fetches all indexes from the server.SearchIndex
getIndex(String name)
Fetches an index from the server if it exists.SearchIndex
getIndex(String name, GetSearchIndexOptions options)
Fetches an index from the server if it exists.Long
getIndexedDocumentsCount(String name)
Retrieves the number of documents that have been indexed for an index.Long
getIndexedDocumentsCount(String name, GetIndexedSearchIndexOptions options)
Retrieves the number of documents that have been indexed for an index.void
pauseIngest(String name)
Pauses updates and maintenance for an index.void
pauseIngest(String name, PauseIngestSearchIndexOptions options)
Pauses updates and maintenance for an index.void
resumeIngest(String name)
Resumes updates and maintenance for an index.void
resumeIngest(String name, ResumeIngestSearchIndexOptions options)
Resumes updates and maintenance for an index.void
unfreezePlan(String name)
Unfreeze the assignment of index partitions to nodes.void
unfreezePlan(String name, UnfreezePlanSearchIndexOptions options)
Unfreeze the assignment of index partitions to nodes.void
upsertIndex(SearchIndex index)
Creates, or updates, an index.void
upsertIndex(SearchIndex index, UpsertSearchIndexOptions options)
Creates, or updates, an index.
-
-
-
Constructor Detail
-
ScopeSearchIndexManager
public ScopeSearchIndexManager(AsyncScopeSearchIndexManager internal)
-
-
Method Detail
-
getIndex
public SearchIndex getIndex(String name)
Fetches an index from the server if it exists.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName". This should just be the index name, rather than "bucket.scope.indexName".- Returns:
- a
CompletableFuture
the found index once complete.
-
getIndex
public SearchIndex getIndex(String name, GetSearchIndexOptions options)
Fetches an index from the server if it exists.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".- Returns:
- a
CompletableFuture
the found index once complete.
-
getAllIndexes
public List<SearchIndex> getAllIndexes()
Fetches all indexes from the server.- Returns:
- a
CompletableFuture
with all index definitions once complete.
-
getAllIndexes
public List<SearchIndex> getAllIndexes(GetAllSearchIndexesOptions options)
Fetches all indexes from the server.- Returns:
- a
CompletableFuture
with all index definitions once complete.
-
getIndexedDocumentsCount
public Long getIndexedDocumentsCount(String name)
Retrieves the number of documents that have been indexed for an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".- Returns:
- a
CompletableFuture
with the indexed documents count once complete.
-
getIndexedDocumentsCount
public Long getIndexedDocumentsCount(String name, GetIndexedSearchIndexOptions options)
Retrieves the number of documents that have been indexed for an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".- Returns:
- a
CompletableFuture
with the indexed documents count once complete.
-
upsertIndex
public void upsertIndex(SearchIndex index)
Creates, or updates, an index.- Parameters:
index
- the index definition to upsert.
-
upsertIndex
public void upsertIndex(SearchIndex index, UpsertSearchIndexOptions options)
Creates, or updates, an index.- Parameters:
index
- the index definition to upsert.
-
dropIndex
public void dropIndex(String name)
Drops an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
dropIndex
public void dropIndex(String name, DropSearchIndexOptions options)
Drops an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
analyzeDocument
public List<JsonObject> analyzeDocument(String name, JsonObject document)
Allows to see how a document is analyzed against a specific index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".document
- the document to analyze.- Returns:
- a
CompletableFuture
with analyzed document parts once complete.
-
analyzeDocument
public List<JsonObject> analyzeDocument(String name, JsonObject document, AnalyzeDocumentOptions options)
Allows to see how a document is analyzed against a specific index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".document
- the document to analyze.- Returns:
- a
CompletableFuture
with analyzed document parts once complete.
-
pauseIngest
public void pauseIngest(String name)
Pauses updates and maintenance for an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
pauseIngest
public void pauseIngest(String name, PauseIngestSearchIndexOptions options)
Pauses updates and maintenance for an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
resumeIngest
public void resumeIngest(String name)
Resumes updates and maintenance for an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
resumeIngest
public void resumeIngest(String name, ResumeIngestSearchIndexOptions options)
Resumes updates and maintenance for an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
allowQuerying
public void allowQuerying(String name)
Allows querying against an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
allowQuerying
public void allowQuerying(String name, AllowQueryingSearchIndexOptions options)
Allows querying against an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
disallowQuerying
public void disallowQuerying(String name)
Disallows querying against an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
disallowQuerying
public void disallowQuerying(String name, DisallowQueryingSearchIndexOptions options)
Disallows querying against an index.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
freezePlan
public void freezePlan(String name)
Freeze the assignment of index partitions to nodes.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
freezePlan
public void freezePlan(String name, FreezePlanSearchIndexOptions options)
Freeze the assignment of index partitions to nodes.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
unfreezePlan
public void unfreezePlan(String name)
Unfreeze the assignment of index partitions to nodes.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
unfreezePlan
public void unfreezePlan(String name, UnfreezePlanSearchIndexOptions options)
Unfreeze the assignment of index partitions to nodes.- Parameters:
name
- the name of the search index. This should just be the index name, rather than "bucket.scope.indexName".
-
-