Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2090799

Summary: User is unable to use multiple LIKE keywords in the Settings entities search
Product: Red Hat Satellite Reporter: Ondrej Gajdusek <ogajduse>
Component: SearchAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Jaroslav Henner <jhenner>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: afeferku, apatel, aruzicka, kgaikwad, mhulan
Target Milestone: UnspecifiedKeywords: Regression
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-31 11:48:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ondrej Gajdusek 2022-05-26 14:53:33 UTC
Description of problem:
The following search query works for Organizations:
`name ~ Default and name ~ gan`.

However, when I tried to search in Settings using the same query, I got:

Search error ERF42-9046 [Foreman::Exception]: Unsupported search operators :and / :or


Version-Release number of selected component (if applicable):
Satellite 6.11 snap 21
foreman-3.1.1.20-1.el8sat.noarch
rubygem-scoped_search-4.1.9-2.el8sat.src.rpm

How reproducible:
always


Steps to Reproduce:
1. hammer settings list --search 'name ~ Default and name ~ gan'
or any other search query that contains a logical operator.

Actual results:
ERF42-9046 [Foreman::Exception]: Unsupported search operators :and / :or

Expected results:
No exception thrown. Search accepts the logical operator in the same way it does for Organization. Empty or non-empty list of settings being returned - depending on the search query.

Additional info:

Comment 1 Ondrej Gajdusek 2022-05-26 15:06:30 UTC
It is a regression from Satellite 6.10.6

I am able to list the default_organization setting on Satellite 6.10.6:

hammer settings list --search 'name ~ Default and name ~ gan'
---------------------|----------------------|----------------------|---------------------------------------------------------------------------------
NAME                 | FULL NAME            | VALUE                | DESCRIPTION                                                                     
---------------------|----------------------|----------------------|---------------------------------------------------------------------------------
default_organization | Default organization | Default Organization | Hosts created after a puppet run that did not send a organization fact will b...
---------------------|----------------------|----------------------|---------------------------------------------------------------------------------

Comment 2 Ondrej Gajdusek 2022-05-26 15:08:57 UTC
Package versions used on Sat 6.10.6:

# rpm -q foreman tfm-rubygem-scoped_search
foreman-2.5.2.21-1.el7sat.noarch
tfm-rubygem-scoped_search-4.1.9-2.el7sat.noarch

Comment 3 Adam Ruzicka 2022-05-31 11:48:46 UTC
This seems to be describing a subset of issues described in #2058660, closing as a duplicate. If you feel this BZ describes something that is not covered in the other one, feel free to reopen.

*** This bug has been marked as a duplicate of bug 2058660 ***