Class OpenSearchSearchResult
java.lang.Object
com.atlassian.confluence.search.v2.AbstractSearchResult
com.atlassian.confluence.plugins.opensearch.OpenSearchSearchResult
- All Implemented Interfaces:
BaseSearchResult
,SearchResult
An individual search result from OpenSearch hit
- Since:
- 8.6
-
Field Summary
Fields inherited from interface com.atlassian.confluence.search.v2.SearchResult
HIGHLIGHT_END, HIGHLIGHT_START
-
Constructor Summary
ConstructorsConstructorDescriptionOpenSearchSearchResult
(org.opensearch.client.opensearch.core.search.Hit<?> hit, Encoder encoder) -
Method Summary
Modifier and TypeMethodDescriptionGets the title of the search result appropriate for displaying to a user with matches highlighted.Return names of all fields of a given document.getFieldValue
(String fieldName) Return a string value of a field of a given document, if the field has multiple values then return last value, if there is no such field then return null.getFieldValues
(String fieldName) Return set of string values of a field of a given document, if the field has single value then return singleton set of that value, if there is no such field then return empty set.long
Get the handle IDGets excerpt from the context of the search result, asSearchResult.getResultExcerpt()
, but in a HTML-safe manner.getScore()
Methods inherited from class com.atlassian.confluence.search.v2.AbstractSearchResult
getContent, getContentVersion, getCreationDate, getCreator, getCreatorUser, getDateResult, getDisplayTitle, getExtraFields, getField, getHandle, getIntegerResult, getLabels, getLastModificationDate, getLastModifier, getLastModifierUser, getLastUpdateDescription, getOwnerTitle, getOwnerType, getPersonalLabels, getResultExcerpt, getResultExcerpt, getSanitisedContent, getSpaceKey, getSpaceName, getStatus, getStringResult, getType, getUrlPath, getUserResult, hasLabels, isHomePage, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.search.v2.SearchResult
getExplain
-
Constructor Details
-
OpenSearchSearchResult
public OpenSearchSearchResult(org.opensearch.client.opensearch.core.search.Hit<?> hit, Encoder encoder)
-
-
Method Details
-
getHandleId
public long getHandleId()Description copied from interface:BaseSearchResult
Get the handle ID- Returns:
- the ID of the
Handle
object
-
getFieldNames
Description copied from interface:BaseSearchResult
Return names of all fields of a given document.- Specified by:
getFieldNames
in interfaceBaseSearchResult
- Specified by:
getFieldNames
in classAbstractSearchResult
- Returns:
- names of all known fields or null
-
getFieldValue
Description copied from class:AbstractSearchResult
Return a string value of a field of a given document, if the field has multiple values then return last value, if there is no such field then return null.- Specified by:
getFieldValue
in classAbstractSearchResult
- Returns:
- a string value of a field
-
getFieldValues
Description copied from class:AbstractSearchResult
Return set of string values of a field of a given document, if the field has single value then return singleton set of that value, if there is no such field then return empty set.- Specified by:
getFieldValues
in interfaceBaseSearchResult
- Specified by:
getFieldValues
in classAbstractSearchResult
- Returns:
- a string value of a field
-
getDisplayTitleWithHighlights
Description copied from interface:SearchResult
Gets the title of the search result appropriate for displaying to a user with matches highlighted. All results should return something useful for this method.- Returns:
- the title of the search result appropriate for display on a page with matches highlighted
-
getResultExcerptWithHighlights
Description copied from interface:SearchResult
Gets excerpt from the context of the search result, asSearchResult.getResultExcerpt()
, but in a HTML-safe manner. Implementations should highlight hits withSearchResult.HIGHLIGHT_START
andSearchResult.HIGHLIGHT_END
. The default implementation simply HTML-encode the result ofSearchResult.getResultExcerpt()
.- Returns:
- excerpt of the content of the search result with matches highlighted
-
getScore
-