Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class LocalQuery

java.lang.Object
  extended by com.jivesoftware.forum.database.LocalQuery
All Implemented Interfaces:
Cacheable, java.io.Serializable

public class LocalQuery
extends java.lang.Object
implements Cacheable

LocalQuery is responsible for performing document searches. When running without a search cluster the application server will use a LocalQuery to actually perform the searches. However, when a search cluster is available then the application server will use a RemoteQuery that will ask a search cluster member to perform the search.

LocalQueries can be cached when running a search cluster is available. This is required for caching query results required for highlighting search results.

See Also:
Serialized Form

Field Summary
protected  java.util.Date afterDate
           
protected  boolean attachmentSearchEnabled
           
protected  java.util.Date beforeDate
           
protected  long filteredUserID
           
protected  long[] forumIDs
           
protected  int maxResultsSize
           
protected  int recursiveForumCount
           
protected  long threadID
           
 
Constructor Summary
LocalQuery()
           
LocalQuery(DbQuery dbQuery)
           
 
Method Summary
 java.util.List executeQuery(java.lang.String queryString)
          Executes the search for the specified queryString and search configuration.
 org.apache.lucene.search.BooleanQuery generateLuceneQuery(java.lang.String queryString, boolean disableStemming, boolean disableSynonyms)
           
 int getCachedSize()
          Returns the approximate size of the Object in bytes.
 java.lang.String[] highlightResult(QueryResult result, java.lang.String body, java.lang.String preTag, java.lang.String postTag)
          Returns a title and summary with search words highlighted appropriate to the search query string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filteredUserID

protected long filteredUserID

forumIDs

protected long[] forumIDs

threadID

protected long threadID

beforeDate

protected java.util.Date beforeDate

afterDate

protected java.util.Date afterDate

maxResultsSize

protected int maxResultsSize

recursiveForumCount

protected int recursiveForumCount

attachmentSearchEnabled

protected boolean attachmentSearchEnabled
Constructor Detail

LocalQuery

public LocalQuery()

LocalQuery

public LocalQuery(DbQuery dbQuery)
Method Detail

executeQuery

public java.util.List executeQuery(java.lang.String queryString)
Executes the search for the specified queryString and search configuration. This method will return a list of QueryResult.

Parameters:
queryString - the string entered by the user to perform the search.
Returns:
list of QueryResults. The list size won't be greater than maxResultsSize.

generateLuceneQuery

public org.apache.lucene.search.BooleanQuery generateLuceneQuery(java.lang.String queryString,
                                                                 boolean disableStemming,
                                                                 boolean disableSynonyms)

highlightResult

public java.lang.String[] highlightResult(QueryResult result,
                                          java.lang.String body,
                                          java.lang.String preTag,
                                          java.lang.String postTag)
Returns a title and summary with search words highlighted appropriate to the search query string. This method can only be called after a search has been done.

Parameters:
result - the QueryResult to highlight.
body - the body of the forum message.
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.

getCachedSize

public int getCachedSize()
Description copied from interface: Cacheable
Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.

Specified by:
getCachedSize in interface Cacheable
Returns:
the size of the Object in bytes.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.