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
- On the Explore tab, in the Query group, click Compound.
- Under Search
for content matching select options from the lists:
- 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.
- 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.
- 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.
- (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.
- 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:
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.
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.
- Click on the query results in Detail View.
- On the Node tab, in the Query group, click Store Query Results, then click Store Query Results.
- 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).
- If you are creating a new node, enter a name and description.
- Click OK.
- 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.