Bug 487014 - System search, search is listing one system, should go to system sdc
Summary: System search, search is listing one system, should go to system sdc
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: WebUI
Version: 530
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Partha Aji
QA Contact: Red Hat Satellite QA List
URL: http://grandprix.rhndev.redhat.com/rh...
Whiteboard:
Depends On:
Blocks: sat540-blockers
TreeView+ depends on / blocked
 
Reported: 2009-02-23 17:17 UTC by wes hayutin
Modified: 2018-10-27 12:52 UTC (History)
5 users (show)

Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-26 14:52:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description wes hayutin 2009-02-23 17:17:28 UTC
Description of problem:

small use case here..

System search,  search is listing one system, should go to system sdc

recreate...
1. register the same system 4 times
2. delete three of the profiles
3. system search for system
4. results of system search include one result of system

actual results:
The system is listed, in a list


expected results:
page is redirected to systems sdc page if its the only result

Comment 2 John Matthews 2009-04-15 00:17:53 UTC
Moving this to ON_QA, as I think it's been fixed...or the test case involved a low scoring match in which case it's intentional behavior to display a list of 1 and not redirect to SDC.


Looking through the code I see one possibility that could trigger this behavior.
Assume you register "test.system.redhat.com", then do a search for "te" or "test".  You would get back a result which has a score less than .95, so it will not redirect to the SDC page.  Redirects to SDC are written to only happen when a match is close to ideal, it has to have a score of .95 or greater.

Below is a code snippet showing how it's written.

This will look to see if we only have 1 result, it then checks the score

            List results = (List)request.getAttribute(getDataSetName());
            if ((results != null) && (results.size() == 1)) {
                SystemSearchResult s =  (SystemSearchResult) results.get(0);
                Double score = s.getScore();
                if (score != null) {
                    /** Adding a rule so we only redirect to a specific system id
                     * when we are pretty sure the search result is what the user
                     * expects.  We are using the lucene score for this result to
                     * gauge this.
                     */
                    if (score > 0.95) {
                        try {
                            response.sendRedirect(
                                    "/rhn/systems/details/Overview.do?sid=" +
                                        s.getId().toString());
                            return null;
                        }
                        catch (IOException ioe) {
                            throw new RuntimeException(
                                    "Exception while trying to redirect: " + ioe);
                        }
                    }
                }
            }

Comment 3 wes hayutin 2009-04-17 19:50:10 UTC
not working in 4/14 build

Comment 4 John Matthews 2009-04-27 18:20:12 UTC
The issue is on the search-server side. 

The problem is that the systems while deleted from the DB are not being removed from the search server index.  This reduces the score returned, since the hit is not unique, it's score drops.  I'm looking into why the index isn't clearing up the deleted systems.

Comment 5 John Matthews 2009-05-29 19:19:45 UTC
I think I was wrong with comment #4 being the cause, this appears to be fine if I wait long enough for the indexing task to kick off.

The problem Wes is mentioning may have been a simpler problem of the query not matching that well, so the score was low.  We originally had a check that the score needed to be over .95 to redirect to SDC.  Now I've lowered it to .50 to allow a redirect for more matches of a single term.  



vader branch:  
 java/code/src/com/redhat/rhn/frontend/action/systems/SystemSearchSetupAction.java        |    4 +++-
 search-server/src/java/com/redhat/satellite/search/scheduler/tasks/GenericIndexTask.java |    2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 143000384eb4509922777146f282fb512aa98958
Author: John Matthews <jmatthew>
Date:   Fri May 29 15:06:08 2009 -0400

Comment 6 wes hayutin 2009-06-08 18:29:31 UTC
hrm.. not sure if this landed in 6/5
fails

Comment 7 John Matthews 2009-06-09 18:21:18 UTC
I think the problems happening with this bug were related to low scores.  I spoke with Wes and we decided to remove the score requirement which was causing 1 result to display in a list instead of being redirected when it had a low score.

Below commit removes the score requirement, now any system search result of only 1 item will redirect to the SDC page for that system id.


commit a1f466e8b345e4dc6bd7fccb3feded486bee6faa
Refs: vader, <origin/VADER>, rhn-custom-info-5.3.0-1-23-ga1f466e
Author:     John Matthews <jmatthew>
AuthorDate: Tue Jun 9 14:10:36 2009 -0400
Commit:     John Matthews <jmatthew>
CommitDate: Tue Jun 9 14:14:01 2009 -0400

    487014 - SystemSearch remove score requirement to redirect to SDC on 1 result
    Additionally lowered default config value for system search score threshold
---
 .../action/systems/SystemSearchSetupAction.java    |   31 ++++++-------------
 search-server/src/config/search/rhn_search.conf    |    2 +-
 2 files changed, 11 insertions(+), 22 deletions(-)

Comment 8 wes hayutin 2009-06-15 18:16:33 UTC
verified 6/12

Comment 9 Jan Pazdziora 2009-09-04 12:28:30 UTC
Stage verified with Satellite-5.3.0-RHEL5-re20090820.1 using the test plan from comment 0. Installed system four times with the same name. Searched, four four records in the result list. Deleted three systems, confirmed. Searched, found one and was placed directly to /rhn/systems/details/Overview.do. Moving to RELEASE_PENDING.

Comment 10 Brandon Perkins 2009-09-10 19:32:02 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html


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