Class OpenSearch1xIndexWriter
java.lang.Object
org.apache.nutch.indexwriter.opensearch1x.OpenSearch1xIndexWriter
- All Implemented Interfaces:
Configurable,IndexWriter,Pluggable
Sends NutchDocuments to a configured OpenSearch index.
-
Field Summary
Fields inherited from interface org.apache.nutch.indexer.IndexWriter
X_POINT_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.opensearch.action.bulk.BulkProcessor.ListenerGenerates a default BulkProcessor.Listenervoidclose()voidcommit()voiddescribe()ReturnsMapwith the specific parameters the IndexWriter instance can take.getConf()protected org.opensearch.client.RestHighLevelClientmakeClient(IndexWriterParams parameters) Generates a RestHighLevelClient with the hosts givenvoidopen(Configuration conf, String name) voidopen(IndexWriterParams parameters) Initializes the internal variables from a given index writer configuration.voidsetConf(Configuration conf) voidupdate(NutchDocument doc) voidwrite(NutchDocument doc)
-
Constructor Details
-
OpenSearch1xIndexWriter
public OpenSearch1xIndexWriter()
-
-
Method Details
-
open
- Specified by:
openin interfaceIndexWriter- Parameters:
conf- Nutch configurationname- target name of theIndexWriterto be opened- Throws:
IOException- Some exception thrown by some writer.
-
open
Initializes the internal variables from a given index writer configuration.- Specified by:
openin interfaceIndexWriter- Parameters:
parameters- Params from the index writer configuration.- Throws:
IOException- Some exception thrown by writer.
-
makeClient
protected org.opensearch.client.RestHighLevelClient makeClient(IndexWriterParams parameters) throws IOException Generates a RestHighLevelClient with the hosts given- Parameters:
parameters- implementation specificIndexWriterParams- Returns:
- an initialized
RestHighLevelClient - Throws:
IOException- if there is an error reading theIndexWriterParams
-
bulkProcessorListener
protected org.opensearch.action.bulk.BulkProcessor.Listener bulkProcessorListener()Generates a default BulkProcessor.Listener- Returns:
BulkProcessor.Listener
-
write
- Specified by:
writein interfaceIndexWriter- Throws:
IOException
-
delete
- Specified by:
deletein interfaceIndexWriter- Throws:
IOException
-
update
- Specified by:
updatein interfaceIndexWriter- Throws:
IOException
-
commit
- Specified by:
commitin interfaceIndexWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceIndexWriter- Throws:
IOException
-
describe
ReturnsMapwith the specific parameters the IndexWriter instance can take.- Specified by:
describein interfaceIndexWriter- Returns:
- The values of each row. It must have the form <KEY,<DESCRIPTION,VALUE>>.
-
setConf
- Specified by:
setConfin interfaceConfigurable
-
getConf
- Specified by:
getConfin interfaceConfigurable
-