Project

General

Profile

Feature #11150

Allow searching of facts as types other than string

Added by Imri Zvik about 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Search
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

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.


Related issues

Related to Foreman - Bug #11282: search on numeric facts is broken if using "~".Closed2015-08-04
Related to Foreman - Bug #12194: Can't search for multiple facts in foreman 1.10.0-RC1Closed2015-10-16
Related to Foreman - Bug #12458: Facts search vulnerable to SQL injectionClosed2015-11-12
Related to Foreman - Bug #12959: Host search based on fact value using LIKE clause does'nt workClosed2015-12-30
Related to Foreman - Bug #13035: Host fact search using ~ operator doesn't automatically add wildcardsDuplicate2016-01-07
Related to Foreman - Bug #13838: Searching for hosts by facts does not return all hostsRejected2016-02-22

Associated revisions

Revision 3f8e6c33 (diff)
Added by Imri Zvik about 4 years ago

Fixes #11150 - Allow searching of facts as types other than string

History

#1 Updated by The Foreman Bot about 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2554 added
  • Pull request deleted ()

#2 Updated by Dominic Cleal about 4 years ago

  • Category set to Search
  • Assignee set to Imri Zvik
  • Legacy Backlogs Release (now unused) set to 63

#3 Updated by Imri Zvik about 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal about 4 years ago

  • Related to Bug #11282: search on numeric facts is broken if using "~". added

#5 Updated by Dominic Cleal almost 4 years ago

  • Related to Bug #12194: Can't search for multiple facts in foreman 1.10.0-RC1 added

#6 Updated by Dominic Cleal almost 4 years ago

  • Related to Bug #12458: Facts search vulnerable to SQL injection added

#7 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #12547: Search raises PGError on feeding a non-integer value for a integer field added

#8 Updated by Dominic Cleal over 3 years ago

  • Related to deleted (Bug #12547: Search raises PGError on feeding a non-integer value for a integer field)

#9 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #12959: Host search based on fact value using LIKE clause does'nt work added

#10 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #13035: Host fact search using ~ operator doesn't automatically add wildcards added

#11 Updated by Timo Goebel over 3 years ago

  • Related to Bug #13838: Searching for hosts by facts does not return all hosts added

Also available in: Atom PDF