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
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); } } } }
not working in 4/14 build
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.
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
hrm.. not sure if this landed in 6/5 fails
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(-)
verified 6/12
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.
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