Clearspace API (1.10.16) 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
 JiveContentObject getJiveContentObject()
          This method returns a JiveContentObject this query result pertains to.
 long getJiveContentObjectID()
          Retrieve the unique id for the jive content object this query result pertains to.
 int getJiveContentObjectType()
          Retrieve the type of the jive content object this query result pertains to.
 java.util.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.
 java.lang.String getRelevanceAsPercentage(java.util.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.
 java.lang.String[] highlightResult(java.lang.String preTag, java.lang.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

getJiveContentObjectID

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

Returns:
the unique id for the jive content object.

getJiveContentObjectType

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

Returns:
the type of the jive content object.

getJiveContentObject

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

Returns:
the JiveContentObject this query result pertains to.

getModificationDate

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

java.lang.String getRelevanceAsPercentage(java.util.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

java.lang.String[] highlightResult(java.lang.String preTag,
                                   java.lang.String postTag)
Returns a title and summary with search words highlighted appropriate to the search query 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.