WIKINDX API 6.4.7

PARSEPHRASE
in package

PARSEPHRASE -- break up a search phrase into component parts such as 'exact phrase', AND, OR and NOT

Table of Contents

$attachmentSearch  : mixed
booolean
$browserTabID  : mixed
string
$db  : mixed
object
$errors  : mixed
object
$NOTfragments  : mixed
array
$session  : mixed
object
$stringArray  : mixed
array
$useRegex  : mixed
array
createCondition()  : string
Create the condition clause formatted for LIKE/REGEXP and store search highlighting in the session
createConditionFT()  : string
Create the condition clause for FULL TEXT and store search highlighting in the session
extractExactPhrase()  : mixed
extract all fragment elements until end of exact phrase is found
malformedString()  : bool
check for malformed search strings -- i.e. odd no. of " chars
printFragments()  : mixed
Neatly print the elements of the quoteFragments array -- for debugging purposes only
removeNot_and_FilterWords()  : mixed
Remove any NOT words that are listed as AND or OR and any words to be filtered
sortFragments()  : mixed
loop through $fragments sorting into 'exact phrase', AND fragments, NOT fragments and OR fragments
splitSpaces()  : string
split up search string on single spaces
tidyFragment()  : mixed
For all AND, OR or NOT fragments, tidy the input so we have something usable
tidySearch()  : string
Return words governed by AND, OR or NOT

Properties

$attachmentSearch

booolean

private mixed $attachmentSearch

$browserTabID

string

private mixed $browserTabID = FALSE

Methods

createCondition()

Create the condition clause formatted for LIKE/REGEXP and store search highlighting in the session

private createCondition(array<string|int, mixed> $input, bool $test) : string
Parameters
$input : array<string|int, mixed>
$test : bool

If TRUE, we are just testing the parsing

Return values
string

createConditionFT()

Create the condition clause for FULL TEXT and store search highlighting in the session

private createConditionFT(string $input, bool $partial) : string
Parameters
$input : string
$partial : bool
Return values
string

extractExactPhrase()

extract all fragment elements until end of exact phrase is found

private extractExactPhrase(string $fragment, array<string|int, mixed> &$fragments, int $searchArrayIndex) : mixed
Parameters
$fragment : string
$fragments : array<string|int, mixed>

Reference to array

$searchArrayIndex : int
Return values
mixed

malformedString()

check for malformed search strings -- i.e. odd no. of " chars

private malformedString(string $phrase) : bool
Parameters
$phrase : string
Return values
bool

printFragments()

Neatly print the elements of the quoteFragments array -- for debugging purposes only

private printFragments(array<string|int, mixed> $fragments) : mixed
Parameters
$fragments : array<string|int, mixed>
Return values
mixed

removeNot_and_FilterWords()

Remove any NOT words that are listed as AND or OR and any words to be filtered

private removeNot_and_FilterWords() : mixed
Return values
mixed

sortFragments()

loop through $fragments sorting into 'exact phrase', AND fragments, NOT fragments and OR fragments

private sortFragments(array<string|int, mixed> $fragments) : mixed
Parameters
$fragments : array<string|int, mixed>
Return values
mixed

splitSpaces()

split up search string on single spaces

private splitSpaces(string $phrase) : string
Parameters
$phrase : string
Return values
string

tidyFragment()

For all AND, OR or NOT fragments, tidy the input so we have something usable

private tidyFragment(string $fragment, array<string|int, mixed> &$fragments, int $searchArrayIndex[, string $type = FALSE ]) : mixed
Parameters
$fragment : string
$fragments : array<string|int, mixed>

Reference to array

$searchArrayIndex : int
$type : string = FALSE

Default is FALSE

Return values
mixed

tidySearch()

Return words governed by AND, OR or NOT

private tidySearch(string $phrase) : string
Parameters
$phrase : string
Return values
string

Search results