Operator SolrQuery

SolrDoc > com.ibm.streamsx.solr 1.0.0 > com.ibm.streamsx.solr > SolrQuery

This operator is used for querying a Solr server.One of the incoming attributes must be a solr query (default: solr_query). The query field should look like the portion after "/select/?" in an html query. Special characters must correctly be converted by the user--queries should look like queries made from a browser. For example, spaces should be encoded as '%20'. '=' and '&' characters should remain as is. See sample and tests for query examples. A Solr collection must either be specified as an operator parameter, or it can also be sent in as an attribute with each tuple. The response of the Solr query is placed as an output value (default solr_response). The resonseFormat, numberOfRows, and omitHeader parameters are for convenience and can be instead provided as part of the solr_query. The parameter values will be overridden by query specifications (meaning rows=5 in the query overrides numberOfRows=15 as a parameter). Unrelated incoming attributes with corresponding output attributes will be forwarded along with the solr_response. There is an optional error port where failed queries and their error messages can be sent.

Summary

Ports
This operator has 1 or more input port and 2 output ports.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator supports 9 parameters. (collection, collectionAttribute, fullQueryProvided, numberOfRows, omitHeader, responseFormat, solrQueryAttribute, solrResponseAttribute, solrURL)
Metrics
This operator does not report any metrics.

Properties

Implementation
Java

Input Ports

Ports (0)

Port that ingests tuples

Properties
Ports (1...)

Optional input ports

Properties

Output Ports

Assignments
Java operators do not support output assignments.
Ports (0)

Port that produces tuples

Properties

Ports (1)

Error Port

Properties

Parameters

This operator supports 9 parameters.
collection

Solr collection to add documents to.

Properties
collectionAttribute

Incoming attribute to be used as the collection name. This allows for querying a different collection in each query.

Properties
fullQueryProvided

Allows the user to specify the entire HTTP GET query. If set to true, all other parameters are ignored. Default: false.

Properties
numberOfRows

Number of rows to return in the response. Solr default: 10.

Properties
omitHeader

Whether or not to omit response header. Default is true.

Properties
responseFormat

Format of query response: xml or json (solr default: xml).

Properties
solrQueryAttribute

Incoming attribute to be used as the query string. Default: solr_query. Example of the actual string: ":"

Properties
solrResponseAttribute

Outgoing attribute to be used as the Solr query response. Default: solr_response.

Properties
solrURL

URL of Solr server. Example: http://localhost:8983/solr

Properties

Libraries

Operator class library
Library Path: ../../impl/java/bin, ../../opt/downloaded/*