ApacheSolrQueryActivity

Use this activity to query the documents and data on your Apache Solr server.

Configuration

The Configuration tab has the following fields.

Field Description
Connection Name of the Apache Solr server connection that you want to use in this activity.

Input Settings

Enter your Apache Solr queries in the Input Settings tab. Queries could be parameterized queries. Parameters which become input fields in the Input tab are marked by the prefix "?". Input fields are available in the Input tab for mapping into values from the previous activities of the flow.

Field Description
Query The Apache Solr search SQL query to query the documents and data on Apache Solr server. Only Apache Solr standard query syntax is supported. Parameterized queries can be entered. For example:
q=cat:electronics;

The above example, queries the Apache Solr server on the specified core to find documents that belong to the specified cat or category (as defined in the schema). In this example the cat is electronics.

The following are examples or parameterized queries

q=cat:?cat;

Note that the ?cat literal is the parameterized argument in the example query above. cat will be available in the Input tab where it can be mapped to the fields from the previous activities.

Other examples of parameterized queries are as follows:

select?facet.field=author&facet=on&fl=facet_fields&q=*:*;

q=*:*&facet.field=?facetfield&facet.mincount=?facetcount&fa
cet=on&rows=0;

Input

The Input tab displays the fields parsed from query which you entered in Input Setting tab. You can input the values for each element by hard coding the value or mapping the value to an element from the output schema of a previous activity in the flow. See the section on "Using the Mapper" in the TIBCO Flogo® Enterprise User's Guide for details on how to map elements.

Output Settings

This tab is used for defining the response schema for the query output data.

Field Description
Response Schema The format for the response sent by the Apache Solr server to the query you entered in Input Settings tab. The JSON response that you enter in the Output Settings tab is parsed by this activity and an output JSON schema constructed from it. The constructed schema is assigned to the doc[] array element of the response schema document.
The response format must be a valid JSON object. Do the following to obtain a JSON object from the query response:
  1. Run your query on the Apache Solr server using the Apache Solr admin.
  2. Copy the JSON response for one response element.
  3. Paste the JSON data of the element into the Response Schema field.
  4. Make sure that the element you paste is a valid JSON object.

Following is an example of an element in JSON:

Output

The Output tab displays the Response Schema elements in a tree format.