Class Search
The Search class is responsible for building the WHERE part of the symptoms-search query
Category: Homeopathy
Copyright: 2007-2014 Henri Schumacher
License: GNU Affero General Public License v3
Author: Henri Schumacher <henri.hulski@gazeta.pl>
Located at include/classes/search_class.php
public
|
|
public
|
#
build_search( )
build_search is the central function of the Search class that builds the search query |
private
|
#
clean_whitespace( )
clean_whitespace removes whitespace at the beginning and end of the search string and double whitespace inside the search string |
private
|
#
delete_punctuation( )
delete_punctuation replaces punctuation inside the search string with a space |
private
|
#
encode_quotes( )
encode_quotes repaces quotes and escaped quotes in the search string with the escape character constant esc_chr |
private
|
#
decode_quotes( )
decode_quotes replaces the escape character constant esc_chr in the search string with a double quote |
private
|
#
extract_phrases( )
extract_phrases pulls quoted phrases from the search string and stores them in an array ($this->search_phrase) |
private
|
#
extract_search_not( )
extract_search_not pulls not desired words with a preceded '-' from the search string and stores them in an array ($this->search_not) |
private
|
#
extract_search_words( )
extract_search_words extract the remaining search words from the search string and stores them in an array ($this->search) |
private
|
#
build_phrases_search_query( )
build_phrases_search_query builds the SQL search query for the phrases search in regexp-mode |
private
|
#
build_search_not_query( )
build_search_not_query builds the SQL search query for not desired words in regexp-mode |
private
|
#
build_search_query( array|string & $search )
build_search_query builds the SQL search query in regexp-mode |
private
|
#
build_boolean_query( string $operator, array|string & $search )
build_boolean_query builds the SQL search query in boolean-mode |
private
|
#
dublicate_ss( string $search_ar_name )
dublicate_ss search for a 'ss' or 'ß' in the search string and dublicate them with the counterpart |
private
|
#
merge_dublicate_ss( string $search_ar_name, string $duplicate, integer $key )
merge_dublicate_ss creates the SQL query string for the dublicated search strings containing 'ss' or 'ß'. |
string |
esc_chr
|
'@' |
#
Escape character for encoding quotes |
public
string|array
|
$search |
|
#
The requested search string after an array with the search words |
private
boolean
|
$whole_word |
|
#
If true we're searching for whole words with boolean fulltext search. If false we're searching for parts of words with regular expressions. |
private
string
|
$and_or |
|
#
'AND'|'OR': If 'AND' the search result should contain all requested words/phrases, if 'OR' any requested words/phrases. |
private
string
|
$symptoms_tbl |
|
#
Symptoms table |
private
array|string
|
$search_phrase |
|
#
The phrases from the search request first as array later as string prepared for the SQL-query |
private
array|string
|
$search_not |
|
#
The words which the search result must not contain first as array later as string prepared for the SQL-query |
private
string
|
$mode |
|
#
'boolean'|'regexp': 'boolean' if we're using the boolean fulltext search 'regexp' for a search with regular expressions |
private
array
|
$dublicated_ss | array() |
#
Contains the dublicated requested words with ss or ß |