summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/QueryTree.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/QueryTree.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/QueryTree.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/QueryTree.java b/container-search/src/main/java/com/yahoo/search/query/QueryTree.java
index 0655727b46b..6326097d9bd 100644
--- a/container-search/src/main/java/com/yahoo/search/query/QueryTree.java
+++ b/container-search/src/main/java/com/yahoo/search/query/QueryTree.java
@@ -110,6 +110,19 @@ public class QueryTree extends CompositeItem {
// -------------- Facade
/**
+ * Modifies this query to become the current query RANK with the given item.
+ *
+ * @return the resulting root item in this
+ */
+ public Item withRank(Item item) {
+ var result = new RankItem();
+ result.addItem(getRoot());
+ result.addItem(item);
+ setRoot(result);
+ return result;
+ }
+
+ /**
* Modifies this query to become the current query AND the given item.
*
* @return the resulting root item in this