Project

General

Profile

Actions

Feature #44464

open

Show a warning when a text filter value contains more than 5 search terms

Added by Go MAEDA about 5 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues filter
Resolution:

Description

Text filters with operators that accept multiple search terms, such as "contains", "contains any of" and "starts with", use at most 5 terms. If a user enters more, the remaining terms are silently ignored, so the user cannot tell that the results are based on only a part of the input.

The limit itself, which comes from Redmine::Search::Tokenizer, is reasonable because it prevents expensive database queries. The attached patch therefore keeps the limit and instead displays a warning above the results when some terms are ignored. The warning lists the terms that were actually used:

In this example, the warning shows that "ingredients" is not among the terms used, which explains why the issue "Add ingredients categories" is not listed. Without the patch, the results are the same, but no warning is displayed.

The patch adds Tokenizer#truncated? and Query#filter_warnings, and displays the warnings on every page that uses filters, such as the issue list, the Gantt chart and the calendar.

I also considered the following alternatives:

  • Placeholder: The input field is only 30 characters wide (size="30"), so a translated message may not fit. In addition, a placeholder is not visible once the field contains a value, for example when a saved query is opened.
  • Validation error: Existing saved queries with more than 5 terms currently return results, but they would show an error instead.

There is a related patch, #43701, which proposes to make the limit configurable. Since this patch takes a different approach, I am submitting it as a separate issue.


Files


Related issues

Related to Redmine - Patch #43701: Redmine::Search::Tokenizer limited to 5 => problem for "contains any of", "starts with" and "ends with" filter operatorsNewActions
Actions #1

Updated by Go MAEDA about 5 hours ago

  • Related to Patch #43701: Redmine::Search::Tokenizer limited to 5 => problem for "contains any of", "starts with" and "ends with" filter operators added
Actions

Also available in: Atom PDF