private static boolean isRanked(Item item) {
        if (item instanceof CompositeItem) {
            for (Item child : ((CompositeItem)item).items())
                if (isRanked(child)) return true;
            return false;
        }
        else if (item instanceof HasIndexItem && Hit.SDDOCNAME_FIELD.equals(((HasIndexItem)item).getIndexName())) {
            return false; // No point in ranking by sddocname
        }
        else {
            return item.isRanked();
        }
    }
Replaces and {@link SimpleIndexedItem} searching in the {@link Hit#SDDOCNAME_FIELD} with an item
appropriate for the search node.
container-search/src/main/java/com/yahoo/prelude/querytransform/QueryRewrite.java