use of com.yelp.nrtsearch.server.grpc.GrpcServer in project nrtsearch by Yelp.
the class ScoreScriptTest method testScriptUsingScoreInScoreQuery.
@Test
public void testScriptUsingScoreInScoreQuery() throws Exception {
GrpcServer.TestServer testAddDocs = new GrpcServer.TestServer(grpcServer, true, Mode.STANDALONE);
// 2 docs addDocuments
testAddDocs.addDocuments();
// manual refresh
grpcServer.getBlockingStub().refresh(RefreshRequest.newBuilder().setIndexName(grpcServer.getTestIndex()).build());
SearchResponse searchResponse = doFunctionScoreQuery("verify_score");
assertEquals(2, searchResponse.getHitsCount());
assertEquals(2.0, searchResponse.getHits(0).getScore(), Math.ulp(2.0));
assertEquals(2.0, searchResponse.getHits(1).getScore(), Math.ulp(2.0));
}
Aggregations