com.atlassian.confluence.search.v2
Interface SearchResult

All Known Implementing Classes:
LuceneSearchResult

public interface SearchResult

An individual search result. The SearchResult provides access to a number of attributes that are populated directly from the index without requiring an additional database hit. There should be enough information directly in the result to give a pretty detailed description of the hit.


Method Summary
 java.lang.String getContent()
          Gets the text content of the search result.
 java.util.Date getCreationDate()
           
 java.lang.String getCreator()
           
 java.lang.String getDisplayTitle()
          Gets the title of the search result appropriate for displaying to a user.
 com.atlassian.bonnie.Handle getHandle()
          Retrieves the handle that can then be used by the AnyTypeObjectDao to retrieve the database object referenced by this search result.
 java.util.Date getLastModificationDate()
          Gets the last modification date of the entity represented by the search result.
 java.lang.String getLastModifier()
          Gets the username of the last person to modify the entity represented by the search result.
 java.lang.String getLastUpdateDescription()
          Gets some string describing the last modification to this content.
 java.lang.String getType()
          Gets a string representation of the type of the entity represented by the search result.
 java.lang.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.
 

Method Detail

getHandle

com.atlassian.bonnie.Handle getHandle()
Retrieves the handle that can then be used by the AnyTypeObjectDao to retrieve the database object referenced by this search result.

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.

Returns:
the handle that can be used to look up the underlying database object.
See Also:
AnyTypeObjectDao.findByHandle(com.atlassian.bonnie.Handle)

getContent

java.lang.String getContent()
Gets the text content of the search result.

Returns:
the text content of the search result

getType

java.lang.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 ContentEntityObject.getType()

Returns:
the type of the entity represented as a string, or null if no such type can be determined
See Also:
Addressable.getType()

isHomePage

boolean isHomePage()
Checks if the search result represents the homepage of a space.

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

getLastModificationDate

java.util.Date getLastModificationDate()
Gets the last modification date of the entity represented by the search result.

Returns:
the last modification date of the entity

getLastModifier

java.lang.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

getDisplayTitle

java.lang.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
See Also:
Addressable.getDisplayTitle()

getUrlPath

java.lang.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
See Also:
Addressable.getUrlPath()

getLastUpdateDescription

java.lang.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
See Also:
ContentEntityObject.getVersionComment()

getCreationDate

java.util.Date getCreationDate()

getCreator

java.lang.String getCreator()


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.