private Item filterItems(Item root) {
        while (tokens.hasNext()) {
            Item item = positiveItem();
            root = addAndFilter(root, item);
            if (item == null) {
                item = negativeItem();
                root = addNotFilter(root, item);
            }
            if (item == null) {
                item = indexableItem("").getFirst();
                root = addRankFilter(root, item);
            }

            if (item != null) {
                markAllTermsAsFilters(item);
            } else {
                tokens.skip();
            }
        }
        return root;
    }
Returns the top level item resulting from combining the given top
level item and the new item. This implements most of the weird transformation
rules of the parser.
container-search/src/main/java/com/yahoo/prelude/query/parser/AnyParser.java