Thanks for the reply!
here is my code
$query = $modx->newQuery('Tblbook');
$query->select(array (
'Tblbook.system_product_id',
'Tblbook.system_brand_id',
'Tblbook.brand_name',
'Tsearch.content',
'Tblbook.company',
'Tblbook.form_class',
'Tgen.system_generic_id',
'Tsec1.section1_id',
'Tsec2.section2_id',
'Tsec3.section3_id',
'Tsec4.section4_id'
));
$query->innerJoin('Tablesearch', 'Tsearch', array("Tblbook.system_brand_id = Tsearch.system_brand_id"));
$query->innerJoin('Tblbrandgenericgroupsms','Tgen',array("Tblbook.system_brand_id = Tgen.system_brand_id"));
$query->innerJoin('Tblproductsections', 'Tprodsec', array(" Tblbook.system_product_id = Tprodsec.system_product_id"));
$query->leftJoin('Tblsection', 'Tsec', array(" Tprodsec.system_section_id = Tsec.system_section_id"));
$query->leftJoin('Tblsection1', 'Tsec1', array(" Tsec.system_section1_id = Tsec1.system_section1_id"));
$query->leftJoin('Tblsection2', 'Tsec2', array(" Tsec.system_section2_id = Tsec2.system_section2_id"));
$query->leftJoin('Tblsection3', 'Tsec3', array(" Tsec.system_section3_id = Tsec3.system_section3_id"));
$query->leftJoin('Tblsection4', 'Tsec4', array(" Tsec.system_section4_id = Tsec4.system_section4_id"));
$query->where(array(
array(
"Tsearch.brand_name:LIKE" => "%$xkeywordx%",
"OR:Tsearch.company:LIKE" => "%$xkeywordx%",
array(
"OR:Tsearch.content:LIKE" => "%$xkeywordx%",
"OR:Tsearch.long_indication:LIKE" => "%$xkeywordx%",
),
),
));
$query->groupBy('brand_name');
$query->limit('50');
$products = $modx->getCollection('Tblbook',$query);
I've also try this one but same slow results and also data display is not that accurate
$search = $modx->quote($xkeywordx, PDO::PARAM_STR);
$query = $modx->newQuery('Tblbook');
$query->select(array (
'Tblbook.system_product_id',
'Tblbook.system_brand_id',
'Tblbook.brand_name',
'Tbooks.content',
'Tblbook.company',
'Tblbook.form_class',
'Tgen.system_generic_id',
'Tsec1.section1_id',
'Tsec2.section2_id',
'Tsec3.section3_id',
'Tsec4.section4_id',
"MATCH(Tblbook.brand_name, Tblbook.company)AGAINST ($search IN BOOLEAN MODE)",
"MATCH(Tbooks.content, Tbooks.long_indication) AGAINST ($search IN BOOLEAN MODE)"
));
$query->innerJoin('Tblbooks', 'Tbooks', array("Tblbook.system_brand_id = Tbooks.system_brands_id"));
$query->innerJoin('Tblbrandgenericgroupsms','Tgen',array("Tblbook.system_brand_id = Tgen.system_brand_id"));
$query->innerJoin('Tblproductsections', 'Tprodsec', array(" Tblbook.system_product_id = Tprodsec.system_product_id"));
$query->leftJoin('Tblsection', 'Tsec', array(" Tprodsec.system_section_id = Tsec.system_section_id"));
$query->leftJoin('Tblsection1', 'Tsec1', array(" Tsec.system_section1_id = Tsec1.system_section1_id"));
$query->leftJoin('Tblsection2', 'Tsec2', array(" Tsec.system_section2_id = Tsec2.system_section2_id"));
$query->leftJoin('Tblsection3', 'Tsec3', array(" Tsec.system_section3_id = Tsec3.system_section3_id"));
$query->leftJoin('Tblsection4', 'Tsec4', array(" Tsec.system_section4_id = Tsec4.system_section4_id"));
$query->where(array("MATCH(Tblbook.brand_name, Tblbook.company)AGAINST ($search IN BOOLEAN MODE)",
"MATCH(Tbooks.content, Tbooks.long_indication) AGAINST ($search IN BOOLEAN MODE)")
);
$query->groupBy('brand_name');
$query->limit('50');
$products = $modx->getCollection('Tblbook',$query);