Modify Search Text Field Results
I have a db table with a column "file_name" that i would like to display search results differently than the default webassit method.
For example: my search page has a single text box to search "file_name" which is a lengthly description of a file. The file_name characters are all upper case letters and numbers, and includes important key word descriptions like "make" "model" "machine type" "year". A direct example would be "MASSEY FERGUSON 390 TRACTOR BEFORE SERIAL NUMBER B123456789 PARTS MANUAL"
I would like to make the text field input to search and display the same result if one would enter "MASSEY 390" or "390 MASSEY" or "MASSEYFERGUSON 390" or "MASSEY FERGUSON 390" without directly inputing wildcards. Is this possible? Here is my search code:
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAforsale;
//Searchpage: forsale_Search.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((isset($_GET["Search_x"]) && $_GET["Search_x"] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
//comparison list additions
$WADbSearch1->addComparisonFromEdit("file_name","S_file_name","AND","Includes",0);
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_forsale_Results"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_forsale_Results"]) && $_SESSION["WADbSearch1_forsale_Results"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_forsale_Results"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>