Bug 1115315 - Products filter/search doesn't seem to search for Red Hat repositories
Summary: Products filter/search doesn't seem to search for Red Hat repositories
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Repositories
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: jcallaha
Depends On:
Blocks: sat61-release-notes
TreeView+ depends on / blocked
Reported: 2014-07-02 08:09 UTC by Jan Hutař
Modified: 2019-04-01 20:27 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-07-27 11:09:06 UTC

Attachments (Terms of Use)

Description Jan Hutař 2014-07-02 08:09:21 UTC
Description of problem:
Products filter/search doesn't seem to search for Red Hat repositories

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a custom product "RHEL" and repository in it
2. Sync Red Hat repo "Red Hat Enterprise Linux Server"
3. Try to search custom product:
   Content -> Products -> search: "RHEL"
4. Try to search Red Hat product:
   Content -> Products -> search: "Red Hat Enterprise Linux Server"

Actual results:
In step 3. "RHEL" product is correctly filtered.
In step 4. "Red Hat Enterprise Linux Server" product is not shown.

Expected results:
In both cases given products should be shown

Additional info:
Processing by Katello::Api::V2::ProductsController#index as JSON
  Parameters: {"enabled"=>"true", "organization_id"=>"1", "page"=>"1", "paged"=>"true", "search"=>"Red Hat Enterprise Linux Server", "sort_by"=>"name", "sort_order"=>"ASC", "api_version"=>"v2"}
  Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/views/katello/api/v2/products/index.json.rabl within katello/api/v2/layouts/collection (3.1ms)
Completed 200 OK in 38ms (Views: 4.7ms | ActiveRecord: 1.8ms)

Comment 1 Jan Hutař 2014-07-02 08:11:00 UTC
Also reported possibly related bug 1115316

Comment 3 David Davis 2014-08-03 20:59:13 UTC
Definitely a bug. I think it's because of the spaces in the search string.

Comment 4 David Davis 2014-08-06 16:29:39 UTC
So it looks like we're using a keyword tokenizer where the data is being treated as one value but the search string is broken up by whitespace. You can get around this by using double quotes (ie "Red Hat Enterprise Linux Server") or a slash (eg Red\ Hat\ Enterprise\ Linux\ Server). You can even be more specific with fields as well (ie name:"Red Hat Enterprise Linux Server").

It would require some work but we could change all our fields so they would tokenize the input and search on the different tokens (ie use the standard tokenizer instead of the keyword tokenizer). However, this would also require reworking the CLI to use a separate field as the UI and CLI are using the same search.

I think this time is probably better spent towards:


Comment 5 Mike McCune 2014-08-06 16:46:34 UTC

In order to search product names in the Content Search user interface the user must either double-quote the name of the product:

 "Red Hat Enterprise Linux Server"

or escape the spaces:

 Red\ Hat\ Enterprise\ Linux\ Server

Comment 6 Jan Hutař 2014-08-11 09:00:46 UTC
(In reply to David Davis from comment #4)
> I think this time is probably better spent towards:
> https://bugzilla.redhat.com/show_bug.cgi?id=1122972

Yep, I would not object to close this as a duplicate of this bug in case this use case is brought to it for QE to verify once that is fixed. On the other hand in comment #5 there is a useful release note now so closing this bug is probably not a good idea.

Comment 8 Athene Chan 2015-05-05 05:08:10 UTC
davido, adding you to this bug as it should be included in the release notes.

Comment 10 Brad Buckingham 2016-04-28 19:56:54 UTC
In Satellite 6.2, enhancements were made to replace the existing 'elasticsearch' (which utilized lucene search syntax) support with 'scoped_search'.  With this change, searching for either of the strings below will return the expected result:

Red Hat Enterprise Linux Server

Moving to ON_QA for verification.

Comment 11 jcallaha 2016-05-23 13:21:49 UTC
Verified in Satellite 6.2 Beta Snap 12. As mentioned in Comment #10, we no longer have to surround a name that includes white space with quotes. All of the searches below worked correctly.

Red Hat
Hat Enterprise
Enterprise Linux
Red Server

Comment 12 Bryan Kearney 2016-07-27 11:09:06 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.