Run a 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.
What do you want to do?
- Understand Compound queries
- Create a compound query
- Understand the results
- Save the preview results as a node
- Make a set of the sources in your results
Understand Compound queries
Compound queries can help you to find content in your sources 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
You cannot use the Query Wizard to run a Compound query—these queries must be created outside the Wizard, as described below:
-
On the Query tab, in the Create group, click Compound.
The Compound Query dialog box opens.
-
Under Search for content matching select options from the lists:
-
Subquery 1 select the first query type and then click Criteria—refer to Run a Text Search query or Run a Coding query for more information on building the criteria.
-
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. Refer to Combine criteria in queries for more information.
-
Subquery 2 select the second query type and then click Criteria—refer to Run a Text Search query or Run a Coding query for more information on building the criteria.
-
(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.
-
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. Refer to Spread coding for more information.
-
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. Refer to Query options for detailed information.
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:
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 sources.
By default the results are displayed in a preview node—you can choose save this node in the Results folder or in another node folder, refer to Save the preview results as a node for more information.
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—refer to Aggregate nodes for more information.
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.
To save the references as a node:
-
Click on the query results in Detail View.
-
On the Query tab, in the Actions group, click Store Query Results.
The Store Query Results dialog box opens.
-
From the Option list, choose what you want to do with the results. You can:
-
Create the results as a new node
-
Merge the results into an existing node (you must select the node to merge into)
-
Create a node hierarchy where the references from each source are in a separate child node
-
If you are creating a new node, enter a name and description.
-
Click OK.
NOTE
-
By default new nodes are created in the Results folder, unless you choose another location. Refer to Manage query results (Understand the Results Folder) for more information.
-
If you save the results as a node hierarchy, relevant content from each source 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.
Make a set of the sources in your results
You can create a set from the results of a Compound query—the set members are the sources displayed on the Summary tab in the query results in Detail View.
For example, you might want a list of all the interview documents where people mentioned policy in the context of health care. You can save these interviews to a set for further analysis.
To save the results to set:
-
Click in the query result in Detail View.
-
On the Query tab, in the Actions group, click Store Query Results.
The Store Query Results dialog box opens.
-
From the Option list, choose whether you want to create a new set or add the sources to an existing set.
-
If you are creating a new set, enter a name and description.
-
Click OK.