Jump to content

full text search on multiple columns


mehdi_php

Recommended Posts

hi ,

i want to perform  fulltext search on to tables ( news , articles )

 

so i do that

1.

alter table xxnews add fulltext(xnewstitle , xnewsbody ) ;

2.

alter table xxarticle add fulltext(xarticletitle , xarticlebody ) ;

 

and try to search like this

select * from xxnews where match(xnewstitle , xnewsbody) against('test') 
union 
select * from xxarticle where match(xarticletitle , xarticlebody) against ('test') ;

 

but i got an error :the used select statements have different number of columns

i can't find the way to fix it . also this two table have no relation with each other .

i think fulltext search can be perform on multiple tables if they have relation with each other .

 

Link to comment
https://forums.phpfreaks.com/topic/131402-full-text-search-on-multiple-columns/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.