I want to create sphinx search for the following table structure:
CREATE TABLE IF NOT EXISTS `books` ( `productID` varchar(20) NOT NULL, `productName` varchar(256) NOT NULL, `ISBN` varchar(20) NOT NULL, `author` varchar(256) DEFAULT NULL, `productPrice` float(10,2) NOT NULL, `discount` float(10,2) NOT NULL, `brandID` int(11) NOT NULL, `qty` int(11) NOT NULL, `status` tinyint(1) NOT NULL, PRIMARY KEY (`productID`), KEY `status` (`status`), KEY `ISBN` (`ISBN`), KEY `author` (`author`), KEY `brandID` (`brandID`), KEY `books_index` (`productName`) ) ENGINE=innodb DEFAULT CHARSET=latin1;
I cannot change the productID column in the table above.
i have dependency tables for author and Brands
CREATE TABLE IF NOT EXISTS `authors` ( `authorID` ini(11) NOT NULL, `author_name` varchar(256) NOT NULL PRIMARY KEY (`authorID`) ) ENGINE=innodb DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `brands` ( `brandID` ini(11) NOT NULL, `brandName` varchar(256) NOT NULL PRIMARY KEY (`brandID`) ) ENGINE=innodb DEFAULT CHARSET=latin1;
please some of them provide configuration for sphinx search.
I am using the following configuration.
source src1 { type = mysql sql_query = SELECT CRC32(productID) as productid,productID,productName,ISBN,brandID,author FROM sapna_ecom_products sql_attr_uint = productID sql_field_string = ISBN sql_field_string = productName sql_field_string = brandID sql_attr_multi = uint brandID from field; SELECT brandID,brandName FROM sapna_ecom_brands sql_attr_multi = uint author from field; SELECT authorID,author_name FROM sapna_ecom_authors sql_query_info = SELECT productID,productName,ISBN,brandID,author FROM sapna_ecom_products WHERE CRC32(productID)=$id }
I get results if I search for productName but not for author and brand
My goal is to get results if the user searches the productName or author or brand buttons
Please give me a suitable configuration.
thanks..