include/SugarSearchEngine/SugarSearchEngineSyncIndexer.php

Show: inherited
Table of Contents

\SugarSearchEngineSyncIndexer

Package: SugarCRM

Indexer job for Search to sync records

Parent(s)
\SugarSearchEngineIndexerBase < \RunnableSchedulerJob
Api
 

Constants

Constant  MAX_BULK_THRESHOLD = 5000
inherited

The max number of beans we process before starting to bulk insert so we dont hit memory issues.

Inherited from: \SugarSearchEngineIndexerBase::MAX_BULK_THRESHOLD
Constant  MAX_BULK_QUERY_THRESHOLD = 15000
inherited

The max number of beans we process before starting to bulk insert so we dont hit memory issues.

Inherited from: \SugarSearchEngineIndexerBase::MAX_BULK_QUERY_THRESHOLD
Constant  MAX_BULK_DELETE_THRESHOLD = 3000
inherited

The max number of beans we delete at a time

Inherited from: \SugarSearchEngineIndexerBase::MAX_BULK_DELETE_THRESHOLD
Constant  POSTPONE_JOB_TIME = 20
inherited

Number of time to postpone a job by so it's not executed twice during the same request.

Inherited from: \SugarSearchEngineIndexerBase::POSTPONE_JOB_TIME
Constant  QUEUE_TABLE = 'fts_queue'
inherited

The name of the queue table

Inherited from: \SugarSearchEngineIndexerBase::QUEUE_TABLE

Properties

Propertyprotected\SugarSearchEngineAbstractBase  $SSEngine= ''
Propertyprotected\DBManager  $db= ''
inherited

Inherited from: \SugarSearchEngineIndexerBase::$$db
Details
Type
\DBManager
Inherited_from
\SugarSearchEngineIndexerBase::$$db  
Propertyprotected\SchedulersJob  $schedulerJob= ''
Propertyprotected\table_name  $table_name= ''
Details
Type
\table_name
Inherited_from
\SugarSearchEngineIndexerBase::$$table_name  

Methods

methodpublic__construct( \SugarSearchEngineAqbstractBase $engine = null ) : void
Parameters
Name Type Description
$engine \SugarSearchEngineAqbstractBase
methodpublic__get(  $name ) : void
inherited

Inherited from: \SugarSearchEngineIndexerBase::__get()
Parameters
Name Type Description
$name
methodpubliccreateJobQueueConsumer( ) : String

Create a job queue FTS consumer for a specific module

Returns
Type Description
String Id of newly created job
methodprotectedgenerateFTSQuery(  $module,  $fieldDefinitions ) : string
inherited

Generate the query necessary to retrieve FTS enabled fields for a bean.

Inherited from: \SugarSearchEngineIndexerBase::generateFTSQuery()
Parameters
Name Type Description
$module
$fieldDefinitions
Returns
Type Description
string
methodpublicindexRecords( String $module, array $fieldDefinitions ) : integer

Index records into search engine

Parameters
Name Type Description
$module String

module

$fieldDefinitions array

fieldDefinitions

Returns
Type Description
integer number of indexed records, -1 if fails
methodprotectedmarkBeansProcessed( \$beanIDs $beanIDs ) : void
inherited

Given a set of bean ids processed from the queue table, mark them as being processed. We will throttle the update query as there is a limit on the size of records that can be passed to an in clause yet we don't want to update them individually for performance reasons.

Inherited from: \SugarSearchEngineIndexerBase::markBeansProcessed()
Parameters
Name Type Description
$beanIDs \$beanIDs

array of bean ids to delete

methodpublicremoveExistingFTSSyncConsumer( ) : void

Remove existing FTS Consumers that may have been created by a previous scheduled index.

methodpublicrun(  $data ) : void

Main function that handles the indexing of a bean and is called by the job queue system.

Subclasses should implement their own logic.

Parameters
Name Type Description
$data
methodprivatesetBeanIDsProcessed(  $deleteIDs ) : void
inherited

Internal function to mark records within queue table as processed.

Inherited from: \SugarSearchEngineIndexerBase::setBeanIDsProcessed()
Parameters
Name Type Description
$deleteIDs
methodpublicsetJob( \SchedulersJob $job ) : void
inherited

Set the scheduler job that initiated the run call.

Inherited from: \SugarSearchEngineIndexerBase::setJob()
Parameters
Name Type Description
$job \SchedulersJob
methodprotectedupdateFTSServerStatus( ) : boolean

Check FTS server status and update cache file and notification.

Returns
Type Description
boolean
Documentation was generated by DocBlox 0.18.1.