CWIS Developer Documentation
List of all members
TestSearchEngine Class Reference

Create a concrete class extending SearchEngine (which is abstract) for testing. More...

Inheritance diagram for TestSearchEngine:
Inheritance graph
[legend]
Collaboration diagram for TestSearchEngine:
Collaboration graph
[legend]

Additional Inherited Members

- Public Member Functions inherited from SearchEngine
 __construct ($ItemTableName, $ItemIdFieldName, $ItemTypeFieldName)
 Object constructor. More...
 
 AddField ($FieldId, $FieldType, $ItemTypes, $Weight, $UsedInKeywordSearch)
 Add field to include in searching. More...
 
 FieldType ($FieldId)
 Get type of specified field (text/numeric/date/daterange). More...
 
 FieldWeight ($FieldId)
 Get search weight for specified field. More...
 
 FieldInKeywordSearch ($FieldId)
 Get whether specified field is included in keyword searches. More...
 
 DebugLevel ($NewValue)
 Set debug output level. More...
 
 Search ($SearchParams)
 Perform search with specified parameters, returning results in a flat array indexed by item ID. More...
 
 SearchAll ($SearchParams)
 Perform search with specified parameters, returning results separated by item type. More...
 
 AddResultFilterFunction ($FunctionName)
 Add function that will be called to filter search results. More...
 
 NumberOfResults ($ItemType=NULL)
 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 ($SearchParams)
 Get total of weights for all fields involved in search, useful for assessing scale of scores in search results. More...
 
 UpdateForItem ($ItemId, $ItemType)
 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 ($FieldId)
 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 inherited from SearchEngine
static FlattenMultiTypeResults ($Results)
 Flatten a two-dimensional array keyed by ItemType with results for each type as the outer values into array(ItemId => ItemScore). More...
 
static BuildMultiTypeResults ($Results)
 Expand a one-dimensional array(ItemId => ItemScore) into a two-dimensional array(ItemType => array(ItemId => ItemScore)). More...
 
- 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 KEYWORD_FIELD_ID = -100
 
const STEM_ID_OFFSET = 1000000
 
const SEARCHLOGIC_AND = 1
 
const SEARCHLOGIC_OR = 2
 
const COMPARISON_OPERATOR_PATTERN = '/^([><=^$@]+|!=)([^><=^$@])/'
 
- Protected Member Functions inherited from SearchEngine
 SearchFieldForPhrases ($FieldId, $Phrase)
 Search for phrase in specified field. More...
 
 FilterOnSuppliedFunctions ($Scores)
 Filter search scores through any supplied functions. More...
 
 GetFieldContent ($ItemId, $FieldId)
 Retrieve content for specified field for specified item. More...
 
 DMsg ($Level, $Msg)
 Print debug message if level set high enough. More...
 
- Protected Attributes inherited from SearchEngine
 $DB
 
 $DebugLevel
 
 $FilterFuncs
 
 $ItemIdFieldName
 
 $ItemTableName
 
 $ItemTypeFieldName
 
 $LastSearchTime
 
 $NumberOfResultsAvailable
 
 $NumberOfResultsPerItemType
 
 $StemmingEnabled = TRUE
 
 $SynonymsEnabled = TRUE
 

Detailed Description

Create a concrete class extending SearchEngine (which is abstract) for testing.

Definition at line 185 of file SearchEngine--Test.php.


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