Multiple search terms in the "contains" operator of text filters
|Assignee:||Marius BALTEANU||% Done:|
The alternative I am experimenting with right now is breaking up the user's query string into tokens like the global search does, and use these to build a query with multiple LIKE clauses that are combined with AND. I'm attaching a preliminary patch that implements this for the Issue.like scope (used by the autocompleter) and the Query#sql_contains method (which should cover all query filters). Do you think that's a viable approach?
It seems that the patch has already been deployed to the production environment of Planio. See Planio filters just got more powerful - Planio Support (english) - Planio Support
- the "contains" operator of text filters
- in issue autocomplete
Patch by Jens Krämer.
#4 Updated by Marius BALTEANU 4 months ago
- Resolution set to Fixed
Patch committed with tests, thanks for this nice improvement.
The patch introduces the following offense:
Lint/IneffectiveAccessModifier: private (on line 1074) does not make singleton methods private. Use private_class_method or private inside a class << self block instead. def self.tokenized_like_conditions(db_field, value, **options)