CWIS Developer Documentation

- Home
- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

## Public Member Functions
| SPTSearchEngine ()
| GetFieldContent ($ItemId, $FieldName)
| SearchFieldForPhrases ($FieldName, $Phrase)
| SearchFieldsForComparisonMatches ($FieldNames, $Operators, $Values)
| UpdateForResource ($ItemId)
Public Member Functions inherited from SearchEngine
| SearchEngine (&$DB, $ItemTableName, $ItemIdFieldName, $ReferenceTableName, $ReferenceSourceIdFieldName, $ReferenceDestinationIdFieldName)
| AddField ($FieldName, $DBFieldName, $FieldType, $Weight, $UsedInKeywordSearch)
| ItemTableName ()
| ItemIdFieldName ()
| DBFieldName ($FieldName)
| FieldType ($FieldName)
| FieldWeight ($FieldName)
| FieldInKeywordSearch ($FieldName)
| DebugLevel ($Setting)
| Search ($SearchString, $StartingResult=0, $NumberOfResults=10, $SortByField=NULL, $SortDescending=TRUE)
| FieldedSearch ($SearchStrings, $StartingResult=0, $NumberOfResults=10, $SortByField=NULL, $SortDescending=TRUE)
| GroupedSearch ($SearchGroups, $StartingResult=0, $NumberOfResults=10, $SortByField=NULL, $SortDescending=TRUE)
| AddResultFilterFunction ($FunctionName)
| DefaultSearchLogic ($NewSetting=NULL)
| SearchTermsRequiredByDefault ($NewSetting=TRUE)
| NumberOfResults ()
| SearchTerms ()
| SearchTime ()
| FieldedSearchWeightScale ($SearchStrings)
| UpdateForItem ($ItemId)
| UpdateForItems ($StartingItemId, $NumberOfItems)
| DropItem ($ItemId)
| DropField ($FieldName)
| SearchTermCount ()
| ItemCount ()
| AddSynonyms ($Word, $Synonyms)
| Add synonyms. More...
| RemoveSynonyms ($Word, $Synonyms=NULL)
| RemoveAllSynonyms ()
| GetSynonyms ($Word)
| GetAllSynonyms ()
| SetAllSynonyms ($SynonymList)
| LoadSynonymsFromFile ($FileName)
| Load synonyms from a file. More...
| SuggestAlternateSearches ($SearchString)

## Static Public Member Functions
static | GetItemIdsSortedByField ($FieldName, $SortDescending)
static | QueueUpdateForItem ($ItemId, $TaskPriority=ApplicationFramework::PRIORITY_LOW)
static | RunUpdateForItem ($ItemId)
static | GetResultFacets ($SearchResults)
| 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 | STEM_ID_OFFSET = 1000000
const | SEARCHLOGIC_AND = 1
const | SEARCHLOGIC_OR = 2
Protected Member Functions inherited from SearchEngine
| GetFieldId ($FieldName)
| SearchFieldForPhrases ($FieldName, $Phrase)
| FilterOnSuppliedFunctions ($Scores)
| GetFieldContent ($ItemId, $FieldName)
| DMsg ($Level, $Msg)
Protected Attributes inherited from SearchEngine
| $DB
| $DebugLevel
| $ItemTableName
| $ItemIdFieldName
| $ReferenceTableName
| $ReferenceSourceIdFieldName
| $ReferenceDestinationIdFieldName
| $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
| ) |  |

Definition at line 80 of file SPTSearchEngine.php.

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

Definition at line 579 of file SPTSearchEngine.php.

static SPTSearchEngine::GetResultFacets | ( |  | $SearchResults | ) |
| static

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

Parameters

  $SearchResults | A set of results from a from which to generate facets.

Returns
  An array of suggestions. Keys are the field names and values are arrays of (ValueId => SuggestedValue)

Definition at line 646 of file SPTSearchEngine.php.

References SearchEngine\$DB, and MetadataSchema\MDFSTAT_OK.

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

Definition at line 585 of file SPTSearchEngine.php.

static SPTSearchEngine::RunUpdateForItem | ( |  | $ItemId | ) |
| static

Definition at line 596 of file SPTSearchEngine.php.

References SearchEngine\$DB, and SPTSearchEngine().

SPTSearchEngine::SearchFieldForPhrases | ( |  | $FieldName,
|  |  | $Phrase
| ) |  |

Definition at line 90 of file SPTSearchEngine.php.

References SearchEngine\DebugLevel(), SearchEngine\DMsg(), MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FILE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_IMAGE, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, MetadataSchema\MDFTYPE_URL, and MetadataSchema\MDFTYPE_USER.

SPTSearchEngine::SearchFieldsForComparisonMatches | ( |  | $FieldNames,
|  |  | $Operators,
|  |  | $Values
| ) |  |

Definition at line 220 of file SPTSearchEngine.php.

References SearchEngine\DefaultSearchLogic(), SearchEngine\DMsg(), MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FILE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_IMAGE, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, MetadataSchema\MDFTYPE_URL, and MetadataSchema\MDFTYPE_USER.

SPTSearchEngine::SPTSearchEngine | ( |  | ) |

Definition at line 12 of file SPTSearchEngine.php.

References SearchEngine\$DB, SearchEngine\AddField(), MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FILE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_IMAGE, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_POINT, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, MetadataSchema\MDFTYPE_URL, MetadataSchema\MDFTYPE_USER, and SearchEngine\SearchEngine().

Referenced by RunUpdateForItem().

Here is the caller graph for this function:

SPTSearchEngine::UpdateForResource | ( |  | $ItemId | ) |

Definition at line 754 of file SPTSearchEngine.php.

References SearchEngine\UpdateForItem().

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

- objects/SPTSearchEngine.php