Project

General

Profile

Actions

Feature #38446

open

Searching multiple multi-word phrases

Added by Go MAEDA about 1 year ago. Updated 1 day ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Search engine
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Currently, the search engine does not support multiple multi-word phrases.

For example, we cannot search objects that contain two phrases "closed issue" and "closed version". If you give a search string "closed issue" "closed version", the search engine search for objects containing three strings "closed issue", "closed", and "version". This is due to the behavior of Redmine::Search::Tokenizer#tokens.

Redmine::Search::Tokenizer.new(%q|"closed issue" "closed version"|).tokens
=> ["closed issue", "closed", "version"]

If the Tokenizer returns two tokens, "closed issue" and "closed version" for the same input, it will be possible to search for multiple multi-word phrases.


Files

38446.patch (1.51 KB) 38446.patch Go MAEDA, 2024-04-29 04:28
38446-v2.patch (1.53 KB) 38446-v2.patch Go MAEDA, 2024-04-30 10:14
Actions #1

Updated by Go MAEDA about 2 months ago

I am submitting a patch for this issue, which enhances the tokenizer's ability to handle multiple quoted phrases.

Actions #2

Updated by Go MAEDA about 1 month ago

Updated the patch.

  • In the regular expressions, changed [:space:] to \p{Zs} which does not match with TAB, CR, and LF
  • Improved the regular expression for gsub.
Actions #3

Updated by Go MAEDA 1 day ago

  • Target version set to Candidate for next major release
Actions

Also available in: Atom PDF