0

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);
David
  • 3,251
  • 18
  • 28
Alelou
  • 1
  • 1
  • I reworded the question a bit to try to make it a little clearer. Things that are still not obvious: is there anything here that is Watson specific, or is it just dealing with the Solr API? Is the 'ranker' a part of the Solr or Watson API? I am not familiar with it. The question could also use an example of what comes back from the query in CSV, JSON, or XML -- I assume you have access to the URL and can query the index directly – David Mar 02 '17 at 00:55
  • Sorry if I was unclear, I'm not familiar with both services. As I understood Watson RR is added on top of Apache Solr to rerank the results of a query with a ranker. My task was to perform a query without the ranker and with the ranker to explore the differences. I found the answer for my problem :) – Alelou Mar 03 '17 at 09:08

1 Answers1

1

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");
Vinod
  • 1,965
  • 1
  • 9
  • 18