I have a mysql fulltext question. Refrence on: http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html
SELECT * FROM table WHERE (MATCH (aindex,bindex) AGAINST ('(+apple +juice)' IN BOOLEAN MODE))
This return 14 items
SELECT * FROM table WHERE (MATCH (aindex,bindex) AGAINST ('(+apple +pie)' IN BOOLEAN MODE))
This return 36 items
SELECT * FROM table WHERE (MATCH (aindex,bindex) AGAINST ('(+apple +pie)|(+apple +juice)' IN BOOLEAN MODE))
This return 1910 items, obviously, my query has problem. How to search words exactly contains (+apple +pie) and (+apple +juice)? I think it should be return 14+36=50items
And in my purpose, I need a union search for
(+apple +pie) (+apple +juice) (+apple +macintosh) (+apple +turnover) (+apple +strudel) (+pear +pie) (+pear +juice) (+pear +macintosh) (+pear +turnover) (+pear +strudel)
it should be return nearly 520 items. Thanks.
This should be what you want:
ETA: Missed the pear clauses my first read through. To get all the ones you listed I think this should work:
That should translate into “must contain apple and one of pie, juice, macintosh, turnover, or strudel OR pear and one of pie, juice, macintosh, turnover, or strudel.
If that doesn’t work I would do this: