private Index determineCurrentIndex(Index defaultIndex, IndexFacts.Session indexFacts) {
        int backtrack = tokens.size();
        int tokencnt = 0;
        for (int i = 1; i <= tokens.size(); i++) {
            backtrack = tokens.size() - i;
            Token lookAt = tokens.get(backtrack);
            if (lookAt.kind != WORD && lookAt.kind != UNDERSCORE && lookAt.kind != NUMBER && lookAt.kind != DOT) {
                // do not use this token
                backtrack++;
                break;
            }
            tokencnt++;
        }
        StringBuilder tmp = new StringBuilder();
        for (int i = 0; i < tokencnt; i++) {
            Token useToken = tokens.get(backtrack + i);
            tmp.append(useToken.image);
        }
        String indexName = tmp.toString();
        if (indexName.length() > 0) {
            String canonicIndexName = indexFacts.getCanonicName(indexName);
            Index index = indexFacts.getIndex(canonicIndexName);
            if (! index.isNull()) {
                indexLastExplicitlyChangedAt = tokens.size();
                return index;
            }
        }
        return defaultIndex;
    }
Resets this tokenizer and create tokens from the given string.

@param string the string to tokenize
@param defaultIndexName the name of the index to use as default
@param indexFacts information about the indexes we will search
@return a read-only list of tokens. This list can only be used by this thread
container-search/src/main/java/com/yahoo/prelude/query/parser/Tokenizer.java