AI-generated Key Takeaways
-
The
SearchResult.Builderclass is used to constructSearchResultobjects. -
A new builder is created by providing the package name and database name.
-
You can add joined results and match information to the
SearchResultbeing built. -
The matched document and its ranking signal can be set using the builder.
-
The
build()method finalizes the construction and returns theSearchResultobject.
Builder for SearchResult
objects.
Public Constructor Summary
Public Method Summary
| SearchResult.Builder | |
| SearchResult.Builder | |
| SearchResult |
build()
Constructs a new
SearchResult.
|
| SearchResult.Builder | |
| SearchResult.Builder |
setRankingSignal(double rankingSignal)
Sets the ranking signal of the matched document in this SearchResult.
|
Inherited Method Summary
Public Constructors
public Builder (String packageName, String databaseName)
Constructs a new builder for SearchResult
objects.
Parameters
| packageName | the package name the matched document belongs to |
|---|---|
| databaseName | the database name the matched document belongs to. |
Public Methods
public SearchResult.Builder addJoinedResult (SearchResult joinedResult)
Adds a SearchResult
that was joined by the JoinSpec.
Parameters
| joinedResult | The joined SearchResult to add. |
|---|
public SearchResult.Builder addMatchInfo (SearchResult.MatchInfo matchInfo)
Adds another match to this SearchResult.
public SearchResult build ()
Constructs a new SearchResult.
public SearchResult.Builder setGenericDocument (GenericDocument document)
Sets the document which matched.
public SearchResult.Builder setRankingSignal (double rankingSignal)
Sets the ranking signal of the matched document in this SearchResult.