org.carrot2.source.solr
Class SolrDocumentSource

java.lang.Object
  extended by org.carrot2.core.ProcessingComponentBase
      extended by org.carrot2.source.SearchEngineBase
          extended by org.carrot2.source.SimpleSearchEngine
              extended by org.carrot2.source.xml.RemoteXmlSimpleSearchEngineBase
                  extended by org.carrot2.source.solr.SolrDocumentSource
All Implemented Interfaces:
IDocumentSource, IProcessingComponent

public class SolrDocumentSource
extends RemoteXmlSimpleSearchEngineBase

Fetches documents from an instance of Solr.

See Also:
Apache SOLR

Field Summary
 String serviceUrlBase
          Solr service URL base.
 String solrSummaryFieldName
          Summary field name.
 String solrTitleFieldName
          Title field name.
 String solrUrlFieldName
          URL field name.
 
Fields inherited from class org.carrot2.source.SearchEngineBase
compressed, documents, query, results, resultsTotal, start, statistics
 
Constructor Summary
SolrDocumentSource()
           
 
Method Summary
protected  String buildServiceUrl()
          Builds the URL from which XML stream will be fetched.
protected  Map<String,String> getXsltParameters()
          Returns parameters to be passed to the XSLT transformer.
protected  IResource getXsltResource()
          Returns the XSLT stylesheet that transforms the custom XML into Carrot2 compliant XML.
 
Methods inherited from class org.carrot2.source.xml.RemoteXmlSimpleSearchEngineBase
beforeProcessing, fetchSearchResponse, getPassword, getUser, init
 
Methods inherited from class org.carrot2.source.SimpleSearchEngine
process
 
Methods inherited from class org.carrot2.source.SearchEngineBase
afterFetch, clean, urlEncode
 
Methods inherited from class org.carrot2.core.ProcessingComponentBase
afterProcessing, dispose, getContext, getSharedExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.carrot2.core.IProcessingComponent
afterProcessing, dispose
 

Field Detail

serviceUrlBase

public String serviceUrlBase
Solr service URL base.

Attribute label:
Service URL
Attribute level:
Advanced
Attribute group:
Service

solrTitleFieldName

public String solrTitleFieldName
Title field name. Name of the Solr field that will provide document titles.

Attribute label:
Title field name
Attribute level:
Medium
Attribute group:
Index field mapping

solrSummaryFieldName

public String solrSummaryFieldName
Summary field name. Name of the Solr field that will provide document summary.

Attribute label:
Summary field name
Attribute level:
Medium
Attribute group:
Index field mapping

solrUrlFieldName

public String solrUrlFieldName
URL field name. Name of the Solr field that will provide document URLs.

Attribute label:
URL field name
Attribute level:
Medium
Attribute group:
Index field mapping
Constructor Detail

SolrDocumentSource

public SolrDocumentSource()
Method Detail

buildServiceUrl

protected String buildServiceUrl()
Description copied from class: RemoteXmlSimpleSearchEngineBase
Builds the URL from which XML stream will be fetched. This method will be called once per request processing cycle. Processing-time attributes will have been bound before this method the call to this method.

Specified by:
buildServiceUrl in class RemoteXmlSimpleSearchEngineBase

getXsltResource

protected IResource getXsltResource()
Description copied from class: RemoteXmlSimpleSearchEngineBase
Returns the XSLT stylesheet that transforms the custom XML into Carrot2 compliant XML. This method will be called once during component initialization. Initialization time attributes will have been bound before the call to this method.

Specified by:
getXsltResource in class RemoteXmlSimpleSearchEngineBase

getXsltParameters

protected Map<String,String> getXsltParameters()
Description copied from class: RemoteXmlSimpleSearchEngineBase
Returns parameters to be passed to the XSLT transformer. This method will be called once per processing cycle. Processing-time attributes will have been bound before this method the call to this method. The default implementation returns null.

Overrides:
getXsltParameters in class RemoteXmlSimpleSearchEngineBase


Copyright (c) Dawid Weiss, Stanislaw Osinski