Alelou
Alelou

Reputation: 1

Watson retrieve and rank: document relevance score

How do I call Solr to return relevance scores in the result? I want to have a Solr document that includes the confidence that Solr uses internally for ranking, but I don't want to have to make a separate call to the ranker?

I tried to add the "confidence" field to the list of fields to return, but it doesn't have any data.

query.set("fl","id,title,fileName,contentHtml,searchText,sourceDocId,confidence");
query.set("debugQuery" ,true);

Upvotes: 0

Views: 593

Answers (1)

Vinod
Vinod

Reputation: 1953

Use score in fl, which adds relevancy score value calculated for each document in the resultset.

query.set("fl","id,score,title,fileName,contentHtml,searchText,sourceDocId,confidence");

Upvotes: 1

Related Questions