For the complete documentation index, see llms.txt. This page is also available as Markdown.

Search

Search and filter data using keywords, labels, and advanced conditions.

The Search extension helps you quickly find specific words, phrases, or labeled spans in your data. It supports searching within a single document or across an entire project, including label-based search, regex search, and exact word matching. Results are shown in a clear list so you can review and work with large datasets more easily.

Span labeling

In a span labeling project, two types of searches are available: Basic and Advanced.

The Standard search allows you to perform simple searches based on text and labels using keywords or regular expressions (regex). It provides quick access to relevant data by matching the input with the text or labels in the project.

Search by text

Search for specific words or patterns in the project by entering keywords and selecting a word filter.

Word filter

Define how their search keywords are matched to results. The available options are:

  • Contains any word: Matches results that contain any of the specified words.

    • Example: Searching for men will match with men, mentioned, abandonment.

  • Exact word: Displays only exact matches for the search keyword.

    • Example: Searching for men will match men but not mentioned.

  • Regex: Search using regular expressions for advanced pattern matching.

    • Example: Searching for men* will match words starting with men, such as mentioned.

Search by label

Search for specific labels or categories in the data. This search mode always uses the Contains any word filter.

Search results

The search checks each span or label individually based on the search criteria you enter.

In reviewer mode, search results include reviewed labels (accepted and consensus), conflicted labels, and rejected labels.

To make search results easier to review, enable Show only matching lines in the text viewer from the three-dot menu in the top-right corner of the extension. This option hides lines that do not contain matching spans or labels, allowing you to focus only on relevant content.

Advanced search allows you to create more detailed searches by combining multiple conditions. It supports complex queries using MongoDB query syntax.

Configure conditions

There are two ways to configure the search conditions:

  1. Logic builder: A visual interface for creating search conditions without writing queries manually.

  2. Query: Directly input advanced queries for complex conditions.

Configure conditions via logic builder

You can create searches with multiple conditions, where each condition includes a search target, a filter operation, and a keyword. These conditions can be combined using logical operators such as OR or AND to define the relationship between the conditions.

Search target:

  • Text: Matches words or content in the spans.

  • Label: Matches the labels applied to the text.

  • Metadata: Matches information attached to the line (in key-value pair).

  • Comment: Matches words or phrases within comments and their replies.

Filter operation:

  • is: Matches search target that exactly matches the specified keyword.

  • is not: Matches search target that explicitly does not match the specified keyword.

  • contains: Matches search target that contains the specified keyword.

  • does not contain: Matches search target that does not contain the specified keyword

  • matches regex: Matches search target that fits the regular expression pattern.

Keyword:

  • For Text and Label, this is the word or phrase to match.

  • For Metadata, this is the key: value pair used to filter information.

  • For Comment, this is the word or phrase to match within the comment or reply content.

Logical operator:

  • OR: Matches results that meet at least one condition.

  • AND: Matches results that meet all conditions.

Sub-conditions: Additional filters available when the Label or Comment search target is selected, letting you narrow results further.

  • The relationship between a parent condition and its sub-conditions (or sub-condition groups) is always AND.

  • The relationship between sub-conditions, or between sub-condition groups depends on the logical operator (AND/OR) selected, using the same OR/AND logic described above.

Label's sub-conditions are organized into sub-condition groups: User and Attribute.

  • The relationship between the User group and the Attribute group is always AND (not user-selectable).

  • Each group type can only be added once per parent condition. Once one type is added, only the other remains available; once both are added, Add sub-condition group no longer appears.

User — filter by who applied or reviewed the label

This sub-condition group is available only in Reviewer mode.

Filter operations:

  • is applied by / is not applied by: labels applied / not applied by the selected labeler.

  • is reviewed by / is not reviewed by: labels reviewed / not reviewed by the selected reviewer (accepted and rejected). Accepting or rejecting a labeler’s label is considered as “reviewed.”

Attribute — filter by the label's attribute values

Filter operations:

  • is / is not: attribute value exactly matches / does not match the specified keyword.

  • contains / does not contain: attribute value contains / does not contain the specified keyword.

  • matches regex: attribute value matches the specified regex pattern.

Filter operations:

  • is from / is not from: comments made / not made by the selected user.

  • is open / is resolved: comments currently unresolved / marked resolved.

Configure conditions via query

You can set up conditions using MongoDB queries. Datasaur supports a subset of the MongoDB query selectors, which are listed below.

Key Operators

  • $regex — Search for text patterns (combine with $options for behavior like case-insensitivity using $options: "i").

  • $not — Exclude matches.

  • $or — Requires at least one condition to match.

  • $and — Requires all conditions to match.

$or and $and require exactly 2 conditions.

Search conditions

  1. Text condition — Searches for text content.

    • First example: Find text containing is. This will match text like This is used to train data.

    • Second example: Find text not containing is. This will match text like Labeling the data will be done in Datasaur.

  2. Label condition — Filters based on labeled spans.

    • First example: Find spans labeled with a label containing GEO. This will match labels like GEO, Location Geo, and Geospatial Data.

    • Second example: Find spans labeled exactly with GEO. This will match labels like GEO, geo, or any other case variations, but the entire label must be GEO with no additional characters.

    • Third example: Find spans labeled as GEO by the labeler with user ID 1 (Number 1 represents the user ID of the label contributors. These IDs are unique identifiers used to construct the query conditions). See the guide below for how to obtain the user ID.

    • Fourth example: Find spans labeled as GEO that have been reviewed by reviewer with user ID 2 (Number 2 represents the user ID of the label contributors. These IDs are unique identifiers used to construct the query conditions). See the guide below for how to obtain the user ID.

    💡 Guide to determine a contributor's user ID, use the Logic builder:

    • Navigate to the Configure conditions via logic builder section.

    • Add a sub-condition that filters by Labeler or Reviewer.

    • Select the desired user from the dropdown list.

    • Save the conditions. The corresponding user ID will be automatically populated in the generated query.

  3. Metadata condition — Searches for key-value pairs in the metadata attached to each line.

    • Example: Find metadata where the key is category and the value is education.

  4. Logical OR condition — Matches if any of the conditions are true.

    • Example: Find text containing either France or John.

  5. Logical AND condition — Matches only if all conditions are true.

    • Example: Find text containing both France and John.

Search results

The search operates at the line level, meaning it evaluates each line individually against the list of specified conditions.

In the reviewer mode, search results include reviewed labels (accepted and consensus), conflicted labels, and rejected labels.

For conditions with negative operators (is not, does not contain), only the lines that meet the specified conditions will be displayed in the results.

To make search results easier to review, enable Show only matching lines in the text viewer from the three-dot menu in the top-right corner of the extension. This option hides non-matching lines, allowing you to focus only on relevant content.

Filter search results

After running a search, you can narrow down the results by applying filters. This is especially useful when working with large result sets.

You can currently filter search results using the following criteria:

  • Label status — Use this filter to show results based on their review status. Options include:

    • Accepted: The label is accepted by the reviewer or manually applied by the reviewer.

    • Conflicted: The label has unresolved disagreements.

    • Rejected: The label is rejected by the reviewer.

  • Status filters are available only in reviewer mode.

  • The Rejected option appears only when the project setting Show rejected labels in Review Mode is enabled.

  • Label class — Use this filter to show results based on the label applied. Options include:

    • Unlabeled: The text does not have any label assigned.

    • Any label class that appears in the current search results.

Saved search enables storing custom search configurations for reuse. Once saved, the same search can be applied without the need to manually reconfigure the conditions.

Saving a search can be done in both labeler mode and reviewer mode. A search saved in one mode will also be accessible in the other.

Once you have a search configured, open the Search extension menu. You should see an option called Save search configuration.

Clicking this option will open a dialog where you can enter a name and description for the saved search, including a preview of the current search configuration.

There are two ways to access the saved search:

  • Open the extension menu and select Manage saved searches.

  • If advanced search type is selected, open the Configure menu and select Use existing saved search.

Both methods open a dialog displaying all saved searches. Selecting one shows its details on the right, and searches can also be filtered by name using the search bar. Click Use saved search to apply the selected configuration to the current session.

In the Manage saved searches dialog, select the saved search you want to edit or delete.

Edit

While editing a saved search, you cannot navigate to or preview another saved search.

To edit a saved search, click the edit icon. Update the name and/or description, then click Save changes.

Delete

To delete a saved search, click the delete icon. Confirm the action to permanently delete the saved search.

Bulk labeling for span labels

The Label all button lets you quickly apply a label to all matching results in a project.

For example, searching for the text Holmes will show all its instances in the document. Selecting Person from the dropdown and clicking Label all applies the Person label to every occurrence of Holmes.

This feature helps speed up bulk labeling and improves consistency, especially in projects requiring detailed text analysis.

Tips & tricks: To make it easier to navigate through the results, you can use the Up or Down arrow keys to navigate between results easily.

Delete search result labels

The Delete search result labels button removes labels from all matching labeled results in a project.

For example, searching for Shakespeare will display all instances in the document along with any labels applied to the text. Clicking Delete search result labels will remove all labels associated with Shakespeare.

This feature is useful for bulk deletions, making the cleanup process faster and more efficient. It’s especially helpful for projects that involve large datasets, ensuring data accuracy and consistency while saving time.

Bulk answer line questions

  • Only available when line labeling is enabled in a span labeling project.

  • Supported in advanced search only.

The Answer matching lines in line labeling extension option lets you apply the same answer to all matching lines from the search results in a project.

Clicking it will automatically select all matching lines in the editor based on the search results and direct you to the Line labeling extension. You can then modify the answer, and when you click Submit answers, it will be applied to all selected lines.

If an answer for a question is not modified, its existing value will remain unchanged. For example:

Before

If both lines are selected and only the priority question is updated with the answer medium, the results after submission will look like this:

Row labeling

In row labeling projects, the Search extension lets you search table data to quickly find specific information across multiple rows and columns by selecting a search target, word filter, and keyword.

Search target

Specify the focus of the search. The available options are:

  • Text: Matches the words or content in the data column.

  • Label: Matches the words or content in the answer column.

Word filters

Define how their search keywords are matched to results. The available options are:

  • Contains any word: Matches results that contain any of the specified words.

    • Example: Searching for men will match with men, mentioned, abandonment.

  • Exact word: Displays only exact matches for the search keyword.

    • Example: Searching for men will match men but not mentioned.

  • Regex: Search using regular expressions for advanced pattern matching.

    • Example: Searching for men* will match words starting with men, such as mentioned.

Search all files

The Search all files option lets you search across all files within a project. When this option is checked, the search will include results from every file in the project. If the option is unchecked, the search will be limited to the current file only.

This is useful when performing a broad search across all files or focusing on a specific file within the project.

Last updated