org.sakaiproject.search.api
Interface SearchService

All Superinterfaces:
Diagnosable

public interface SearchService
extends Diagnosable

Provides a search interface

Author:
ieb

Field Summary
static String DATE_STAMP
           
static String EVENT_SEARCH
           
static String EVENT_SEARCH_REF
           
static String EVENT_TRIGGER_INDEX_RELOAD
          event to trigger a reload of the search index by query nodes
static String EVENT_TRIGGER_SEARCH
          event to trigger an update of the index sent from Search Service to index builders
static String FIELD_CONTAINER
          Search Field the container of the entity
static String FIELD_CONTENTS
          Searhc Field (term vector, not full contents) The contents of the Entity
static String FIELD_CONTEXT
          Search Field The context of the Entity
static String FIELD_DIGEST_COUNT
           
static String FIELD_ID
          Search Field The Sakai id of the entity
static String FIELD_REFERENCE
          Search field The reference of the entity
static String FIELD_SITEID
          Search Index Field the site id of the entity ( where is was produced)
static String FIELD_SUBTYPE
          Search Field The tool subtype of the entity
static String FIELD_TITLE
          Seadch Field The title of the entity
static String FIELD_TOOL
          Search Field The Name of the Tool that owns the entity
static String FIELD_TYPE
          Search Field The tool type of the entity
static String FIELD_URL
          Search Index Field the url to the entity
static String REST_CHECKSUM
           
static String REST_CONTEXTS
           
static String REST_END
           
static String REST_START
           
static String REST_TERMS
           
static String REST_USERID
           
 
Method Summary
 void forceReload()
          Force a reload regardless of if the index has changed
 List<SearchBuilderItem> getAllSearchItems()
          get all the search items in the index (must be a lazy load list)
 String getDigestStoragePath()
          Get the storage location for Digested content.
 List<SearchBuilderItem> getGlobalMasterSearchItems()
          get the global master items
 int getNDocs()
          get the number of documents in the search index
 int getPendingDocs()
          get the number of pending documents in the search index
 SearchStatus getSearchStatus()
          Get the status of the search engine
 String getSearchSuggestion(String searchString)
          Get a suggestion for spelling errors etc
 List getSegmentInfo()
           
 List<SearchBuilderItem> getSiteMasterSearchItems()
          get the master itemf to sthe site
 String getStatus()
          get the status of the search service
 TermFrequency getTerms(int documentId)
          get the term vector for this document, where document is the
 boolean isEnabled()
           
 void rebuildInstance()
          trigger a rebuild of the whole index
 void rebuildSite(String currentSiteId)
          rebuild the current site only
 void refreshInstance()
          Trigger an refresh of the whole index
 void refreshSite(String currentSiteId)
          Refresh the current site only
 void registerFunction(String function)
          Adds a function for the SearchService to respond to and route to the index builder.
 void reload()
          When reload is called, the index should be reloaded
 boolean removeWorkerLock()
          force the removal of the worker lock
 SearchList search(String searchTerms, List<String> contexts, int searchStart, int searchEnd)
          Perform a search, return results in a list.
 SearchList search(String searchTerms, List<String> contexts, int start, int end, String filterName, String sorterName)
          This is the same as standard search, but the caller can specify, by name, the index Filter and the index Sorter by name The Sorter and the Filter will be consulted during the search, and hence should not make massive demands on the framework, otherwise they will cripple the search performance
 String searchXML(Map parameterMap)
          generates a block of XML representing the search results
 
Methods inherited from interface org.sakaiproject.search.api.Diagnosable
disableDiagnostics, enableDiagnostics, hasDiagnostics
 

Field Detail

REST_USERID

static final String REST_USERID
See Also:
Constant Field Values

REST_TERMS

static final String REST_TERMS
See Also:
Constant Field Values

REST_CHECKSUM

static final String REST_CHECKSUM
See Also:
Constant Field Values

REST_CONTEXTS

static final String REST_CONTEXTS
See Also:
Constant Field Values

REST_START

static final String REST_START
See Also:
Constant Field Values

REST_END

static final String REST_END
See Also:
Constant Field Values

EVENT_TRIGGER_SEARCH

static final String EVENT_TRIGGER_SEARCH
event to trigger an update of the index sent from Search Service to index builders

See Also:
Constant Field Values

EVENT_TRIGGER_INDEX_RELOAD

static final String EVENT_TRIGGER_INDEX_RELOAD
event to trigger a reload of the search index by query nodes

See Also:
Constant Field Values

EVENT_SEARCH

static final String EVENT_SEARCH
See Also:
Constant Field Values

EVENT_SEARCH_REF

static final String EVENT_SEARCH_REF
See Also:
Constant Field Values

FIELD_SITEID

static final String FIELD_SITEID
Search Index Field the site id of the entity ( where is was produced)

See Also:
Constant Field Values

FIELD_URL

static final String FIELD_URL
Search Index Field the url to the entity

See Also:
Constant Field Values

FIELD_TOOL

static final String FIELD_TOOL
Search Field The Name of the Tool that owns the entity

See Also:
Constant Field Values

FIELD_TITLE

static final String FIELD_TITLE
Seadch Field The title of the entity

See Also:
Constant Field Values

FIELD_CONTENTS

static final String FIELD_CONTENTS
Searhc Field (term vector, not full contents) The contents of the Entity

See Also:
Constant Field Values

FIELD_CONTEXT

static final String FIELD_CONTEXT
Search Field The context of the Entity

See Also:
Constant Field Values

FIELD_SUBTYPE

static final String FIELD_SUBTYPE
Search Field The tool subtype of the entity

See Also:
Constant Field Values

FIELD_TYPE

static final String FIELD_TYPE
Search Field The tool type of the entity

See Also:
Constant Field Values

FIELD_ID

static final String FIELD_ID
Search Field The Sakai id of the entity

See Also:
Constant Field Values

FIELD_CONTAINER

static final String FIELD_CONTAINER
Search Field the container of the entity

See Also:
Constant Field Values

FIELD_REFERENCE

static final String FIELD_REFERENCE
Search field The reference of the entity

See Also:
Constant Field Values

FIELD_DIGEST_COUNT

static final String FIELD_DIGEST_COUNT
See Also:
Constant Field Values

DATE_STAMP

static final String DATE_STAMP
See Also:
Constant Field Values
Method Detail

search

SearchList search(String searchTerms,
                  List<String> contexts,
                  int searchStart,
                  int searchEnd)
                  throws InvalidSearchQueryException
Perform a search, return results in a list.

Parameters:
searchTerms - the search terms
contexts - a list of contexts in which to perform the search
searchEnd -
searchStart -
Returns:
Throws:
InvalidSearchQueryException - if unable to parse the query

search

SearchList search(String searchTerms,
                  List<String> contexts,
                  int start,
                  int end,
                  String filterName,
                  String sorterName)
                  throws InvalidSearchQueryException
This is the same as standard search, but the caller can specify, by name, the index Filter and the index Sorter by name The Sorter and the Filter will be consulted during the search, and hence should not make massive demands on the framework, otherwise they will cripple the search performance

Parameters:
searchTerms - A search string
contexts - A list of contexts
start - starting from
end - ending at
filterName - a lucene filter
sorterName - a lucene sorter
Returns:
Throws:
InvalidSearchQueryException - if unable to parse the query

registerFunction

void registerFunction(String function)
Adds a function for the SearchService to respond to and route to the index builder. EntityProducers that want their content to be searched, should register the events that indicate new data to this

Parameters:
function -

reload

void reload()
When reload is called, the index should be reloaded


refreshInstance

void refreshInstance()
Trigger an refresh of the whole index


rebuildInstance

void rebuildInstance()
trigger a rebuild of the whole index


refreshSite

void refreshSite(String currentSiteId)
Refresh the current site only

Parameters:
currentSiteId -

rebuildSite

void rebuildSite(String currentSiteId)
rebuild the current site only

Parameters:
currentSiteId -

getStatus

String getStatus()
get the status of the search service

Returns:

getNDocs

int getNDocs()
get the number of documents in the search index

Returns:

getPendingDocs

int getPendingDocs()
get the number of pending documents in the search index

Returns:

getAllSearchItems

List<SearchBuilderItem> getAllSearchItems()
get all the search items in the index (must be a lazy load list)

Returns:

getSiteMasterSearchItems

List<SearchBuilderItem> getSiteMasterSearchItems()
get the master itemf to sthe site

Returns:

getGlobalMasterSearchItems

List<SearchBuilderItem> getGlobalMasterSearchItems()
get the global master items

Returns:

getSearchStatus

SearchStatus getSearchStatus()
Get the status of the search engine

Returns:

removeWorkerLock

boolean removeWorkerLock()
force the removal of the worker lock

Returns:

getSegmentInfo

List getSegmentInfo()

forceReload

void forceReload()
Force a reload regardless of if the index has changed


getTerms

TermFrequency getTerms(int documentId)
                       throws IOException
get the term vector for this document, where document is the

Parameters:
documentId -
Returns:
Throws:
IOException

searchXML

String searchXML(Map parameterMap)
generates a block of XML representing the search results

Parameters:
parameterMap -
Returns:

isEnabled

boolean isEnabled()
Returns:

getDigestStoragePath

String getDigestStoragePath()
Get the storage location for Digested content. Will return null if system is Not set up to store content on the fs

Returns:

getSearchSuggestion

String getSearchSuggestion(String searchString)
Get a suggestion for spelling errors etc

Parameters:
searchString -
Returns:
a suggestion


Copyright © 2003-2012 Sakai Project. All Rights Reserved.