Search in sources :

Example 1 with SearchResult

use of com.yahoo.vdslib.SearchResult in project vespa by vespa-engine.

the class VdsVisitorTestCase method createSR.

private SearchResult createSR(String docId, double rank) {
    BufferSerializer serializer = new BufferSerializer();
    // total hits
    serializer.putInt(null, 2);
    // hit count
    serializer.putInt(null, 1);
    serializer.put(null, docId);
    serializer.putDouble(null, rank);
    // sort blob count
    serializer.putInt(null, 0);
    // aggregator count
    serializer.putInt(null, 0);
    // grouping count
    serializer.putInt(null, 0);
    serializer.getBuf().flip();
    return new SearchResult(serializer);
}
Also used : BufferSerializer(com.yahoo.vespa.objects.BufferSerializer) SearchResult(com.yahoo.vdslib.SearchResult)

Aggregations

SearchResult (com.yahoo.vdslib.SearchResult)1 BufferSerializer (com.yahoo.vespa.objects.BufferSerializer)1