Project

General

Profile

Actions

Bug #1245

closed

API bug with search a dot in front of domain when pulling a host list returns the full hostlist of all hosts rather than matching the domain string

Added by Brian Gupta over 12 years ago. Updated over 12 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Category:
Search
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

The following query works and returns list of hosts in domain.com:
https://foreman.domain.com/hosts?search=domain.com"

but the slightly modified query below return a list of all hosts in the system (just a leading dot):
https://foreman.domain.com/hosts?search=.domain.com"


Related issues 1 (0 open1 closed)

Related to Hammer CLI - Feature #945: foreman CLIClosedBrian Gupta05/26/2011Actions
Actions #1

Updated by Ohad Levy over 12 years ago

  • Category changed from API to Search
  • Status changed from New to Feedback

Brian Gupta wrote:

The following query works and returns list of hosts in domain.com:
https://foreman.domain.com/hosts?search=domain.com"

but the slightly modified query below return a list of all hosts in the system (just a leading dot):
https://foreman.domain.com/hosts?search=.domain.com"

shouldnt it be search="domain = domain.com"?

there was a fix for leading dot handling here https://github.com/wvanbergen/scoped_search/commit/cef7f39fc49666de80c0a64f674f02ff2e9e36c4, not sure with which version are you using

Actions #2

Updated by Brian Gupta over 12 years ago

Will try updating and report back.

Actions #3

Updated by Brian Gupta over 12 years ago

Upgraded tonight and the issue is still there.

Actions #4

Updated by Ohad Levy over 12 years ago

  • Target version deleted (0.4)

not sure that I follow, but i can you confirm the search syntax? (e.g. your original query might be wrong).

Actions #5

Updated by Brian Gupta over 12 years ago

A little background: Since the search API isn't super well documented, while working on Foremancli, I just used trial and error and found that host/search?domain.com does return a list of hosts in domain.com. Don't know if this is a bug, but from a foremancli point of view being able to type the following is a win:

foremancli --host domain.com

How does the API handle non-paramaterized query strings that don't have an equals sign?

Thanks,
Brian

Actions #6

Updated by Brian Gupta over 12 years ago

Some more further notes: From my observation, at least for hosts, it appears to be a simple pattern match (with some caveats like the leading dot issue) against FQDN. Not sure what it is supposed to be doing. -Brian

Actions #7

Updated by Ohad Levy over 12 years ago

it does a full text search on all fields which are enabled for full text search.... :(

Actions

Also available in: Atom PDF