The lexical search function allows you to research your documents without first coding them. You can do searches of either
- memos, or
- coded segments, which are currently shown in the “Retrieved Segments” window.
- The search can also be limited to activated documents. You can choose to search in a single document, a document group, or all documents that have certain variable values. The lexical search function can be started by selecting Lexical search from the Analysis drop-down menu or by clicking on the magnifying glass icon in the “MAXQDA standard” toolbar.
After selecting to do a lexical search, the following window will appear:
Entering a search string
When the dialog box first comes up, the left pane is empty and you can just start typing to enter the word or string (called the “search string”) that you want to find. Use the return key to enter multiple search strings.
To add additional search strings later, click “New entry”. To edit an existing search string, click on the word and change it.
Search strings may consist of one word, multiple words, or only of a part of a word. For instance, you can search for “Tom Hanks,” “Hanks,” or only “anks.” Quotation marks are not necessary if a search string consists of more than one word – it would lead MAXQDA to only search for words that are placed in quotation marks.
Search strings may contain so-called “wildcard” characters, e.g. * or ?. The characters function as follows:
- If the character “?” appears in a search string, MAXQDA finds, for instance, “Hanks” if the search string is “H?nks,” but “Hunks” or “Hinks” would also be found.
- The character “*” stands for multiple characters, e.g. “H*ks” would find “Hanks” and also “Hawks.”
- The beginning of a word can be delimited by the character “<().” The search string “<(inter)” would find “Interest,” “interesting,” but not “winter.”
- The end of a word can be delimited by the character “()>.” Thus, the string “(ks)>” would find “Hanks,” “Banks,” and “thanks,” but not “Bankside.”
To search for the asterisk * or the question mark ?, a backslash “\” must be placed in front of them: \* and \?. In addition, you need to select the option “Interpret search items as regular expressions”.
Deleting a search string
To remove search strings from the list, click the x symbol next to the word or select the whole line and click the delete symbol at the top of the dialog window. By holding down the Ctrl key (Windows) or cmd key (Mac), you can delete multiple search strings at once.
Text search options
You will find the options for the search procedure in the right pane of the Lexical Search window.
First, you must specify where you wish to search:
- If you select In documents, additional selection fields that were previously displayed in light grey will become available. These additional fields include “Only in activated documents” and “Only in retrieved segments”. If no texts are activated, these options will not be available.
- Find whole words – Search only for strings that are exactly the same as the search string. For example, if you search for “teach,” the string “teacher” will not be included in the search results. If you turn this function off, “teach” would also give you the strings “teacher” or “teaching” as results.
- Case sensitive – Search only for strings in which the same letters are capitalized as in the search string.
- Interpret search items as regular expressions – the entered search terms are interpreted as “regular expressions”. Regular expressions can be used to perform complex searches (see below for more information).
- Include word forms from lemma lists – searches are conducted not only for an entered search term but also for all its word forms. A search for “go” will also find the word “went”. The option affects only single words, not composite words. You also have to set the appropriate language for the text.
You can also choose how the search terms are linked with each other:
- With the OR combination, a hit is always included in the results list when one of the search terms is found.
- With the AND combination, all the search terms must occur within a defined distance of each other in an adjustable search range.
- As soon as you have selected AND, another option is made available directly below it:
- Within xx document/paragraph/sentence.
With xx you define the maximum distance of the search terms.
The following options are available as a search range:
- Document – the two search terms must occur somewhere within a document. In this case, the maximum distance cannot be set.
- Paragraph (Text, Tables) – the two search terms must occur within xx paragraphs. The search only includes text and table documents.
- Sentence (Text, Tables, PDFs) – the two search terms must occur within xx sentences. In addition to text and table documents, the search also includes PDF files.
You search for the terms “public” and “citizen” within a document. MAXQDA will then check that both of the two terms occur at least once. A row is displayed in the results table for each document in which both terms occur together.
You search for the terms “public” and “citizen” within 1 paragraph. The list of results then contains as many rows as there are paragraphs in which both search terms occur.
You search for the terms “public” and “citizen” within 2 paragraphs. For example, if paragraph 12 contains the term “public”, then “citizen” must appear in paragraphs 11, 12 or 13. Only then will this count as a hit.
As soon as you click the Search button, the search will begin.
Depending on how many documents you search and how complex the search is, it could take some time to find all of the results.
Searching with regular expressions
If you select the option Use regular expressions, MAXQDA interprets the entered search terms as “regular expressions”. These are widely used in information technology and allow complex searches to be carried out. The following table contains some examples of regular expression searches:
|\d||Number from 0 to 9||200\d|
finds all years from 2000 to 2009
finds all words beginning with the letters cap
finds all words ending with the letters cap
finds only “cap”, but not “capital”
|[…]||One of the characters in brackets||h[oôó]tel|
finds hotel, hôtel, hótel
finds all years from 2000 to 2009
finds class 3a, class 3b to class 4d
|( | )||One of the character combinations in brackets||M(ay|ey|ai|ei)|
er finds Mayer, Meyer, Maier and Meier
As an example, a helpful tutorial on the use of regular expressions can be found on the following website:
Saving search terms
Searches can be saved, i.e. you won’t have to enter the search terms again. Click Save, enter the name of the saved scan, and then click Save again. Search files are saved with the extension .SEA (an abbreviation for search). Saved searches can be reentered at any time.