Allow searching of facts as types other than string
Today, all the facts are stored as strings, and therefore integer comparison doesn't work on them.
There should be a way to handle different types (integer, floats etc).
In order to avoid hard coding either in the database or the code, I was thinking about using ext_method in app/models/concerns/hostext/search.rb which will either guess the type from the value, or use a setting and will then use CAST to perform the right comparison.
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2554 added
- Pull request deleted (
- Category set to Search
- Assignee set to Imri Zvik
- translation missing: en.field_release set to 63
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Related to Bug #11282: search on numeric facts is broken if using "~". added
- Related to Bug #12194: Can't search for multiple facts in foreman 1.10.0-RC1 added
- Related to Bug #12458: Facts search vulnerable to SQL injection added
- Related to Bug #12547: Search raises PGError on feeding a non-integer value for a integer field added
- Related to deleted (Bug #12547: Search raises PGError on feeding a non-integer value for a integer field)
- Related to Bug #12959: Host search based on fact value using LIKE clause does'nt work added
- Related to Bug #13035: Host fact search using ~ operator doesn't automatically add wildcards added
- Related to Bug #13838: Searching for hosts by facts does not return all hosts added
Also available in: Atom