|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.fascinator.indexer.SolrIndexer
public class SolrIndexer
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 Summary | |
|---|---|
SolrIndexer()
|
|
| Method Summary | |
|---|---|
void |
annotate(String oid,
String pid)
Index an annotation |
void |
annotateRemove(String oid)
Remove all annotations from the index against an object |
void |
annotateRemove(String oid,
String annoId)
Remove the specified annotation from the index |
void |
annotateSearch(SearchRequest request,
OutputStream response)
Search for annotations and return the result to the provided stream |
void |
commit()
Call a manual commit against the index |
String |
getId()
Get the ID of the plugin |
String |
getName()
Get the name of the plugin |
PluginDescription |
getPluginDetails()
Gets a PluginDescription object relating to this plugin. |
Storage |
getStorage()
Return a reference to this plugins instantiated storage layer |
void |
index(DigitalObject object,
Payload payload)
Index a specific payload |
void |
index(String oid)
Index an object and all of its payloads |
void |
index(String oid,
String pid)
Index a specific payload |
void |
init(File jsonFile)
Initialize the plugin |
void |
init(String jsonString)
Initialize the plugin |
void |
remove(String oid)
Remove the specified object from the index |
void |
remove(String oid,
String pid)
Remove the specified payload from the index |
void |
search(SearchRequest request,
OutputStream response)
Perform a Solr search and stream the results into the provided output |
void |
search(SearchRequest request,
OutputStream response,
String format)
Perform a Solr search and stream the results into the provided output format |
void |
searchByIndex(SearchRequest request,
OutputStream response,
String indexName)
Search the specified solr index (core) and return the result to the provided stream |
void |
sendIndexToBuffer(String index,
Map<String,List<String>> fields)
Send the document to buffer directly |
void |
setCustomParam(String property,
String value)
Set a value in the custom parameters of the indexer. |
void |
shutdown()
Shutdown the plugin |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SolrIndexer()
| Method Detail |
|---|
public String getId()
getId in interface Pluginpublic String getName()
getName in interface Pluginpublic PluginDescription getPluginDetails()
getPluginDetails in interface Plugin
public void init(String jsonString)
throws IndexerException
init in interface PluginjsonString - The JSON configuration to use as a string
IndexerException - if errors occur during initialization
public void init(File jsonFile)
throws IndexerException
init in interface PluginjsonFile - A file containing the JSON configuration
IndexerException - if errors occur during initialization
public void setCustomParam(String property,
String value)
property - : The index to usevalue - : The value to store
public void shutdown()
throws PluginException
shutdown in interface PluginPluginException - if any errors occur during shutdownpublic Storage getStorage()
public void search(SearchRequest request,
OutputStream response)
throws IndexerException
search in interface Indexerrequest - : A prepared SearchRequest objectresponse - : The OutputStream to send results to
IndexerException - if there were errors during the search
public void search(SearchRequest request,
OutputStream response,
String format)
throws IndexerException
search in interface Indexerrequest - : A prepared SearchRequest objectresponse - : The OutputStream to send results toformat - : Output format - passed directly to SOlr as the "wt" parameter
IndexerException - if there were errors during the search
public void remove(String oid)
throws IndexerException
remove in interface Indexeroid - : The identifier of the object to remove
IndexerException - if there were errors during removal
public void remove(String oid,
String pid)
throws IndexerException
remove in interface Indexeroid - : The identifier of the payload's objectpid - : The identifier of the payload to remove
IndexerException - if there were errors during removal
public void annotateRemove(String oid)
throws IndexerException
annotateRemove in interface Indexeroid - : The identifier of the object
IndexerException - if there were errors during removal
public void annotateRemove(String oid,
String annoId)
throws IndexerException
annotateRemove in interface Indexeroid - : The identifier of the objectannoId - : The identifier of the annotation
IndexerException - if there were errors during removal
public void index(String oid)
throws IndexerException
index in interface Indexeroid - : The identifier of the object
IndexerException - if there were errors during indexing
public void index(String oid,
String pid)
throws IndexerException
index in interface Indexeroid - : The identifier of the payload's objectpid - : The identifier of the payload
IndexerException - if there were errors during indexing
public void index(DigitalObject object,
Payload payload)
throws IndexerException
object - : The payload's objectpid - : The payload
IndexerException - if there were errors during indexingpublic void commit()
commit in interface Indexer
public void sendIndexToBuffer(String index,
Map<String,List<String>> fields)
index - fields -
public void annotate(String oid,
String pid)
throws IndexerException
annotate in interface Indexeroid - : The identifier of the annotation's objectpid - : The identifier of the annotation
IndexerException - if there were errors during indexing
public void searchByIndex(SearchRequest request,
OutputStream response,
String indexName)
throws IndexerException
searchByIndex in interface Indexerrequest - : The SearchRequest objectresponse - : The OutputStream to send responses toindexName - : The name of the index
IndexerException - if there were errors during indexing
public void annotateSearch(SearchRequest request,
OutputStream response)
throws IndexerException
annotateSearch in interface Indexerrequest - : The SearchRequest objectresponse - : The OutputStream to send responses to
IndexerException - if there were errors during indexing
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||