Class ElasticsearchIndex
java.lang.Object
org.eclipse.rdf4j.sail.lucene.AbstractSearchIndex
org.eclipse.rdf4j.sail.elasticsearch.ElasticsearchIndex
- All Implemented Interfaces:
SearchIndex
@Deprecated(since="5.3.0",
forRemoval=true)
public class ElasticsearchIndex
extends AbstractSearchIndex
Deprecated, for removal: This API element is subject to removal in a future version.
Deprecated in preparation for an Elasticsearch client upgrade; this API will change or be removed in a
future release.
Requires an Elasticsearch cluster with the DeleteByQuery plugin.
Note that, while RDF4J is licensed under the EDL, several ElasticSearch dependencies are licensed under the Elastic license or the SSPL, which may have implications for some projects.
Please consult the ElasticSearch website and license FAQ for more information.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.Set the parameter "documentType=" to specify the document type to use.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.Set the parameter "indexName=" to specify the index to use.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.Set the parameter "transport=" to specify the address of the cluster to use (e.g. localhost:9300).static final StringDeprecated, for removal: This API element is subject to removal in a future version.Set the parameter "waitForActiveShards=" to configure ifinitializationshould wait until the specified number of shards to be active.static final StringDeprecated, for removal: This API element is subject to removal in a future version.Set the parameter "waitForNoRelocatingShards=true|false" to configure ifinitializationshould wait until the are no relocating shards.static final StringDeprecated, for removal: This API element is subject to removal in a future version.Set the parameter "waitForNodes=" to configure ifinitializationshould wait until the specified number of nodes are available.static final StringDeprecated.useWAIT_FOR_NO_RELOCATING_SHARDS_KEYin elastic search >= 5.xstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.Set the parameter "waitForStatus=" to configure ifinitializationshould wait for a particular health status.Fields inherited from class AbstractSearchIndex
defaultNumDocs, maxDocs, wktFields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated, for removal: This API element is subject to removal in a future version.voidbegin()Deprecated, for removal: This API element is subject to removal in a future version.Begins a transaction.voidclear()Deprecated, for removal: This API element is subject to removal in a future version.Clears the indexes.voidclearContexts(Resource... contexts) Deprecated, for removal: This API element is subject to removal in a future version.This should be called from within a begin-commit-rollback block.voidcommit()Deprecated, for removal: This API element is subject to removal in a future version.Commits any changes done to the LuceneIndex since the last commit.The semantics is synchronous to SailConnection.commit(), i.e. the LuceneIndex should be committed/rolled back whenever the LuceneSailConnection is committed/rolled back.protected SearchDocumentDeprecated, for removal: This API element is subject to removal in a future version.protected com.google.common.base.Function<? super String, ? extends org.locationtech.spatial4j.context.SpatialContext> createSpatialContextMapper(Map<String, String> parameters) Deprecated, for removal: This API element is subject to removal in a future version.protected voidDeprecated, for removal: This API element is subject to removal in a future version.protected Iterable<? extends DocumentDistance> geoQuery(IRI geoProperty, org.locationtech.spatial4j.shape.Point p, IRI units, double distance, String distanceVar, Var contextVar) Deprecated, for removal: This API element is subject to removal in a future version.protected Iterable<? extends DocumentResult> geoRelationQuery(String relation, IRI geoProperty, String wkt, Var contextVar) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.protected SearchDocumentgetDocument(String id) Deprecated, for removal: This API element is subject to removal in a future version.Returns a Document representing the specified document ID (combination of resource and context), or null when no such Document exists yet.getDocument(Resource subject, Resource context) Deprecated, for removal: This API element is subject to removal in a future version.Returns a Document representing the specified Resource and Context combination, or null when no such Document exists yet.protected Iterable<? extends SearchDocument> getDocuments(String resourceId) Deprecated, for removal: This API element is subject to removal in a future version.Iterable<? extends SearchDocument> getDocuments(Resource subject) Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of Documents representing the specified Resource (empty when no such Document exists yet).Each document represent a set of statements with the specified Resource as a subject, which are stored in a specific contextDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.getPropertyFields(Set<String> fields) Deprecated, for removal: This API element is subject to removal in a future version.Filters the given list of fields, retaining all property fields.protected org.locationtech.spatial4j.context.SpatialContextgetSpatialContext(String property) Deprecated, for removal: This API element is subject to removal in a future version.String[]getTypes()Deprecated, for removal: This API element is subject to removal in a future version.voidinitialize(Properties parameters) Deprecated, for removal: This API element is subject to removal in a future version.protected BulkUpdaterDeprecated, for removal: This API element is subject to removal in a future version.protected SearchDocumentnewDocument(String id, String resourceId, String context) Deprecated, for removal: This API element is subject to removal in a future version.protected Iterable<? extends DocumentScore> Deprecated, for removal: This API element is subject to removal in a future version.Parse the passed query.voidrollback()Deprecated, for removal: This API element is subject to removal in a future version.org.elasticsearch.search.SearchHitssearch(Resource resource, org.elasticsearch.action.search.SearchRequestBuilder request, org.elasticsearch.index.query.QueryBuilder query) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates the given query only for the given resource.org.elasticsearch.search.SearchHitssearch(Resource resource, org.elasticsearch.action.search.SearchRequestBuilder request, org.elasticsearch.index.query.QueryBuilder query, int numDocs) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates the given query only for the given resource.org.elasticsearch.search.SearchHitssearch(org.elasticsearch.action.search.SearchRequestBuilder request, org.elasticsearch.index.query.QueryBuilder query) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates the given query and returns the results as a TopDocs instance.org.elasticsearch.search.SearchHitssearch(org.elasticsearch.action.search.SearchRequestBuilder request, org.elasticsearch.index.query.QueryBuilder query, int numDocs) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates the given query and returns the results as a TopDocs instance.voidshutDown()Deprecated, for removal: This API element is subject to removal in a future version.protected voidDeprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class AbstractSearchIndex
accept, addDocuments, addRemoveStatements, addStatement, evaluate, getIndexedTypeMapping, getResource, isGeoField, isIndexedTypeStatement, isTypeFilteringEnabled, isTypeStatement, parseLuceneQueryShape, parseQueryPoint, parseQueryShape, removeStatement
-
Field Details
-
INDEX_NAME_KEY
Deprecated, for removal: This API element is subject to removal in a future version.Set the parameter "indexName=" to specify the index to use.- See Also:
-
DOCUMENT_TYPE_KEY
Deprecated, for removal: This API element is subject to removal in a future version.Set the parameter "documentType=" to specify the document type to use. By default, the document type is "resource".- See Also:
-
TRANSPORT_KEY
Deprecated, for removal: This API element is subject to removal in a future version.Set the parameter "transport=" to specify the address of the cluster to use (e.g. localhost:9300).- See Also:
-
WAIT_FOR_STATUS_KEY
Deprecated, for removal: This API element is subject to removal in a future version.Set the parameter "waitForStatus=" to configure ifinitializationshould wait for a particular health status. The value can be one of "green" or "yellow". Does not wait by default.- See Also:
-
WAIT_FOR_NODES_KEY
Deprecated, for removal: This API element is subject to removal in a future version.Set the parameter "waitForNodes=" to configure ifinitializationshould wait until the specified number of nodes are available. Does not wait by default.- See Also:
-
WAIT_FOR_ACTIVE_SHARDS_KEY
Deprecated, for removal: This API element is subject to removal in a future version.Set the parameter "waitForActiveShards=" to configure ifinitializationshould wait until the specified number of shards to be active. Does not wait by default.- See Also:
-
WAIT_FOR_RELOCATING_SHARDS_KEY
Deprecated.useWAIT_FOR_NO_RELOCATING_SHARDS_KEYin elastic search >= 5.xSet the parameter "waitForRelocatingShards=" to configure ifinitializationshould wait until the specified number of nodes are relocating. Does not wait by default.- See Also:
-
WAIT_FOR_NO_RELOCATING_SHARDS_KEY
Deprecated, for removal: This API element is subject to removal in a future version.Set the parameter "waitForNoRelocatingShards=true|false" to configure ifinitializationshould wait until the are no relocating shards. Defaults to false, meaning the operation does not wait on there being no more relocating shards. Set to true to wait until the number of relocating shards in the cluster is 0.- See Also:
-
DEFAULT_INDEX_NAME
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
DEFAULT_DOCUMENT_TYPE
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
DEFAULT_TRANSPORT
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
DEFAULT_ANALYZER
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
ELASTICSEARCH_KEY_PREFIX
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
PROPERTY_FIELD_PREFIX
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
ALL_PROPERTY_FIELDS
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
GEOPOINT_FIELD_PREFIX
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
GEOSHAPE_FIELD_PREFIX
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
-
Constructor Details
-
ElasticsearchIndex
public ElasticsearchIndex()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
getClusterName
Deprecated, for removal: This API element is subject to removal in a future version. -
getIndexName
Deprecated, for removal: This API element is subject to removal in a future version. -
getTypes
Deprecated, for removal: This API element is subject to removal in a future version. -
initialize
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
initializein interfaceSearchIndex- Overrides:
initializein classAbstractSearchIndex- Throws:
Exception
-
createSpatialContextMapper
-
getMappings
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
getSpatialContext
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getSpatialContextin classAbstractSearchIndex
-
shutDown
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
getDocument
Deprecated, for removal: This API element is subject to removal in a future version.Returns a Document representing the specified document ID (combination of resource and context), or null when no such Document exists yet.- Specified by:
getDocumentin classAbstractSearchIndex- Throws:
IOException
-
getDocuments
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getDocumentsin classAbstractSearchIndex- Throws:
IOException
-
newDocument
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
newDocumentin classAbstractSearchIndex
-
copyDocument
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
copyDocumentin classAbstractSearchIndex
-
addDocument
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
addDocumentin classAbstractSearchIndex- Throws:
IOException
-
updateDocument
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
updateDocumentin classAbstractSearchIndex- Throws:
IOException
-
deleteDocument
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
deleteDocumentin classAbstractSearchIndex- Throws:
IOException
-
newBulkUpdate
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
newBulkUpdatein classAbstractSearchIndex
-
getDocument
Deprecated, for removal: This API element is subject to removal in a future version.Returns a Document representing the specified Resource and Context combination, or null when no such Document exists yet.- Parameters:
subject-context-- Returns:
- search document
- Throws:
IOException
-
getDocuments
Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of Documents representing the specified Resource (empty when no such Document exists yet).Each document represent a set of statements with the specified Resource as a subject, which are stored in a specific context- Parameters:
subject-- Returns:
- list of documents
- Throws:
IOException
-
getPropertyFields
-
begin
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SearchIndexBegins a transaction.- Throws:
IOException
-
commit
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SearchIndexCommits any changes done to the LuceneIndex since the last commit.The semantics is synchronous to SailConnection.commit(), i.e. the LuceneIndex should be committed/rolled back whenever the LuceneSailConnection is committed/rolled back.- Throws:
IOException
-
rollback
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
query
protected Iterable<? extends DocumentScore> query(Resource subject, QuerySpec spec) throws MalformedQueryException, IOException Deprecated, for removal: This API element is subject to removal in a future version.Parse the passed query.- Specified by:
queryin classAbstractSearchIndex- Parameters:
subject-spec- query to process- Returns:
- the parsed query
- Throws:
MalformedQueryExceptionIOExceptionIllegalArgumentException- if the spec contains a multi-param query
-
search
public org.elasticsearch.search.SearchHits search(Resource resource, org.elasticsearch.action.search.SearchRequestBuilder request, org.elasticsearch.index.query.QueryBuilder query) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates the given query only for the given resource.- Parameters:
resource-request-query-- Returns:
- search hits
-
search
public org.elasticsearch.search.SearchHits search(Resource resource, org.elasticsearch.action.search.SearchRequestBuilder request, org.elasticsearch.index.query.QueryBuilder query, int numDocs) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates the given query only for the given resource.- Parameters:
resource-request-query-numDocs-- Returns:
- search hits
-
geoQuery
protected Iterable<? extends DocumentDistance> geoQuery(IRI geoProperty, org.locationtech.spatial4j.shape.Point p, IRI units, double distance, String distanceVar, Var contextVar) throws MalformedQueryException, IOException Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
geoQueryin classAbstractSearchIndex- Throws:
MalformedQueryExceptionIOException
-
geoRelationQuery
protected Iterable<? extends DocumentResult> geoRelationQuery(String relation, IRI geoProperty, String wkt, Var contextVar) throws MalformedQueryException, IOException Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
geoRelationQueryin classAbstractSearchIndex- Throws:
MalformedQueryExceptionIOException
-
search
public org.elasticsearch.search.SearchHits search(org.elasticsearch.action.search.SearchRequestBuilder request, org.elasticsearch.index.query.QueryBuilder query) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates the given query and returns the results as a TopDocs instance. -
search
public org.elasticsearch.search.SearchHits search(org.elasticsearch.action.search.SearchRequestBuilder request, org.elasticsearch.index.query.QueryBuilder query, int numDocs) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates the given query and returns the results as a TopDocs instance. -
clearContexts
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SearchIndexThis should be called from within a begin-commit-rollback block.- Parameters:
contexts-- Throws:
IOException
-
clear
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SearchIndexClears the indexes.- Throws:
IOException
-