$queryEntered = $_POST['query'];
 $cleanedQuery = cleanQuery($queryEntered);
 //******************************************************************************
 //Turn off Warning-reporting for the following warning on CSSERVER:
 //Warning: file_get_contents() [function.file-get-contents]:
 //              SSL: fatal protocol error in ...
 //error_reporting(E_ERROR | E_PARSE);
 error_reporting(0);
 //******************************************************************************
 //******************************************************************************
 //IF WORD SUGGESTIONS HAVE BEEN REQUESTED DISPLAY ALTERNATIVES
 if (isset($_POST['reWrite']) && $_POST['reWrite'] != '') {
     //ONLY WANT THE FIRST WORD FOR OUR LOOKUP
     $firstQueryWord = getFirstWord($cleanedQuery);
     //LOOKUP THE WORD
     getSynonyms($firstQueryWord, $synonyms);
     //INCLUDE PHP FUNCTION WHICH CREATES A FORM BASED ON THE SYNONYM ARRAY
     include 'functions/synonymForm.php';
     //RUN FUNCTION TO CREATE FORM OF SYNONYMS
     listSynonyms($synonyms);
 } else {
     //IF REWRITE IS NOT REQUESTED, PROCESS QUERY:
     //CALL FUNCTIONS TO GET RESULTS FROM SEARCH ENGINES
     getBlekkoResults($blekkoResultsOrig);
     //get Blekko
     getGoogleResults($googleResultsOrig);
     //get Google
     getBingResults($bingResultsOrig);
     //get Bing
     //**************************************************************************
     //**************************************************************************
Esempio n. 2
0
require_once 'includes/clusteringFunctions.php';
require_once 'includes/evaluationFunctions.php';
require_once 'includes/complexSearchFunctions.php';
require_once 'includes/displayModuleFunctions.php';
// Initialize the session
if (!isset($_SESSION)) {
    session_start();
}
// Get data
if (isset($_GET['searchText'])) {
    $search = $_GET['searchText'];
    if (isset($_GET['submit'])) {
        // Tokenise search string and remove punctuation
        $searchExploded = tokeniseQuery($search);
        // Query Re-write Engine using global method: Query Expansion
        $synonyms = getSynonyms($searchExploded);
        // Query Pre-processing Module and Complex Search Ability
        if (isset($_GET['RadioGroup2'])) {
            $radioGroup2 = $_GET['RadioGroup2'];
            // If stemming is set to off
            if ($radioGroup2 == 'stemmingOff') {
                // Do boolean search if there are operators
                $operators = array("AND", "and", "OR", "or", "NOT", "not");
                /*	foreach ( $searchExploded as $value )
                				{
                					if ( in_array( $value , $operators ))
                					{
                						$searchExploded = booleanQuery( $searchExploded ); 	
                					}
                					$search = implode( " " , $searchExploded );
                				}