include/SugarSearchEngine/Elastic/Elastica/Util.php

Show: inherited
Table of Contents

Elastica tools

Author
Nicolas Ruflin  
Author
Thibault Duplessis  
Author
Oleg Zinchenko  
Category
Xodoa  
Package
Elastica  

\Elastica_Util

Package: Elastica

Elastica tools

Author
Nicolas Ruflin  
Author
Thibault Duplessis  
Author
Oleg Zinchenko  
Category
Xodoa  

Methods

methodpublicconvertDate( int $date ) : string
static

Converts given time to format: 1995-12-31T23:59:59Z

This is the lucene date format

Parameters
Name Type Description
$date int

Date input (could be string etc.) -> must be supported by strtotime

Returns
Type Description
string Converted date string
methodpublicescapeTerm( string $term ) : string
static

Escapes the following terms (because part of the query language) + - && || ! ( ) { } [ ] ^ " ~ * ? : \

Parameters
Name Type Description
$term string

Query term to escape

Returns
Type Description
string Escaped query term
Details
Link
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping%20Special%20Characters  
methodpublicreplaceBooleanWords( string $term ) : string
static

Replace the following reserved words (because part of the query language) AND OR NOT

Parameters
Name Type Description
$term string

Query term to replace

Returns
Type Description
string Replaced query term
Details
Link
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boolean%20operators  
methodpublicreplaceBooleanWordsAndEscapeTerm( string $term ) : string
static

Replace the following reserved words: AND OR NOT and escapes the following terms: + - && || ! ( ) { } [ ] ^ " ~ * ? : \

Parameters
Name Type Description
$term string

Query term to replare and escape

Returns
Type Description
string Replaced and escaped query term
Details
Link
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boolean%20operators  
Link
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping%20Special%20Characters  
methodpublictoCamelCase( string $string ) : string
static

Converts a snake_case string to CamelCase

For example: hello_world to HelloWorld

Parameters
Name Type Description
$string string

snake_case string

Returns
Type Description
string CamelCase string
methodpublictoSnakeCase( string $string ) : string
static

Converts a CamelCase string to snake_case

For Example HelloWorld to hello_world

Parameters
Name Type Description
$string string

CamelCase String to Convert

Returns
Type Description
string SnakeCase string
Documentation was generated by DocBlox 0.18.1.