@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, wait
getExplain
public ProjectedSearchResult(SearchResult delegate, Collection<String> requestedFields)
public Map<String,String> getExtraFields()
SearchResult
The field names are abstracted from the underlying search implementation and will be centrally defined. Their values are not yet documented.
getExtraFields
in interface SearchResult
public String getResultExcerpt()
SearchResult
getResultExcerpt
in interface SearchResult
public String getResultExcerptWithHighlights()
SearchResult
SearchResult.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 SearchResult
public String getDisplayTitleWithHighlights()
SearchResult
getDisplayTitleWithHighlights
in interface SearchResult
public String getContent()
SearchResult
getContent
in interface SearchResult
public String getType()
SearchResult
ContentEntityObject.getType()
getType
in interface SearchResult
ContentTypeAware.getType()
public final String getStatus()
SearchResult
ContentEntityObject.getContentStatus()
getStatus
in interface SearchResult
public boolean isHomePage()
SearchResult
isHomePage
in interface SearchResult
public Date getLastModificationDate()
SearchResult
getLastModificationDate
in interface SearchResult
@Deprecated public String getLastModifier()
getLastModifier
in interface SearchResult
public ConfluenceUser getLastModifierUser()
SearchResult
getLastModifierUser
in interface SearchResult
public String getDisplayTitle()
SearchResult
getDisplayTitle
in interface SearchResult
Addressable.getDisplayTitle()
public String getUrlPath()
SearchResult
getUrlPath
in interface SearchResult
Addressable.getUrlPath()
public String getLastUpdateDescription()
SearchResult
This string is user-supplied, and therefore not internationalised
getLastUpdateDescription
in interface SearchResult
ContentEntityObject.getVersionComment()
public String getSpaceName()
getSpaceName
in interface SearchResult
public String getSpaceKey()
getSpaceKey
in interface SearchResult
public boolean hasLabels()
hasLabels
in interface SearchResult
public Set<String> getLabels(com.atlassian.user.User user)
SearchResult
getLabels
in interface SearchResult
user
- filter labels by this userpublic Set<String> getPersonalLabels()
SearchResult
getPersonalLabels
in interface SearchResult
public Date getCreationDate()
getCreationDate
in interface SearchResult
@Deprecated public String getCreator()
getCreator
in interface SearchResult
public ConfluenceUser getCreatorUser()
SearchResult
getCreatorUser
in interface SearchResult
public String getOwnerType()
SearchResult
getOwnerType
in interface SearchResult
public String getOwnerTitle()
SearchResult
getOwnerTitle
in interface SearchResult
public Integer getContentVersion() throws NumberFormatException
SearchResult
null
if there's no version for this result.getContentVersion
in interface SearchResult
NumberFormatException
- if the document in the index has an unparseable version numberpublic com.atlassian.bonnie.Handle getHandle()
BaseSearchResult
Because 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 BaseSearchResult
AnyTypeDao.findByHandle(com.atlassian.bonnie.Handle)
public String getField(String fieldName)
BaseSearchResult
getField
in interface BaseSearchResult
public Set<String> getFieldValues(String fieldName)
BaseSearchResult
getFieldValues
in interface BaseSearchResult
public boolean isFieldRequested(String fieldName)
BaseSearchResult
isFieldRequested
in interface BaseSearchResult
Copyright © 2003–2018 Atlassian. All rights reserved.