diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-09-11 12:46:46 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-09-11 12:46:46 +0200 |
commit | 669982d5892e9835596c9b9fcbe6a93cbecda7ea (patch) | |
tree | 8170b907d47efa669e95b4880252d3f4f59c2e06 /container-search/src/main/java/com/yahoo/search/result | |
parent | cb8cbd3f6a2308060ce5ebcaa4a2cbf379ef8019 (diff) |
Nonfunctional changes only
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/result')
3 files changed, 19 insertions, 15 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/result/ErrorHit.java b/container-search/src/main/java/com/yahoo/search/result/ErrorHit.java index 31a788bd78a..802af478fa2 100644 --- a/container-search/src/main/java/com/yahoo/search/result/ErrorHit.java +++ b/container-search/src/main/java/com/yahoo/search/result/ErrorHit.java @@ -14,8 +14,13 @@ public interface ErrorHit extends Cloneable { void setSource(String source); - /** Returns the main error of this result, never null */ - @Deprecated // use: errors().iterator().next() + /** + * Returns the main error of this result, never null + * + * @deprecated use errors().iterator().next() + */ + // TODO: Remove on Vespa 7 + @Deprecated ErrorMessage getMainError(); /** @@ -38,8 +43,7 @@ public interface ErrorHit extends Cloneable { /** Returns true - this is a meta hit containing information on other hits */ boolean isMeta(); - /** Returns true if main error is the given error code or if main error - is general error 8 and all suberrors are the given error code */ + /** Returns true if all errors in this has the given error code */ boolean hasOnlyErrorCode(int code); Object clone(); diff --git a/container-search/src/main/java/com/yahoo/search/result/HitGroup.java b/container-search/src/main/java/com/yahoo/search/result/HitGroup.java index 2e51f59ba5d..68555709732 100644 --- a/container-search/src/main/java/com/yahoo/search/result/HitGroup.java +++ b/container-search/src/main/java/com/yahoo/search/result/HitGroup.java @@ -376,12 +376,15 @@ public class HitGroup extends Hit implements DataList<Hit>, Cloneable, Iterable< return hit; } - /** Sets the main error of this result. Prefer addError to add some error information. */ + /** + * Sets the main error of this result + * + * @deprecated prefer addError to add some error information. + */ + // TODO: Remove on Vespa 7 + @Deprecated public void setError(ErrorMessage error) { - if (errorHit == null) - add((Hit)createErrorHit(error)); - else - errorHit.addError(error); + addError(error); } /** Adds an error to this result */ @@ -392,15 +395,12 @@ public class HitGroup extends Hit implements DataList<Hit>, Cloneable, Iterable< errorHit.addError(error); } - /** - * Returns the error hit containing all error information, - * or null if no error has occurred - */ + /** Returns the error hit containing all error information, or null if no error has occurred */ public ErrorHit getErrorHit() { getError(); // Make sure the error hit is updated return errorHit; } - + /** * Returns the first error in this result, * or null if no searcher has produced an error AND the query doesn't contain an error diff --git a/container-search/src/main/java/com/yahoo/search/result/HitGroupsLastComparator.java b/container-search/src/main/java/com/yahoo/search/result/HitGroupsLastComparator.java index eca72bef167..1fd2c52d1bd 100644 --- a/container-search/src/main/java/com/yahoo/search/result/HitGroupsLastComparator.java +++ b/container-search/src/main/java/com/yahoo/search/result/HitGroupsLastComparator.java @@ -6,7 +6,7 @@ import java.util.Comparator; /** * Ensures that HitGroups are placed last in the result. * - * @author tonytv + * @author Tony Vaagenes */ public class HitGroupsLastComparator extends ChainableComparator { |