Full Text Search...

i have used a sql query using FullText search functionality in mySql…

this is the cord…

$query ="SELECT itemID,txtname,intmanufacture_partno,inttaxID FROM table WHERE MATCH (txtname,txtdescription,txtlongdescription) AGAINST ('$searchword')";

it searches text as i need…

but when the $searchword equals to non meaningful word the query returns 0 records…

eg: $searchword=‘pw’;

can anyone tell me why this happens?

thanks in advance…

http://dev.mysql.com/doc/refman/4.1/en/ … earch.html

Thank u very much…

it helps me a lot…

thanks again…

i am trying to use full text search, to search by keyword(textbox) and by brand(combobox)…

if i needs to search some word that contains in all brands hw do i do?

my code is something like this…

[php]if($searchword!=’’ && $_GET[‘cat’]!=‘all’){
$searchword=$searchword." ".$_GET[‘cat’];

}[/php]

$_GET[‘cat’] is combo box value…

all brand==‘all’

this might b something like sloppy things to u…

but pls help me

[size=99px]edit Q1712: canged [code] to [php][/size]

i woundn’t include the cat in the fultextsearch, but use a and. u may use the id as values of that combobox as well.

[php]
$query =‘SELECT itemID,txtname,intmanufacture_partno,inttaxID FROM table WHERE MATCH (txtname,txtdescription,txtlongdescription) AGAINST ("’.mysql_escape_string($searchword).’")’;

if($_GET[‘cat’]!=‘all’){
$query .= " AND catID=".intval($_GET[‘cat’]);
}
[/php](to be adjusted to ur needs)

hope this helps.

thanks…

if cat_ID is not in the full text search enabled table…

i think your code will go wrong…

if u have a yahoo msnger ID can i have it…

its better to contact u… thanks…

my yahoo id is mhmdsha7

that dosn’t matter, only the fields included in MACH() have to be in the fulltext index.

Now i have certain amount of idea how the fulltext search works…

but am having a problem…

in my database there about 50 records…

and it has names such as TRUST,Epson and so on.

but when i try to search TRUST it returns 0 record…but works for Epson smoothly…

can u think of what got wrong…???

Sponsor our Newsletter | Privacy Policy | Terms of Service