001package org.nasdanika.ai;
002
003public interface SearchResult<D extends Comparable<D>> extends Comparable<SearchResult<D>> {
004        
005        /**
006         * Resource URI
007         * @return
008         */
009        String getUri();
010        
011        /**
012         * Embedding position
013         * @return
014         */
015        int getIndex();
016        
017        /**
018         * Distance from the query vector
019         * @return
020         */
021        D getDistance();
022        
023        @Override
024        default int compareTo(SearchResult<D> o) {
025                return getDistance().compareTo(o.getDistance());
026        }
027        
028}