public class SolrIndexer
extends java.lang.Object
implements com.googlecode.fascinator.api.indexer.Indexer
This plugin provides indexing services for DigitalObjects and payloads in The Fascinator through Apache Solr.
Standard configuration table:
| Option | Description | Required | Default |
|---|---|---|---|
| uri | The URI of the Solr service | Yes | http://localhost:9997/solr/fascinator |
| coreName | The name of the indexer | Yes | fascinator |
| embedded | If false, Solr is started as a separate web application. If true, Solr will start in embedded mode which is non-HTTP accessible. Note: that the current version of Solr (1.4) has bugs when running as embedded, version 1.3 is more stable, so it's recommended to keep this option set to false. | Yes | false |
"solr": {
"uri": "http://localhost:9997/solr/fascinator",
"coreName": "fascinator",
"autocommit": false,
"embedded": true
}
The Solr Indexer takes a rules file to assist it in indexing various content. This allows you to set up indexing rules for individual harvests. For example, harvests that are transformed by the Aperture plugin need indexing on RDF whereas OAI-PMH Harvests probably don't need transforming and the XML DC is indexed.
None
| Constructor and Description |
|---|
SolrIndexer() |
| Modifier and Type | Method and Description |
|---|---|
void |
annotate(java.lang.String oid,
java.lang.String pid)
Index an annotation
|
void |
annotateRemove(java.lang.String oid)
Remove all annotations from the index against an object
|
void |
annotateRemove(java.lang.String oid,
java.lang.String annoId)
Remove the specified annotation from the index
|
void |
annotateSearch(com.googlecode.fascinator.api.indexer.SearchRequest request,
java.io.OutputStream response)
Search for annotations and return the result to the provided stream
|
void |
commit()
Call a manual commit against the index
|
java.lang.String |
getId()
Get the ID of the plugin
|
java.util.List<java.lang.Object> |
getJsonObjectWithField(java.lang.String fieldName,
java.lang.String fieldValue) |
java.lang.String |
getName()
Get the name of the plugin
|
com.googlecode.fascinator.api.PluginDescription |
getPluginDetails()
Gets a PluginDescription object relating to this plugin.
|
com.googlecode.fascinator.api.storage.Storage |
getStorage()
Return a reference to this plugins instantiated storage layer
|
void |
index(com.googlecode.fascinator.api.storage.DigitalObject object,
com.googlecode.fascinator.api.storage.Payload payload)
Index a specific payload
|
void |
index(java.lang.String oid)
Index an object and all of its payloads
|
void |
index(java.lang.String oid,
java.lang.String pid)
Index a specific payload
|
void |
init(java.io.File jsonFile)
Initialize the plugin
|
void |
init(java.lang.String jsonString)
Initialize the plugin
|
void |
remove(java.lang.String oid)
Remove the specified object from the index
|
void |
remove(java.lang.String oid,
java.lang.String pid)
Remove the specified payload from the index
|
void |
search(com.googlecode.fascinator.api.indexer.SearchRequest request,
java.io.OutputStream response)
Perform a Solr search and stream the results into the provided output
|
void |
search(com.googlecode.fascinator.api.indexer.SearchRequest request,
java.io.OutputStream response,
java.lang.String format)
Perform a Solr search and stream the results into the provided output
format
|
void |
searchByIndex(com.googlecode.fascinator.api.indexer.SearchRequest request,
java.io.OutputStream response,
java.lang.String indexName)
Search the specified solr index (core) and return the result to the
provided stream
|
void |
sendIndexToBuffer(java.lang.String index,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> fields)
Send the document to buffer directly
|
void |
setCustomParam(java.lang.String property,
java.lang.String value)
Set a value in the custom parameters of the indexer.
|
void |
shutdown()
Shutdown the plugin
|
public java.lang.String getId()
getId in interface com.googlecode.fascinator.api.Pluginpublic java.lang.String getName()
getName in interface com.googlecode.fascinator.api.Pluginpublic com.googlecode.fascinator.api.PluginDescription getPluginDetails()
getPluginDetails in interface com.googlecode.fascinator.api.Pluginpublic void init(java.lang.String jsonString)
throws com.googlecode.fascinator.api.indexer.IndexerException
init in interface com.googlecode.fascinator.api.PluginjsonString - The JSON configuration to use as a stringcom.googlecode.fascinator.api.indexer.IndexerException - if errors occur during initializationpublic void init(java.io.File jsonFile)
throws com.googlecode.fascinator.api.indexer.IndexerException
init in interface com.googlecode.fascinator.api.PluginjsonFile - A file containing the JSON configurationcom.googlecode.fascinator.api.indexer.IndexerException - if errors occur during initializationpublic void setCustomParam(java.lang.String property,
java.lang.String value)
property - : The index to usevalue - : The value to storepublic void shutdown()
throws com.googlecode.fascinator.api.PluginException
shutdown in interface com.googlecode.fascinator.api.Plugincom.googlecode.fascinator.api.PluginException - if any errors occur during shutdownpublic com.googlecode.fascinator.api.storage.Storage getStorage()
public void search(com.googlecode.fascinator.api.indexer.SearchRequest request,
java.io.OutputStream response)
throws com.googlecode.fascinator.api.indexer.IndexerException
search in interface com.googlecode.fascinator.api.indexer.Indexerrequest - : A prepared SearchRequest objectresponse - : The OutputStream to send results tocom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during the searchpublic void search(com.googlecode.fascinator.api.indexer.SearchRequest request,
java.io.OutputStream response,
java.lang.String format)
throws com.googlecode.fascinator.api.indexer.IndexerException
search in interface com.googlecode.fascinator.api.indexer.Indexerrequest - : A prepared SearchRequest objectresponse - : The OutputStream to send results toformat - : Output format - passed directly to SOlr as the "wt"
parametercom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during the searchpublic void remove(java.lang.String oid)
throws com.googlecode.fascinator.api.indexer.IndexerException
remove in interface com.googlecode.fascinator.api.indexer.Indexeroid - : The identifier of the object to removecom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during removalpublic void remove(java.lang.String oid,
java.lang.String pid)
throws com.googlecode.fascinator.api.indexer.IndexerException
remove in interface com.googlecode.fascinator.api.indexer.Indexeroid - : The identifier of the payload's objectpid - : The identifier of the payload to removecom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during removalpublic void annotateRemove(java.lang.String oid)
throws com.googlecode.fascinator.api.indexer.IndexerException
annotateRemove in interface com.googlecode.fascinator.api.indexer.Indexeroid - : The identifier of the objectcom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during removalpublic void annotateRemove(java.lang.String oid,
java.lang.String annoId)
throws com.googlecode.fascinator.api.indexer.IndexerException
annotateRemove in interface com.googlecode.fascinator.api.indexer.Indexeroid - : The identifier of the objectannoId - : The identifier of the annotationcom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during removalpublic void index(java.lang.String oid)
throws com.googlecode.fascinator.api.indexer.IndexerException
index in interface com.googlecode.fascinator.api.indexer.Indexeroid - : The identifier of the objectcom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during indexingpublic void index(java.lang.String oid,
java.lang.String pid)
throws com.googlecode.fascinator.api.indexer.IndexerException
index in interface com.googlecode.fascinator.api.indexer.Indexeroid - : The identifier of the payload's objectpid - : The identifier of the payloadcom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during indexingpublic void index(com.googlecode.fascinator.api.storage.DigitalObject object,
com.googlecode.fascinator.api.storage.Payload payload)
throws com.googlecode.fascinator.api.indexer.IndexerException
object - : The payload's objectpid - : The payloadcom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during indexingpublic void commit()
commit in interface com.googlecode.fascinator.api.indexer.Indexerpublic void sendIndexToBuffer(java.lang.String index,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> fields)
index - fields - public void annotate(java.lang.String oid,
java.lang.String pid)
throws com.googlecode.fascinator.api.indexer.IndexerException
annotate in interface com.googlecode.fascinator.api.indexer.Indexeroid - : The identifier of the annotation's objectpid - : The identifier of the annotationcom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during indexingpublic void searchByIndex(com.googlecode.fascinator.api.indexer.SearchRequest request,
java.io.OutputStream response,
java.lang.String indexName)
throws com.googlecode.fascinator.api.indexer.IndexerException
searchByIndex in interface com.googlecode.fascinator.api.indexer.Indexerrequest - : The SearchRequest objectresponse - : The OutputStream to send responses toindexName - : The name of the indexcom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during indexingpublic void annotateSearch(com.googlecode.fascinator.api.indexer.SearchRequest request,
java.io.OutputStream response)
throws com.googlecode.fascinator.api.indexer.IndexerException
annotateSearch in interface com.googlecode.fascinator.api.indexer.Indexerrequest - : The SearchRequest objectresponse - : The OutputStream to send responses tocom.googlecode.fascinator.api.indexer.IndexerException - if there were errors during indexingpublic java.util.List<java.lang.Object> getJsonObjectWithField(java.lang.String fieldName,
java.lang.String fieldValue)
throws com.googlecode.fascinator.api.indexer.IndexerException
getJsonObjectWithField in interface com.googlecode.fascinator.api.indexer.Indexercom.googlecode.fascinator.api.indexer.IndexerExceptionCopyright © 2009-2019. All Rights Reserved.