Splitting up search keywords for search engine
Posted: Thu Sep 23, 2004 8:27 am
Hi,
I am trying to build an abbreviations search system. I have the Mysql database set up. People type in keywords and it searches the database for them. At the moment people are using a mixture of boolean commands and commas to separate their search terms. What I would like to know is which PHP command is best to separate those off?
So if someone was to search for:
bnm AND ghj OR pok NOT fda
Also people may search using commas (I am making it so that a comma would mean 'AND' in boolean). So:
bnm, ghj
I am currently using STRTOK to go through and find the spaces and look what is after them. It then creates the Mysql query as it goes through. But this seems overly complex. Is there another command that I could use instead?
Thanks
Alastair
I am trying to build an abbreviations search system. I have the Mysql database set up. People type in keywords and it searches the database for them. At the moment people are using a mixture of boolean commands and commas to separate their search terms. What I would like to know is which PHP command is best to separate those off?
So if someone was to search for:
bnm AND ghj OR pok NOT fda
Also people may search using commas (I am making it so that a comma would mean 'AND' in boolean). So:
bnm, ghj
I am currently using STRTOK to go through and find the spaces and look what is after them. It then creates the Mysql query as it goes through. But this seems overly complex. Is there another command that I could use instead?
Thanks
Alastair