Creating queries in Cloudant Query editor

Use the Cloudant Query editor to create Cloudant queries by specifying settings and parameters for retrieving specific data.

Before you begin

In the Create Cloudant Query wizard, on the Build tab of the Cloudant Query editor, create and open a Cloudant query that uses a search index.

About this task

Specify the options while creating the Cloudant query:

Procedure

  1. To change the index for the query, click the Change Index button. In the Change Index dialog, from the Secondary Indexes or Search Indexes folders, select the index that you want to query, and then click OK.
    Important: If you are working with a partitioned database, you must specify the partition key in the Partition key field.
    Tip: To see the functions that are defined for building the index, switch to the Index tab.
  2. On the Build tab, in the Field definitions section, change the metadata that defines the result set.
    • To change the position of the columns in the query results, select a column and click the Move Up or Move Down navigation buttons.
    • To add a column to the result set, click Add Column and specify a column name and a JSON field, which will supply column values.
    • To edit the data type of the query columns, use the Type column.
  3. To run the query and display query results even if the data cannot be properly converted to the data type that is specified for the column, select the Ignore conversion errors check box.
    Tip: Appropriate messages are displayed in the Output view for the data type conversion errors.
  4. If you do not want to query the documents with ids that begin with "_design/", select the Ignore system documents check box.
  5. In the Structure parameters section, specify the parameters that define the organization of the data in the results.
    Tip: When you change structure parameters, the data in the Field definitions section is automatically updated.
  6. In the Filter parameters section, specify the parameters that filter the result set.
  7. To specify the filter parameters that you want to use as prompts when a Cloudant query is run inside an analytical query, select the check boxes in the Share column.

Results

The Cloudant query is created.

What to do next

You can either run the query or save the query to a repository or a file.