public class TextIndexES extends Object implements TextIndex
TextIndex| Constructor and Description |
|---|
TextIndexES(TextIndexConfig config,
org.elasticsearch.client.Client client,
String indexName)
Constructor used mainly for performing Integration tests
|
TextIndexES(TextIndexConfig config,
ESSettings esSettings)
Construct an instance of
TextIndexES based on provided TextIndexConfig and ESSettings
The constructor is responsible for initializing a TransportClient based on the provided configs
and create index based on the provided ESSettings |
| Modifier and Type | Method and Description |
|---|---|
void |
addEntity(Entity entity)
Add an Entity to the ElasticSearch Index.
|
void |
close()
We don't have resources that need to be closed explicitly
|
void |
commit()
Commit happens in the individual get/add/delete operations
|
void |
deleteEntity(Entity entity)
Delete the value of the entity from the existing document, if any.
|
Map<String,Node> |
get(String uri)
Get an Entity given the subject Id
|
EntityDefinition |
getDocDef() |
void |
prepareCommit()
We do not have any specific logic to perform before committing
|
List<TextHit> |
query(List<Resource> props,
String qs,
String graphURI,
String lang,
int limit,
String highlight) |
List<TextHit> |
query(Node subj,
List<Resource> props,
String qs,
String graphURI,
String lang,
int limit,
String highlight) |
List<TextHit> |
query(Node property,
String qs,
String graphURI,
String lang) |
List<TextHit> |
query(Node property,
String qs,
String graphURI,
String lang,
int limit)
Query the ElasticSearch for the given Node, with the given query String and limit.
|
List<TextHit> |
query(Node property,
String qs,
String graphURI,
String lang,
int limit,
String highlight) |
List<TextHit> |
query(String uri,
List<Resource> props,
String qs,
String graphURI,
String lang,
int limit,
String highlight) |
void |
rollback()
We do not do rollback
|
void |
updateEntity(Entity entity)
Update an Entity.
|
public TextIndexES(TextIndexConfig config, ESSettings esSettings)
TextIndexES based on provided TextIndexConfig and ESSettings
The constructor is responsible for initializing a TransportClient based on the provided configs
and create index based on the provided ESSettingsconfig - an instance of TextIndexConfigesSettings - an instance of ESSettingspublic TextIndexES(TextIndexConfig config, org.elasticsearch.client.Client client, String indexName)
config - an instance of TextIndexConfigclient - an instance of TransportClient. The client should already have been initialized with an indexpublic void prepareCommit()
prepareCommit in interface TextIndexpublic void commit()
public void close()
close in interface org.apache.jena.atlas.lib.Closeablepublic void updateEntity(Entity entity)
addEntity(Entity)
method that takes care of updating the Entity as well.updateEntity in interface TextIndexentity - the entity to update.public void addEntity(Entity entity)
public void deleteEntity(Entity entity)
deleteEntity in interface TextIndexentity - entity whose value needs to be deletedpublic List<TextHit> query(Node property, String qs, String graphURI, String lang, int limit, String highlight)
public List<TextHit> query(Node property, String qs, String graphURI, String lang, int limit)
public List<TextHit> query(List<Resource> props, String qs, String graphURI, String lang, int limit, String highlight)
public List<TextHit> query(Node subj, List<Resource> props, String qs, String graphURI, String lang, int limit, String highlight)
public List<TextHit> query(String uri, List<Resource> props, String qs, String graphURI, String lang, int limit, String highlight)
public EntityDefinition getDocDef()
Licenced under the Apache License, Version 2.0