Description of problem:
AND and OR operation is not working on satellite as expected, when trying to filtering host with single filter like “facts.bios_vendor = SeaBIOS” it works fine, but when your try to filter using AND and OR operator its not working as expected, when filtering using AND it gives zero result “facts.bios_vendor = SeaBIOS and facts.architecture = x86_64”, when trying to filter using OR result is unstable as it gives around 1700 number of results even through there is only 10 machines registered with satellite.
- Under Satellite UI - > Hosts → All Hosts → in search tab
- Try to filter host using any fact ex. “facts.bios_vendor = SeaBIOS”
- Also try to filter using any other fact ex. “facts.architecture = x86_64”
- Now combine search filter using AND and OR operator like below and check the result.
Ex. “facts.bios_vendor = SeaBIOS and facts.architecture = x86_64”
Ex. “facts.bios_vendor = SeaBIOS or facts.architecture = x86_64”
- Observe there is no result when using AND operator
- Observe there is N number of results when using OR operator which is regardless of number of registered clients.
- Should be able to search hosts using AND and OR
Also tried to search using the query structure given on the link “https://github.com/wvanbergen/scoped_search/wiki/Query-language” but still result is not as expected.
This works fine with 6.3, moving to ON_QA. Note that the variant with or does not make sense. That would find also hosts that have only bios vendor SeaBIOS and also different hosts which has architecture x86_64. So you could end up with SeaBIOS hosts with i386 arch.
The correct syntax is
> “facts.bios_vendor = SeaBIOS and facts.architecture = x86_64”
I could not find exact upstream fix but it might have changed by the scoped_search update.
Created redmine issue http://projects.theforeman.org/issues/21625 from this bug
Upstream bug assigned to firstname.lastname@example.org
*** Bug 1560180 has been marked as a duplicate of this bug. ***
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you.
Connecting redmine issue https://projects.theforeman.org/issues/25897 from this bug
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25897 has been resolved.
Created attachment 1635451 [details]
*** Satellite 6.5.3 Patch ***
This bug will be resolved in 6.6 but if users wish to patch their 6.5 Satellite feel free to apply the attached patch.
1) Download BZ1511254.patch to your Satellite 6.5 Satellite
2) Copy to /usr/share/foreman/BZ1511254.patch
3) cd /usr/share/foreman
# patch -p1 < BZ1511254.patch
patching file app/models/concerns/hostext/search.rb
satellite-maintain service restart
Created attachment 1640632 [details]
Both 'OR' and 'AND' operators are working
Verified this on Satellite 6.7 with Snap 3. Both logical operators are working as expected
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.