diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-03-25 15:59:16 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-03-25 15:59:16 +0100 |
commit | 1c6179905dab3b3c4450fb519f256435c623ef28 (patch) | |
tree | da30ae606d3aebb879da7a8462f71cab922498a2 /container-search | |
parent | f55219e07ca351cdcdf25a199cf2fce0449fd7c8 (diff) |
No functional changes
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/Query.java | 22 | ||||
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/result/HitGroup.java | 2 |
2 files changed, 11 insertions, 13 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/Query.java b/container-search/src/main/java/com/yahoo/search/Query.java index 553c73dac17..fbbe665db7f 100644 --- a/container-search/src/main/java/com/yahoo/search/Query.java +++ b/container-search/src/main/java/com/yahoo/search/Query.java @@ -56,6 +56,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.logging.Level; @@ -682,21 +683,18 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { /** Returns a string describing this query in more detail */ public String toDetailString() { - String queryTree; - // getQueryTree isn't exception safe - try { - queryTree = model.getQueryTree().toString(); - } catch (Exception | StackOverflowError e) { - queryTree = "Could not parse user input: " + model.getQueryString(); - } - return "query=[" + queryTree + "]" + " offset=" + getOffset() + " hits=" + getHits() + "]"; + return "query=[" + new TextualQueryRepresentation(getModel().getQueryTree().getRoot()) + "]" + + " offset=" + getOffset() + " hits=" + getHits() + + " sources=" + getModel().getSources() + + " restrict= " + getModel().getRestrict() + + " rank profile=" + getRanking().getProfile(); } /** - * Encodes this query onto the given buffer + * Encodes this query tree into the given buffer * - * @param buffer The buffer to encode the query to - * @return the number of encoded items + * @param buffer the buffer to encode the query to + * @return the number of encoded query tree items */ public int encode(ByteBuffer buffer) { return model.getQueryTree().encode(buffer); @@ -964,7 +962,7 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { /** Returns a hash of this query based on (some of) its content. */ @Override public int hashCode() { - return ranking.hashCode()+3*presentation.hashCode()+5* model.hashCode()+ 11*offset+ 13*hits; + return Objects.hash(ranking, presentation, model, offset, hits); } /** Returns whether the given query is equal to this */ 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 efe25e04f2e..7096d937959 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 @@ -621,7 +621,7 @@ public class HitGroup extends Hit implements DataList<Hit>, Cloneable, Iterable< } /** - * <p>Sets the hit orderer for this group.</p> + * Sets the hit orderer for this group. * * @param hitOrderer the new hit orderer, or null to use default relevancy ordering */ |