public abstract class AbstractLuceneSearchResult extends Object implements SearchResult
Constructor and Description |
---|
AbstractLuceneSearchResult()
Deprecated.
since 5.2. Use
AbstractLuceneSearchResult(com.google.common.base.Function) |
AbstractLuceneSearchResult(com.google.common.base.Function<String,ConfluenceUser> userLookup) |
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.
|
protected Date |
getDateResult(String key) |
String |
getDisplayTitle()
Gets the title of the search result appropriate for displaying to a user.
|
protected Integer |
getIntegerResult(String fieldName) |
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 |
getSpaceKey() |
String |
getSpaceName() |
protected String |
getStringResult(String... fieldNames)
Retrieves the value for the specified field name.
|
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.
|
protected ConfluenceUser |
getUserResult(String fieldName)
Attempts to resolve the contents of the given field as a
ConfluenceUser . |
protected boolean |
hasLabels(Map<String,?> results) |
boolean |
isHomePage()
Checks if the search result represents the homepage of a space.
|
protected Map<String,String> |
mapExtraFields() |
protected void |
populatePersonalLabels(org.apache.lucene.document.Document document) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExtraFields, hasLabels
getField, getHandle, isFieldRequested
public AbstractLuceneSearchResult(com.google.common.base.Function<String,ConfluenceUser> userLookup)
@Deprecated public AbstractLuceneSearchResult()
AbstractLuceneSearchResult(com.google.common.base.Function)
protected void populatePersonalLabels(org.apache.lucene.document.Document document)
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 String getContent()
SearchResult
getContent
in interface SearchResult
public String getType()
SearchResult
ContentEntityObject.getType()
getType
in interface SearchResult
ContentTypeAware.getType()
public boolean isHomePage()
SearchResult
isHomePage
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()
SearchResult
null
if there's no version for this result.getContentVersion
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
protected String getStringResult(String... fieldNames)
fieldNames
- field name(s) to retrieve a value forprotected ConfluenceUser getUserResult(String fieldName)
ConfluenceUser
.
The method first attempts to resolve the user using the field value as a UserKey
. If that fails,
it tries to resolve the user using the field value as a username. If that fails, it returns null.
This is necessary because the same DocumentFieldName.LAST_MODIFIER_NAME
and
ContentEntityMetadataExtractor.CREATOR_NAME_FIELD
fields are used both to store userkeys (post-upgrade)
and usernames (pre-upgrade).Copyright © 2003–2015 Atlassian. All rights reserved.