Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Interface SearchQueryResult


public interface SearchQueryResult

Encapsulates a search result resulting from a search using the SearchQuery class. Relevance is only stored to 3 significant decimal places (xx.x%)


Nested Class Summary
static class SearchQueryResult.ResultType
          Represents the different types of results that can be queried upon
 
Field Summary
static SearchQueryResult.ResultType[] ALL_TYPES
          An array of all SearchQueryResult.ResultTypes
 
Method Summary
 JiveObject getJiveObject()
          This method returns a JiveContentObject this query result pertains to.
 long getJiveObjectID()
          Retrieve the unique id for the jive object this query result pertains to.
 int getJiveObjectType()
          Retrieve the type of the jive object this query result pertains to.
 Date getModificationDate()
          Returns the modification date of the jive content object this query result pertains to.
 float getRelevance()
          Get the relevance of this query result as determined by the search engine.
 String getRelevanceAsPercentage(Locale locale)
          Returns the relevance as a percentage (no decimal places) formatted according to the locale passed in.
 SearchQueryResult.ResultType getResultType()
          Returns the ResultType for this search query result.
 String[] highlightResult(String preTag, String postTag)
          Returns a title and summary with search words highlighted appropriate to the search query string.
 

Field Detail

ALL_TYPES

static final SearchQueryResult.ResultType[] ALL_TYPES
An array of all SearchQueryResult.ResultTypes

Method Detail

getResultType

SearchQueryResult.ResultType getResultType()
Returns the ResultType for this search query result.

Returns:
the ResultType for this search query result

getJiveObjectID

long getJiveObjectID()
Retrieve the unique id for the jive object this query result pertains to.

Returns:
the unique id for the jive content object.

getJiveObjectType

int getJiveObjectType()
Retrieve the type of the jive object this query result pertains to.

Returns:
the type of the jive content object.

getJiveObject

JiveObject getJiveObject()
This method returns a JiveContentObject this query result pertains to.

Returns:
the JiveContentObject this query result pertains to.

getModificationDate

Date getModificationDate()
Returns the modification date of the jive content object this query result pertains to. This may not be the most current modification date but rather is likely to be the modification date of the content object the last time it was added to the search index.

Returns:
the modification date of the jive content object this query result pertains to.

getRelevance

float getRelevance()
Get the relevance of this query result as determined by the search engine.

Returns:
the relevance of this query result as determined by the search engine.

getRelevanceAsPercentage

String getRelevanceAsPercentage(Locale locale)
Returns the relevance as a percentage (no decimal places) formatted according to the locale passed in.

Parameters:
locale - the locale to use to format the percentage.
Returns:
the formatted percentage as a String.

highlightResult

String[] highlightResult(String preTag,
                         String postTag)
Returns a title and summary with search words highlighted appropriate to the search query string.

This methos is a convenience method for SearchQuery.highlightResult(SearchQueryResult, String, String)

Parameters:
preTag - a tag to be used to mark the beginning of highlighted text eg <B%gt;
postTag - a tag to be used to mark the beginning of highlighted text eg </B%gt;
Returns:
an array of highlighted text with the title being the first element and a summary of the main text as the second element.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.