InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

[FR] Searching for PN with only alphanumeric characters

Open LastEdit opened this issue 1 year ago • 4 comments

Please verify that this feature request has NOT been suggested before.

  • [X] I checked and didn't find a similar feature request

Problem statement

Allow searching PNs (IPN,Mfg,Supplier) with only alphanumeric characters, ignoring things like - / \ _ " " , etc.

This would allow for a simpler user interface when typing in PNs that have those characters or when supplier/mfg PNs don't have consistent use of those symbols.

Suggested solution

Specifically for PNs, add additional db columns with stripped PNs and search against new columns. Have search remove characters before making query.

Describe alternatives you've considered

Search against the original database and automatically place regex between all characters in PN query so unknown to user. Such as [^a-zA-Z0-9_]*, but potential database performance hit.

Examples of other systems

No response

Do you want to develop this?

  • [ ] I want to develop this.

LastEdit avatar May 10 '24 17:05 LastEdit

@LastEdit regex search is already an available option:

image

And there's a drop-down option in the new interface:

image

SchrodingersGat avatar May 11 '24 02:05 SchrodingersGat

@SchrodingersGat Doesn't regex search require the user to input the expression manually into the search bar? I was looking for a more behind the scenes ability to ignore the specific characters during search.

LastEdit avatar May 14 '24 22:05 LastEdit

I do not want to make the regex search support any more complex than it already is - if you want to use regex, which is already supported, then go for it! But I think any further complications will make the experience more difficult for everyone.

SchrodingersGat avatar May 14 '24 22:05 SchrodingersGat

I am with @SchrodingersGat on this one - making the regex search more complex ought to introduce bugs again. Additionally, regex opens up a whole class of security headaches against which the current implementation was tested but new stuff would have to be checked again.

matmair avatar May 14 '24 22:05 matmair

This issue seems stale. Please react to show this is still important.

github-actions[bot] avatar Jul 14 '24 11:07 github-actions[bot]