@ParametersAreNonnullByDefault public class ProjectedSearchResult extends Object implements SearchResult
HIGHLIGHT_END, HIGHLIGHT_START| Constructor and Description |
|---|
ProjectedSearchResult(SearchResult delegate,
Collection<String> requestedFields) |
| Modifier and Type | Method and Description |
|---|---|
String |
getContent()
Gets the text content of the search result.
|
Integer |
getContentVersion()
Returns the version of the content if available, or
null if there's no version for this result. |
Date |
getCreationDate() |
String |
getCreator()
Deprecated.
|
ConfluenceUser |
getCreatorUser()
Gets the person who created the entity represented by the search result.
|
String |
getDisplayTitle()
Gets the title of the search result appropriate for displaying to a user.
|
String |
getDisplayTitleWithHighlights()
Gets the title of the search result appropriate for displaying to a user with matches highlighted.
|
Map<String,String> |
getExtraFields()
If the retrieved documents contain additional fields that cannot be directly accessed by this interface then they
can be retrieved via this method.
|
String |
getField(String fieldName)
Returns the contents of the field as a string.
|
Set<String> |
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.
|
com.atlassian.bonnie.Handle |
getHandle()
Retrieves the handle that can then be used by the AnyTypeDao to retrieve the database object referenced by this
search result.
|
Set<String> |
getLabels(com.atlassian.user.User user)
Gets the labels on the current search result that are visible to the specified user.
|
Date |
getLastModificationDate()
Gets the last modification date of the entity represented by the search result.
|
String |
getLastModifier()
Deprecated.
|
ConfluenceUser |
getLastModifierUser()
Gets the last person to modify the entity represented by the search result.
|
String |
getLastUpdateDescription()
Gets some string describing the last modification to this content.
|
String |
getOwnerTitle()
If this result represents an attachment then this field will return the title of the page or blog post the
attachment is attached to.
|
String |
getOwnerType()
If this result represents an attachment then this field will return the type of the container, a page or
blogpost.
|
Set<String> |
getPersonalLabels()
Gets all the personal labels on the current search result.
|
String |
getResultExcerpt()
Gets excerpt from the context of the search result.
|
String |
getResultExcerptWithHighlights()
Gets excerpt from the context of the search result, as
SearchResult.getResultExcerpt(), but in a HTML-safe manner. |
String |
getSpaceKey() |
String |
getSpaceName() |
String |
getStatus()
Gets a string representation of the entity status represented by the search result.
|
String |
getType()
Gets a string representation of the type of the entity represented by the search result.
|
String |
getUrlPath()
Gets the URL path to the search result, relative to the site's context root.
|
boolean |
hasLabels() |
boolean |
isFieldRequested(String fieldName)
check to see if this SearchFieldName has been requested during the search, if this method returns false then
getField will throw a FieldNotRequestedException
|
boolean |
isHomePage()
Checks if the search result represents the homepage of a space.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetExplainpublic ProjectedSearchResult(SearchResult delegate, Collection<String> requestedFields)
public Map<String,String> getExtraFields()
SearchResultThe field names are abstracted from the underlying search implementation and will be centrally defined. Their values are not yet documented.
getExtraFields in interface SearchResultpublic String getResultExcerpt()
SearchResultgetResultExcerpt in interface SearchResultpublic String getResultExcerptWithHighlights()
SearchResultSearchResult.getResultExcerpt(), but in a HTML-safe manner.
Implementations should highlight hits with SearchResult.HIGHLIGHT_START and SearchResult.HIGHLIGHT_END.
The default implementation simply HTML-encode the result of SearchResult.getResultExcerpt().getResultExcerptWithHighlights in interface SearchResultpublic String getDisplayTitleWithHighlights()
SearchResultgetDisplayTitleWithHighlights in interface SearchResultpublic String getContent()
SearchResultgetContent in interface SearchResultpublic String getType()
SearchResultContentEntityObject.getType()getType in interface SearchResultContentTypeAware.getType()public final String getStatus()
SearchResultContentEntityObject.getContentStatus()getStatus in interface SearchResultpublic boolean isHomePage()
SearchResultisHomePage in interface SearchResultpublic Date getLastModificationDate()
SearchResultgetLastModificationDate in interface SearchResult@Deprecated public String getLastModifier()
getLastModifier in interface SearchResultpublic ConfluenceUser getLastModifierUser()
SearchResultgetLastModifierUser in interface SearchResultpublic String getDisplayTitle()
SearchResultgetDisplayTitle in interface SearchResultAddressable.getDisplayTitle()public String getUrlPath()
SearchResultgetUrlPath in interface SearchResultAddressable.getUrlPath()public String getLastUpdateDescription()
SearchResult
This string is user-supplied, and therefore not internationalised
getLastUpdateDescription in interface SearchResultContentEntityObject.getVersionComment()public String getSpaceName()
getSpaceName in interface SearchResultpublic String getSpaceKey()
getSpaceKey in interface SearchResultpublic boolean hasLabels()
hasLabels in interface SearchResultpublic Set<String> getLabels(com.atlassian.user.User user)
SearchResultgetLabels in interface SearchResultuser - filter labels by this userpublic Set<String> getPersonalLabels()
SearchResultgetPersonalLabels in interface SearchResultpublic Date getCreationDate()
getCreationDate in interface SearchResult@Deprecated public String getCreator()
getCreator in interface SearchResultpublic ConfluenceUser getCreatorUser()
SearchResultgetCreatorUser in interface SearchResultpublic String getOwnerType()
SearchResultgetOwnerType in interface SearchResultpublic String getOwnerTitle()
SearchResultgetOwnerTitle in interface SearchResultpublic Integer getContentVersion() throws NumberFormatException
SearchResultnull if there's no version for this result.getContentVersion in interface SearchResultNumberFormatException - if the document in the index has an unparseable version numberpublic com.atlassian.bonnie.Handle getHandle()
BaseSearchResultBecause the database and index are not updated at the same time, it is possible for a deleted entity to still be represented in the search index. Do not assume that this handle will always refer to a live object.
getHandle in interface BaseSearchResultAnyTypeDao.findByHandle(com.atlassian.bonnie.Handle)public String getField(String fieldName)
BaseSearchResultgetField in interface BaseSearchResultpublic Set<String> getFieldValues(String fieldName)
BaseSearchResultgetFieldValues in interface BaseSearchResultpublic boolean isFieldRequested(String fieldName)
BaseSearchResultisFieldRequested in interface BaseSearchResultCopyright © 2003–2022 Atlassian. All rights reserved.