com.atlassian.confluence.search.v2
Interface BaseSearchResult

All Known Subinterfaces:
SearchResult
All Known Implementing Classes:
AbstractLuceneSearchResult, LuceneSearchResult

public interface BaseSearchResult

A simpler super interface of SearchResult. Represents an individual search result hit in the confluence search API.


Method Summary
 java.lang.String getField(java.lang.String fieldName)
          Returns the contents of the field as a string.
 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.
 boolean isFieldRequested(java.lang.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
 

Method Detail

getHandle

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.

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:
AnyTypeDao.findByHandle(com.atlassian.bonnie.Handle)

getField

java.lang.String getField(java.lang.String fieldName)
Returns the contents of the field as a string. This method will return null if there is no content for the field or the field does not exist. FieldName is case sensitive.

Parameters:
fieldName -
Returns:
the field value or null if the field has been requested but has no value.
Throws:
FieldNotRequestedException - if the searchFieldName was not included when the searchResult was requested from the searchManager. If the set of fields requested from the searchManager is null or empty, then no exception will be thrown and all fields will be loaded into the searchResult at the time of the search.

isFieldRequested

boolean isFieldRequested(java.lang.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

Parameters:
fieldName -
Returns:


Copyright © 2003-2014 Atlassian. All Rights Reserved.