include/SugarSearchEngine/Elastic/Elastica/Util.php
Elastica tools
- Author
- Nicolas Ruflin
- Author
- Thibault Duplessis
- Author
- Oleg Zinchenko
- Category
- Xodoa
- Package
- Elastica
\Elastica_Util
Package: Elastica
Parameters
Returns
Parameters
Returns
Elastica tools
- Author
- Nicolas Ruflin
- Author
- Thibault Duplessis
- Author
- Oleg Zinchenko
- Category
- Xodoa
Methods

convertDate(
int $date
)
:
string
static
Converts given time to format: 1995-12-31T23:59:59Z
This is the lucene date format
| Name | Type | Description |
|---|---|---|
| $date | int | Date input (could be string etc.) -> must be supported by strtotime |
| Type | Description |
|---|---|
| string | Converted date string |

escapeTerm(
string $term
)
:
string
static
Escapes the following terms (because part of the query language) + - && || ! ( ) { } [ ] ^ " ~ * ? : \
Parameters
Returns
Details
| Name | Type | Description |
|---|---|---|
| $term | string | Query term to escape |
| Type | Description |
|---|---|
| string | Escaped query term |

replaceBooleanWords(
string $term
)
:
string
static
Replace the following reserved words (because part of the query language) AND OR NOT
Parameters
Returns
Details
| Name | Type | Description |
|---|---|---|
| $term | string | Query term to replace |
| Type | Description |
|---|---|
| string | Replaced query term |

replaceBooleanWordsAndEscapeTerm(
string $term
)
:
string
static
Replace the following reserved words: AND OR NOT and escapes the following terms: + - && || ! ( ) { } [ ] ^ " ~ * ? : \
Parameters
Returns
Details
| Name | Type | Description |
|---|---|---|
| $term | string | Query term to replare and escape |
| Type | Description |
|---|---|
| string | Replaced and escaped query term |

toCamelCase(
string $string
)
:
string
static
Converts a snake_case string to CamelCase
For example: hello_world to HelloWorld
| Name | Type | Description |
|---|---|---|
| $string | string | snake_case string |
| Type | Description |
|---|---|
| string | CamelCase string |