Skip to content

Commit

Permalink
fix errata search
Browse files Browse the repository at this point in the history
  • Loading branch information
mcalmer committed Nov 19, 2023
1 parent f441b08 commit 02e3d79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ else if (e.getErrorCode() == 200) {
escapedSearchString));
}
else {
LOG.error("Search failed: ", e);
errors.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("packages.search.could_not_execute_query",
escapedSearchString));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ private List<Result> processHits(String indexName, Hits hits, Set<Term> queryTer
else if (indexName.compareTo(BuilderFactory.HARDWARE_DEVICE_TYPE) == 0) {
pr = new HardwareDeviceResult(x, hits.score(x), doc);
}
else if (indexName.compareTo(BuilderFactory.SNAPSHOT_TAG_TYPE) == 0) {
else if (indexName.compareTo(BuilderFactory.SNAPSHOT_TAG_TYPE) == 0) {
pr = new SnapshotTagResult(x, hits.score(x), doc);
}
else if (indexName.compareTo(BuilderFactory.SERVER_CUSTOM_INFO_TYPE) == 0) {
Expand All @@ -463,13 +463,20 @@ else if (indexName.compareTo(BuilderFactory.XCCDF_IDENT_TYPE) == 0) {
doc.getField("identifier").stringValue(),
hits.score(x));
}
else {
else if (indexName.compareTo(BuilderFactory.SERVER_TYPE) == 0) {
pr = new Result(x,
doc.getField("id").stringValue(),
doc.getField("name").stringValue(),
hits.score(x),
doc.getField("uuid").stringValue());
}
else {
//Type Errata and Package
pr = new Result(x,
doc.getField("id").stringValue(),
doc.getField("name").stringValue(),
hits.score(x));
}
if (log.isDebugEnabled()) {
log.debug("Hit[" + x + "] Score = " + hits.score(x) + ", Result = " + pr);
}
Expand Down

0 comments on commit 02e3d79

Please sign in to comment.