Feature #19093

Make numeric custom fields searchable

Added by Felix Schäfer almost 6 years ago. Updated about 3 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Custom fields
Target version:-
Resolution:

Description

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!


Related issues

Duplicated by Redmine - Feature #19475: Allow custom field (Integer) to be searchable Closed

History

#1 Updated by Mischa The Evil almost 6 years ago

Hi Felix,

It is explicit design, see #13385. Only StringFormat, TextFormat and 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

Hi Mischa,

Mischa The Evil wrote:

Only StringFormat, TextFormat and ListFormat classes 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.

However:

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!

#3 Updated by Jean-Philippe Lang almost 6 years ago

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?

#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!

#5 Updated by Go MAEDA over 5 years ago

  • Duplicated by Feature #19475: Allow custom field (Integer) to be searchable added

#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.

#7 Updated by Florian Nicolet over 3 years ago

I use an integer custom field for an id in an other system.
So it would be nice if integer field will be searchable.
thanks in advance

#8 Updated by Christopher Maximov about 3 years ago

Same like the others. We are using integer custom field as a additional ticket number which is customer facing as opposed to redmine issue-id which is used only internally. Ability to make this searchable would be of great benefit.

Also available in: Atom PDF