Queries > Compound query

Compound query

You can use a Compound query to combine a Text Search and Coding query—this can be useful when you want to search for a term within (or near) coded content. A Compound query can also combine two Text Search queries or two Coding queries.

Compound queries can help you to find content in your files that is close to other content. For example, you can:

  • Combine a Text Search and Coding query to search for text in or near coded content
  • Combine two Text Search queries to search for content where one term precedes another
  • Combine two Coding queries to search for content coded at one node, near content coded at another

Create a compound query

  1. On the Explore tab, in the Query group, click Compound.
  2. Under Search for content matching select options from the lists:
    1. Subquery 1 select the first query type and then click Criteria—refer to Text Search query or Coding query for more information on building the criteria.
    2. NEAR Content select a coding search operator such as AND. If you chose the NEAR or PRECEDING Content, you can specify the options for proximity and retrieval.
    3. Subquery 2 select the second query type and then click Criteria—refer to Text Search query or Coding query for more information on building the criteria.
  3. (Optional) Set the scope of your query:
    • From the In list, select the items you want to include in the query—click the Select button to select the project items.
    • From the Where list, you can specify to search project items created and/or modified by any or selected users—click the Select button to select the project items.
  4. Click Run.

NOTE

  • To save the Compound query, select the Add to Project check box and enter the name and description (optional) in the General tab.
  • Click the Query Options tab to define the spread coding options (amount of coding spread around the search word.
  • The Query Options tab also allows you to set your preferences for storing the results—for example, you might want to store the results as a node when you run the query.

Understand the results

By default, the results of a Compound query are displayed as a preview node in Detail View—the Reference tab is in focus:

Reference tab in Detail View.

Click the tabs on the right to see the matching content that has been coded in text (documents, memos and externals), audio, video, picture or dataset files.

By default the results are displayed in a preview node—you can choose to save this node in the Query Results folder or in another node folder.

If you prefer nodes to open with the Summary tab in focus, you can change the setting in Application Options.

If you include an 'aggregate' node in the scope of a query, content coded at the node and all its direct children will be included in the query results.

Save the preview results as a node

If your query has returned interesting content, you may want to save it as a node, so that you can explore it further. For example, you might find all the content coded at the node water quality, which contain the term agriculture. You can save it to a node and review it later.

The node will contain the content displayed on the Reference tab in the query results in Detail View. If you repeatedly run the same query, you may want to merge the references into an existing node, rather than create them as a new node.

  1. Click on the query results in Detail View.
  2. On the Node tab, in the Query group, click Store Query Results, then click Store Query Results.
  3. From the Options list, choose what you want to do with the results. For example, you can create the results as a new node or merge the results into an existing node (you need to select the node to merge into).
  4. If you are creating a new node, enter a name and description.
  5. Click OK.

NOTE  

  • By default new nodes are created in the Query Results folder, unless you choose another location. Manage query results
  • If you save the results as a node hierarchy, relevant content from each file is coded to a separate node, under a parent node.
  • You can choose how you want to store the results before you run the query—by setting your preferences on the Query Options tab in the Compound Query dialog box.