@Override
    public void addItem(Item item) {
        if (item instanceof WordItem || item instanceof PhraseSegmentItem || item instanceof WordAlternativesItem) {
            addIndexedItem((IndexedItem) item);
        }
        else if (item instanceof IntItem) {
            addIndexedItem(convertIntToWord(item));
        }
        else if (item instanceof PhraseItem || item instanceof AndSegmentItem) {
            for (Iterator<Item> i = ((CompositeItem) item).getItemIterator(); i.hasNext();)
                addIndexedItem((IndexedItem) i.next());
        }
        else {
            throw new IllegalArgumentException("Can not add " + item + " to a phrase");
        }
    }
Adds subitem. The word will have its index name set to the index name of
this phrase. If the item is a word, it will simply be added, if the item
is a phrase, each of the words of the phrase will be added.

@throws IllegalArgumentException if the given item is not a WordItem or PhraseItem
container-search/src/main/java/com/yahoo/prelude/query/PhraseItem.java