Project

General

Profile

Actions

Bug #25897

closed

Using search query for listing content hosts produces unexpected output

Added by Moti Asayag about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

While trying to use the search query with 'or' option to list two content hosts with FQDN, the result is long duplicated list of host entries.

The search query is: facts.network::hostname = "host_1" or facts.network::hostname = "host_2"
The result of each part of the search is as follow:
facts.network::hostname = "host_1" - returns only one record
facts.network::hostname = "host_2" - returns no record (no matches)

The combined query produces a duplicated list of 20 records of host_1.

curl -k -u admin:123456 "https://katello.example.com/api/v2/hosts?search=facts.network::hostname=host_1.example.com%20or%20facts.network::hostname=host_2.example.com&format=json" {
"total": 3,
"subtotal": 20,
"page": 1,
"per_page": 20,
"search": "facts.network::hostname=host_1.example.com or facts.network::hostname=host_2.example.com",
"sort": {
"by": null,
"order": null
},
"results": [{...}]
}

Actions

Also available in: Atom PDF