1 (edited by chrizz 2005-01-29 07:52)

Topic: Search string processing. "apple AND orange" to "+apple +orange"

Hi!

I want to search in boolean mode in mysql and need to make it user friendly.

Examples of search phrases I want to make:

"apple AND pear NO orange" should give "+apple +pear -orange"
"apple pear NO orange" -> "+apple +pear -orange"
"apple OR pear NO orange" -> "apple pear -orange"
"apple NO pear AND orange" -> "+apple -pear +orange"

and so on....

Any script suggestions?

edit: i dont want the user to be able to write "apple pear orange" and then the search returns everything containing apple pear or orange, a search only for "apple pear orange" should result in a search after "+apple +pear +orange".