include/SugarSearchEngine/SugarSearchEngineMappingHelper.php

Show: inherited
Table of Contents

\SugarSearchEngineMappingHelper

Package: SugarCRM

Helper class for search engine mappings

Api
 

Properties

Propertyprotectedarray  $ftsEnabledFieldTypes= 'array('name', 'user_name', 'varchar', 'decimal', 'float', 'int', 'phone', 'text', 'url')'
static

this defines the field types that can be enabled for full text search

Default valuearray('name', 'user_name', 'varchar', 'decimal', 'float', 'int', 'phone', 'text', 'url')Details
Type
array
Propertyprotectedarray  $mappingMap= 'array ( 'Elastic' => array ( 'boost' => 'boost', 'analyzer' => 'analyzer', 'type' => 'type', ), )'
static

mapping map This defines the vardefs to search engine mapping.

Technically we only need to define them if the vardef name is different from the search engine mapping name. But it won't hurt to define them even if they are the same.

Default valuearray ( 'Elastic' => array ( 'boost' => 'boost', 'analyzer' => 'analyzer', 'type' => 'type', ), )Details
Type
array
Propertyprivatearray  $typeMap= 'array( 'Elastic' => array ( // searching string in non string types seems to cause elastic to return 500 error // for example, search 'aaa' in case_number field (type=long) when no data indexed causes error // we also need to figure out how date works with date format // so use only strings for now /* 'type' => array( 'bool' => 'boolean', 'int' => 'long', 'currency' => 'double', 'date' => 'date', 'datetime' => 'date', ), 'dbType' => array( 'decimal' => 'double', ), */ ), )'
static

non string type map sugar vardef type to search engine type mapping

Default valuearray( 'Elastic' => array ( // searching string in non string types seems to cause elastic to return 500 error // for example, search 'aaa' in case_number field (type=long) when no data indexed causes error // we also need to figure out how date works with date format // so use only strings for now /* 'type' => array( 'bool' => 'boolean', 'int' => 'long', 'currency' => 'double', 'date' => 'date', 'datetime' => 'date', ), 'dbType' => array( 'decimal' => 'double', ), */ ), )Details
Type
array

Methods

methodpublicgetMappingName( \$name $name, \$sugarName $sugarName ) : string
static

Given a search engine name and a vardef name, this function returns corresponding search engine map type.

Parameters
Name Type Description
$name \$name

search engine name

$sugarName \$sugarName

vardef name

Returns
Type Description
string search engine map name, or the original name if the mapping is not found
methodpublicgetTypeFromSugarType( \$name $name, \$fieldDefs $fieldDef ) : string
static

This function returns search engine dependent field type.

Parameters
Name Type Description
$name \$name

search engine name

$fieldDef \$fieldDefs

array of field definitions

Returns
Type Description
string search engine dependent type
methodpublicisTypeFtsEnabled( \$type $type ) : boolean
static

Given a field type, determine whether this type can be enabled for full text search.

Parameters
Name Type Description
$type \$type

field type

Returns
Type Description
boolean whether the field type can be enabled for full text search
methodpublicshouldShowModule( \$moduleName $moduleName ) : boolean
static

Given a modulename, determine whether this module can be enabled for full text search.

Parameters
Name Type Description
$moduleName \$moduleName

module name

Returns
Type Description
boolean whether the module can be enabled for full text search
Documentation was generated by DocBlox 0.18.1.