Make numeric custom fields searchable
We're a little surprised the numeric custom fields aren't searchable. Is this an intentional limitation, and if so why, or is it just not implemented? Thanks!
#1 Updated by Mischa The Evil almost 6 years ago
It is explicit design, see #13385. Only
ListFormat classes are searchable by default (see source:/trunk/lib/redmine/field_format.rb@13994#L60 and further).
#2 Updated by Felix Schäfer almost 6 years ago
Mischa The Evil wrote:
ListFormatclasses are searchable by default (see source:/trunk/lib/redmine/field_format.rb@13994#L60 and further).
I do understand the code and that the code prevents me/our client of setting the custom field as searchable, but neither the code nor what I could find of the history of the code explained why it was decided to not make them sortable.
It is explicit design, see #13385.
At the very end in #13385#note-13, JP explains that:
Integers, floats and bools are not searchable because it doesn't make much sense to search these values for those that contain a certain string. A better option is to use filters on the issue list for these fields.
I can understand not wanting to search numeric fields for strings, but that optimisation should not be done by disabling the search altogether for those fields, but by not searching on those fields if there is no numeric-only token in the search.
Mischa, thanks for the link, this helped me a lot and I can now forward those findings!
#4 Updated by Felix Schäfer almost 6 years ago
Jean-Philippe Lang wrote:
I though there was no use case for searching for numbers that contain a number (eg. searching for 16 would return values like 161, 516...). Do you have an example where it would make sense?
I'm waiting for feedback from our customer on that :-)
Thanks for chiming in!
#6 Updated by Joel Bearden over 4 years ago
I have a use case. For our feature/defect tracking system, we use a unique integer key to align a ticket with a feature request for internal purposes. Using the Redmine API, we auto-create issues and need to leverage the "integer key" as a primary key. Without being able to search for this integer key, this workflow is not possible.