org.carrot2.source.opensearch
Class OpenSearchDocumentSourceDescriptor.AttributeBuilder

java.lang.Object
  extended by org.carrot2.source.SearchEngineBaseDescriptor.AttributeBuilder
      extended by org.carrot2.source.MultipageSearchEngineDescriptor.AttributeBuilder
          extended by org.carrot2.source.opensearch.OpenSearchDocumentSourceDescriptor.AttributeBuilder
Enclosing class:
OpenSearchDocumentSourceDescriptor

public static class OpenSearchDocumentSourceDescriptor.AttributeBuilder
extends MultipageSearchEngineDescriptor.AttributeBuilder

Attribute map builder for the OpenSearchDocumentSource component. You can use this builder as a type-safe alternative to populating the attribute map using attribute keys.


Field Summary
 Map<String,Object> map
          The attribute map populated by this builder.
 
Constructor Summary
protected OpenSearchDocumentSourceDescriptor.AttributeBuilder(Map<String,Object> map)
          Creates a builder backed by the provided map.
 
Method Summary
 OpenSearchDocumentSourceDescriptor.AttributeBuilder feedUrlParams(Map<String,String> value)
          Additional parameters to be appended to OpenSearchDocumentSource.feedUrlTemplate on each request.
 OpenSearchDocumentSourceDescriptor.AttributeBuilder feedUrlTemplate(String value)
          URL to fetch the search feed from.
 OpenSearchDocumentSourceDescriptor.AttributeBuilder maximumResults(int value)
          Maximum number of results.
 OpenSearchDocumentSourceDescriptor.AttributeBuilder resultsPerPage(int value)
          Results per page.
 OpenSearchDocumentSourceDescriptor.AttributeBuilder userAgent(String value)
          User agent header.
 
Methods inherited from class org.carrot2.source.MultipageSearchEngineDescriptor.AttributeBuilder
searchMode, searchMode
 
Methods inherited from class org.carrot2.source.SearchEngineBaseDescriptor.AttributeBuilder
compressed, documents, query, results, resultsTotal, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

public final Map<String,Object> map
The attribute map populated by this builder.

Constructor Detail

OpenSearchDocumentSourceDescriptor.AttributeBuilder

protected OpenSearchDocumentSourceDescriptor.AttributeBuilder(Map<String,Object> map)
Creates a builder backed by the provided map.

Method Detail

feedUrlTemplate

public OpenSearchDocumentSourceDescriptor.AttributeBuilder feedUrlTemplate(String value)
URL to fetch the search feed from. The URL template can contain variable place holders as defined by the OpenSearch specification that will be replaced during runtime. The format of the place holder is ${variable}. The following variables are supported:

Example URL feed templates for public services:

nature.com
http://www.nature.com/opensearch/request?interface=opensearch&operation=searchRetrieve&query=${searchTerms}&startRecord=${startIndex}&maximumRecords=${count}&httpAccept=application/rss%2Bxml
indeed.com
http://www.indeed.com/opensearch?q=${searchTerms}&start=${startIndex}&limit=${count}

See Also:
OpenSearchDocumentSource.feedUrlTemplate

resultsPerPage

public OpenSearchDocumentSourceDescriptor.AttributeBuilder resultsPerPage(int value)
Results per page. The number of results per page the document source will expect the feed to return.

See Also:
OpenSearchDocumentSource.resultsPerPage

maximumResults

public OpenSearchDocumentSourceDescriptor.AttributeBuilder maximumResults(int value)
Maximum number of results. The maximum number of results the document source can deliver.

See Also:
OpenSearchDocumentSource.maximumResults

feedUrlParams

public OpenSearchDocumentSourceDescriptor.AttributeBuilder feedUrlParams(Map<String,String> value)
Additional parameters to be appended to OpenSearchDocumentSource.feedUrlTemplate on each request.

See Also:
OpenSearchDocumentSource.feedUrlParams

userAgent

public OpenSearchDocumentSourceDescriptor.AttributeBuilder userAgent(String value)
User agent header. The contents of the User-Agent HTTP header to use when making requests to the feed URL. If empty or null value is provided, the following User-Agent will be sent: Rome Client (http://tinyurl.com/64t5n) Ver: UNKNOWN.

See Also:
OpenSearchDocumentSource.userAgent


Copyright (c) Dawid Weiss, Stanislaw Osinski