SearchResult.MatchInfo.Builder
public final class SearchResult.MatchInfo.Builder
Builder for MatchInfo objects.
Summary
Public constructors |
|---|
|
Creates a new |
Public methods |
|
|---|---|
@NonNull SearchResult.MatchInfo |
build()Constructs a new |
@NonNull SearchResult.MatchInfo.Builder |
@ExperimentalAppSearchApiSets the |
@NonNull SearchResult.MatchInfo.Builder |
setExactMatchRange(@NonNull SearchResult.MatchRange matchRange)Sets the exact |
@NonNull SearchResult.MatchInfo.Builder |
setSnippetRange(@NonNull SearchResult.MatchRange matchRange)Sets the snippet |
@NonNull SearchResult.MatchInfo.Builder |
setSubmatchRange(@NonNull SearchResult.MatchRange matchRange)Sets the submatch |
Public constructors
Builder
public Builder(@NonNull String propertyPath)
Creates a new MatchInfo.Builder reporting a match with the given property path.
A property path is a dot-delimited sequence of property names indicating which property in the document these snippets correspond to.
Example properties: 'body', 'sender.name', 'sender.emailaddress', etc. For class example 1, this returns "subject".
Public methods
setEmbeddingMatch
@ExperimentalAppSearchApi
public @NonNull SearchResult.MatchInfo.Builder setEmbeddingMatch(
@Nullable SearchResult.EmbeddingMatchInfo embeddingMatch
)
Sets the EmbeddingMatchInfo corresponding to the given entry.
setExactMatchRange
public @NonNull SearchResult.MatchInfo.Builder setExactMatchRange(@NonNull SearchResult.MatchRange matchRange)
Sets the exact MatchRange corresponding to the given entry.
setSnippetRange
public @NonNull SearchResult.MatchInfo.Builder setSnippetRange(@NonNull SearchResult.MatchRange matchRange)
Sets the snippet MatchRange corresponding to the given entry.
setSubmatchRange
public @NonNull SearchResult.MatchInfo.Builder setSubmatchRange(@NonNull SearchResult.MatchRange matchRange)
Sets the submatch MatchRange corresponding to the given entry.