hollow/src/main/java/com/netflix/hollow/core/index/HollowPrefixIndex.java
@SuppressWarnings("WeakerAccess")
    public HollowOrdinalIterator findKeysWithPrefix(String prefix) {
        TST current;
        HollowOrdinalIterator it;
        do {
            current = prefixIndexVolatile;
            it = current.findKeysWithPrefix(prefix);
        } while (current != this.prefixIndexVolatile);
        return it;
    }
@SuppressWarnings("WeakerAccess")
    public HollowOrdinalIterator findKeysWithPrefix(String prefix) {
        TST current;
        HollowOrdinalIterator it;
        do {
            current = prefixIndexVolatile;
            it = current.findKeysWithPrefix(prefix);
        } while (current != this.prefixIndexVolatile);
        return it;
    }
@ SuppressWarnings ( "WeakerAccess" ) public HollowOrdinalIterator findKeysWithPrefix ( String prefix ) { TST current ; HollowOrdinalIterator it ; do { current = prefixIndexVolatile ; it = current . findKeysWithPrefix ( prefix ) ; } while ( current != this . prefixIndexVolatile ) ; return it ; }
Query the index to find all the ordinals that match the given prefix. Example -
<pre>{@code
HollowOrdinalIterator iterator = index.findKeysWithPrefix("a");
int ordinal = iterator.next();
while(ordinal != HollowOrdinalIterator.NO_MORE_ORDINAL) {
// print the result using API
}
}</pre>
<p>
For larger data sets, querying smaller prefixes will be longer than querying for prefixes that are longer.

@param prefix findKeysWithPrefix prefix.
@return An instance of HollowOrdinalIterator to iterate over ordinals that match the given findKeysWithPrefix.
Query the index to find all the ordinals that match the given prefix . Example - <pre > { @code HollowOrdinalIterator iterator = index . findKeysWithPrefix ( a ) ; int ordinal = iterator . next () ; while ( ordinal ! = HollowOrdinalIterator . NO_MORE_ORDINAL ) { // print the result using API } } < / pre > <p > For larger data sets querying smaller prefixes will be longer than querying for prefixes that are longer .