CWIS Developer Documentation
Public Member Functions | Static Public Member Functions | List of all members
SPTSearchEngine Class Reference
Inheritance diagram for SPTSearchEngine:
Inheritance graph
[legend]
Collaboration diagram for SPTSearchEngine:
Collaboration graph
[legend]

Public Member Functions

 SPTSearchEngine ()
 
 GetFieldContent ($ItemId, $FieldName)
 Overloaded version of method to retrieve text from DB. More...
 
 SearchFieldForPhrases ($FieldName, $Phrase)
 
 SearchFieldsForComparisonMatches ($FieldNames, $Operators, $Values)
 
 UpdateForResource ($ItemId)
 
- Public Member Functions inherited from SearchEngine
 SearchEngine ($ItemTableName, $ItemIdFieldName)
 Object constructor. More...
 
 AddField ($FieldName, $FieldType, $Weight, $UsedInKeywordSearch)
 Add field to include in searching. More...
 
 FieldType ($FieldName)
 Get type of specified field (text/numeric/date/daterange). More...
 
 FieldWeight ($FieldName)
 Get search weight for specified field. More...
 
 FieldInKeywordSearch ($FieldName)
 Get whether specified field is included in keyword searches. More...
 
 DebugLevel ($NewValue)
 Set debug output level. More...
 
 Search ($SearchString, $StartingResult=0, $NumberOfResults=10, $SortByField=NULL, $SortDescending=TRUE)
 Perform keyword search. More...
 
 FieldedSearch ($SearchStrings, $StartingResult=0, $NumberOfResults=10, $SortByField=NULL, $SortDescending=TRUE)
 Perform search across multiple fields, with different values or comparisons specified for each field. More...
 
 GroupedSearch ($SearchGroups, $StartingResult=0, $NumberOfResults=10, $SortByField=NULL, $SortDescending=TRUE)
 Perform search with logical groups of fielded searches. More...
 
 AddResultFilterFunction ($FunctionName)
 Add function that will be called to filter search results. More...
 
 DefaultSearchLogic ($NewSetting=NULL)
 Get/set default search logic (LOGIC_AND or LOGIC_OR). More...
 
 SearchTermsRequiredByDefault ($NewSetting=TRUE)
 Set default search logic. More...
 
 NumberOfResults ()
 Get number of results found by most recent search. More...
 
 SearchTerms ()
 Get normalized list of search terms. More...
 
 SearchTime ()
 Get time that last search took, in seconds. More...
 
 FieldedSearchWeightScale ($SearchStrings)
 Get total of weights for all fields involved in search, useful for assessing scale of scores in search results. More...
 
 UpdateForItem ($ItemId)
 Update search database for the specified item. More...
 
 UpdateForItems ($StartingItemId, $NumberOfItems)
 Update search database for the specified range of items. More...
 
 DropItem ($ItemId)
 Drop all data pertaining to item from search database. More...
 
 DropField ($FieldName)
 Drop all data pertaining to field from search database. More...
 
 SearchTermCount ()
 Get total number of search terms indexed by search engine. More...
 
 ItemCount ()
 Get total number of items indexed by search engine. More...
 
 AddSynonyms ($Word, $Synonyms)
 Add synonyms. More...
 
 RemoveSynonyms ($Word, $Synonyms=NULL)
 Remove synonym(s). More...
 
 RemoveAllSynonyms ()
 Remove all synonyms. More...
 
 GetSynonyms ($Word)
 Get synonyms for word. More...
 
 GetAllSynonyms ()
 Get all synonyms. More...
 
 SetAllSynonyms ($SynonymList)
 Set all synonyms. More...
 
 LoadSynonymsFromFile ($FileName)
 Load synonyms from a file. More...
 

Static Public Member Functions

static GetItemIdsSortedByField ($FieldName, $SortDescending)
 
static QueueUpdateForItem ($ItemId, $TaskPriority=ApplicationFramework::PRIORITY_LOW)
 
static RunUpdateForItem ($ItemId)
 
static GetResultFacets ($SearchResults, $User)
 Generate a list of suggested additional search terms that can be used for faceted searching. More...
 

Additional Inherited Members

- Public Attributes inherited from SearchEngine
const LOGIC_AND = 1
 
const LOGIC_OR = 2
 
const FIELDTYPE_TEXT = 1
 
const FIELDTYPE_NUMERIC = 2
 
const FIELDTYPE_DATE = 3
 
const FIELDTYPE_DATERANGE = 4
 
const WORD_PRESENT = 1
 
const WORD_EXCLUDED = 2
 
const WORD_REQUIRED = 4
 
const STEM_ID_OFFSET = 1000000
 
const SEARCHLOGIC_AND = 1
 
const SEARCHLOGIC_OR = 2
 
- Protected Member Functions inherited from SearchEngine
 SearchFieldForPhrases ($FieldName, $Phrase)
 
 FilterOnSuppliedFunctions ($Scores)
 
 GetFieldContent ($ItemId, $FieldName)
 
 DMsg ($Level, $Msg)
 
- Protected Attributes inherited from SearchEngine
 $DB
 
 $DebugLevel
 
 $ItemTableName
 
 $ItemIdFieldName
 
 $NumberOfResultsAvailable
 
 $LastSearchTime
 
 $FilterFuncs
 
 $DefaultSearchLogic = self::LOGIC_AND
 
 $StemmingEnabled = TRUE
 
 $SynonymsEnabled = TRUE
 

Detailed Description

Definition at line 10 of file SPTSearchEngine.php.

Member Function Documentation

SPTSearchEngine::GetFieldContent (   $ItemId,
  $FieldName 
)

Overloaded version of method to retrieve text from DB.

Parameters
int$ItemIdID of item to retrieve value for.
string$FieldNameName of field to retrieve value for.
Returns
mixed Text value or array of text values or NULL or empty array if no values available.

Definition at line 78 of file SPTSearchEngine.php.

References MetadataSchema\MDFTYPE_REFERENCE.

static SPTSearchEngine::GetItemIdsSortedByField (   $FieldName,
  $SortDescending 
)
static

Definition at line 599 of file SPTSearchEngine.php.

static SPTSearchEngine::GetResultFacets (   $SearchResults,
  $User 
)
static

Generate a list of suggested additional search terms that can be used for faceted searching.

Parameters
$SearchResultsA set of results from a from which to generate facets.
$Userto employ in permission checks.
Returns
An array of suggestions. Keys are the field names and values are arrays of (ValueId => SuggestedValue)

Definition at line 634 of file SPTSearchEngine.php.

References SearchEngine\$DB, and MetadataSchema\MDFSTAT_OK.

static SPTSearchEngine::QueueUpdateForItem (   $ItemId,
  $TaskPriority = ApplicationFramework::PRIORITY_LOW 
)
static

Definition at line 605 of file SPTSearchEngine.php.

static SPTSearchEngine::RunUpdateForItem (   $ItemId)
static

Definition at line 616 of file SPTSearchEngine.php.

References SPTSearchEngine().

SPTSearchEngine::SearchFieldForPhrases (   $FieldName,
  $Phrase 
)
SPTSearchEngine::SearchFieldsForComparisonMatches (   $FieldNames,
  $Operators,
  $Values 
)
SPTSearchEngine::SPTSearchEngine ( )
SPTSearchEngine::UpdateForResource (   $ItemId)

Definition at line 747 of file SPTSearchEngine.php.

References SearchEngine\UpdateForItem().


The documentation for this class was generated from the following file: