Skip to content

Commit

Permalink
add javadoc comment to getMatchedQueryScore
Browse files Browse the repository at this point in the history
Signed-off-by: Dharin Shah <8616130+Dharin-shah@users.noreply.github.com>
  • Loading branch information
Dharin-shah committed Jan 29, 2024
1 parent 38c8546 commit b4ca402
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void testPrimaryRelocationWhileIndexing() throws Exception {
ClusterHealthResponse clusterHealthResponse = client().admin()
.cluster()
.prepareHealth()
.setTimeout(TimeValue.timeValueSeconds(120))
.setTimeout(TimeValue.timeValueSeconds(60))
.setWaitForEvents(Priority.LANGUID)
.setWaitForNoRelocatingShards(true)
.execute()
Expand Down
9 changes: 8 additions & 1 deletion server/src/main/java/org/opensearch/search/SearchHit.java
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,14 @@ public String[] getMatchedQueries() {
}

/**
* @return The score of the provided named query if it matches, {@code null} otherwise.
* Returns the score of the provided named query if it matches.
* <p>
* If the 'include_named_queries_score' is not set, this method will return {@link Float#NaN}
* for each named query instead of a numerical score.
* </p>
*
* @param name The name of the query to retrieve the score for.
* @return The score of the named query, or {@link Float#NaN} if 'include_named_queries_score' is not set.
*/
public Float getMatchedQueryScore(String name) {
return getMatchedQueriesAndScores().get(name);
Expand Down

0 comments on commit b4ca402

Please sign in to comment.