QuerySolr

Description:

Queries Solr and outputs the results as a FlowFile in the format of XML or using a Record Writer

Tags:

Apache, Solr, Get, Query, Records

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, whether a property supports the NiFi Expression Language, and whether a property is considered "sensitive", meaning that its value will be encrypted. Before entering a value in a sensitive property, ensure that the nifi.properties file has an entry for the property nifi.sensitive.props.key.

NameDefault ValueAllowable ValuesDescription
Solr TypeStandard
  • Cloud A SolrCloud instance.
  • Standard A stand-alone Solr instance.
The type of Solr instance, Cloud or Standard.
Solr LocationThe Solr url for a Solr Type of Standard (ex: http://localhost:8984/solr/gettingstarted), or the ZooKeeper hosts for a Solr Type of Cloud (ex: localhost:9983).
Supports Expression Language: true (will be evaluated using variable registry only)
CollectionThe Solr collection name, only used with a Solr Type of Cloud
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Return TypeXML
  • XML
  • Records
Output format of Solr results. Write Solr documents to FlowFiles as XML or using a Record Writer
Record WriterController Service API:
RecordSetWriterFactory
Implementations: ScriptedRecordSetWriter
JsonRecordSetWriter
CSVRecordSetWriter
AvroRecordSetWriter
XMLRecordSetWriter
FreeFormTextRecordSetWriter
The Record Writer to use in order to write Solr documents to FlowFiles. Must be set if "Records" is used as return type.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Solr Query*:*Solr Query, e. g. field:value
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Request Handler/selectDefine a request handler here, e. g. /query
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Field ListComma separated list of fields to be included into results, e. g. field1,field2
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Sorting of result listComma separated sort clauses to define the sorting of results, e. g. field1 asc, field2 desc
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Start of resultsOffset of result set
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
RowsNumber of results to be returned for a single request
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Total amount of returned resultsreturn_only_top_results
  • Entire results
  • Only top results
Total amount of Solr documents to be returned. If this property is set to "Only top results", only single requests will be sent to Solr and the results will be written into single FlowFiles. If it is set to "Entire results", all results matching to the query are retrieved via multiple Solr requests and returned in multiple FlowFiles. For both options, the number of Solr documents to be returned in a FlowFile depends on the configuration of the "Rows" property
Kerberos Credentials ServiceController Service API:
KerberosCredentialsService
Implementation: KeytabCredentialsService
Specifies the Kerberos Credentials Controller Service that should be used for authenticating with Kerberos
UsernameThe username to use when Solr is configured with basic authentication.
Supports Expression Language: true (will be evaluated using variable registry only)
PasswordThe password to use when Solr is configured with basic authentication.
Sensitive Property: true
Supports Expression Language: true (will be evaluated using variable registry only)
SSL Context ServiceController Service API:
SSLContextService
Implementations: StandardRestrictedSSLContextService
StandardSSLContextService
The Controller Service to use in order to obtain an SSL Context. This property must be set when communicating with a Solr over https.
Solr Socket Timeout10 secondsThe amount of time to wait for data on a socket connection to Solr. A value of 0 indicates an infinite timeout.
Solr Connection Timeout10 secondsThe amount of time to wait when establishing a connection to Solr. A value of 0 indicates an infinite timeout.
Solr Maximum Connections10The maximum number of total connections allowed from the Solr client to Solr.
Solr Maximum Connections Per Host5The maximum number of connections allowed from the Solr client to a single Solr host.
ZooKeeper Client Timeout10 secondsThe amount of time to wait for data on a connection to ZooKeeper, only used with a Solr Type of Cloud.
ZooKeeper Connection Timeout10 secondsThe amount of time to wait when establishing a connection to ZooKeeper, only used with a Solr Type of Cloud.

Relationships:

NameDescription
statsStats about Solr index
resultsResults of Solr queries
facetsResults of faceted search
failureFailure relationship
originalOriginal flowfile

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
solr.connectSolr connect string
solr.collectionSolr collection
solr.queryQuery string sent to Solr
solr.cursor.markCursor mark can be used for scrolling Solr
solr.status.codeStatus code of Solr request. A status code of 0 indicates that the request was successfully processed
solr.query.timeThe elapsed time to process the query (in ms)
solr.startSolr start parameter (result offset) for the query
solr.rowsNumber of Solr documents to be returned for the query
solr.number.resultsNumber of Solr documents that match the query
mime.typeThe mime type of the data format
querysolr.exeption.classThe Java exception class raised when the processor fails
querysolr.exeption.messageThe Java exception message raised when the processor fails

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component allows an incoming relationship.

System Resource Considerations:

None specified.