public abstract class

AbstractLuceneSearchResult

extends Object
implements SearchResult
java.lang.Object
   ↳ com.atlassian.confluence.search.v2.lucene.AbstractLuceneSearchResult
Known Direct Subclasses

Summary

Public Constructors
AbstractLuceneSearchResult()
Public Methods
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()
String getDisplayTitle()
Gets the title of the search result appropriate for displaying to a user.
Set<String> getLabels(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()
Gets the username of 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()
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 isHomePage()
Checks if the search result represents the homepage of a space.
Protected Methods
Date getDateResult(String key)
Integer getIntegerResult(String fieldName)
String getStringResult(String... fieldNames)
Retrieves the value for the specified field name.
boolean hasLabels(Map<String, ?> results)
Map<StringString> mapExtraFields()
void populatePersonalLabels(Document document)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.search.v2.BaseSearchResult
From interface com.atlassian.confluence.search.v2.SearchResult

Public Constructors

public AbstractLuceneSearchResult ()

Public Methods

public String getContent ()

Gets the text content of the search result.

Returns
  • the text content of the search result

public Integer getContentVersion ()

Returns the version of the content if available, or null if there's no version for this result.

public Date getCreationDate ()

public String getCreator ()

public String getDisplayTitle ()

Gets the title of the search result appropriate for displaying to a user. All results should return something useful for this method.

Returns
  • the title of the search result appropriate for display on a page

public Set<String> getLabels (User user)

Gets the labels on the current search result that are visible to the specified user.

Parameters
user filter labels by this user
Returns
  • the labels on the current search result that are visible to the specified user.

public Date getLastModificationDate ()

Gets the last modification date of the entity represented by the search result.

Returns
  • the last modification date of the entity

public String getLastModifier ()

Gets the username of the last person to modify the entity represented by the search result.

Returns
  • the username of the result's last modifier

public String getLastUpdateDescription ()

Gets some string describing the last modification to this content. May be null if no such string is available. For content objects, this will be the same as the "version comment"

This string is user-supplied, and therefore not internationalised

Returns
  • a string describing the last modification to the content

public 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.

Returns
  • the owner title

public String getOwnerType ()

If this result represents an attachment then this field will return the type of the container, a page or blogpost.

Returns
  • the owner type

public Set<String> getPersonalLabels ()

Gets all the personal labels on the current search result.

Returns
  • all the personal labels on the current search result

public String getSpaceKey ()

public String getSpaceName ()

public String getType ()

Gets a string representation of the type of the entity represented by the search result. If the entity is a content object, this is the value of getType()

Returns
  • the type of the entity represented as a string, or null if no such type can be determined

public String getUrlPath ()

Gets the URL path to the search result, relative to the site's context root. All results should return something useful for this method

Returns
  • the URL path to the search result

public boolean isHomePage ()

Checks if the search result represents the homepage of a space.

Returns
  • true if the result represents the homepage of a space

Protected Methods

protected Date getDateResult (String key)

protected Integer getIntegerResult (String fieldName)

protected String getStringResult (String... fieldNames)

Retrieves the value for the specified field name. If more than one field name is provided, it will attempt to retrieve a value for each field in order, returning as soon as a non-null value is encountered.

Parameters
fieldNames field name(s) to retrieve a value for
Returns
  • the first non-null value associated with the ordered list of field names passed in

protected boolean hasLabels (Map<String, ?> results)

protected Map<StringString> mapExtraFields ()

protected void populatePersonalLabels (Document document)