How would one write a query which should perform set union on the search terms (term1 OR term2 OR term3), and yet also perform phrase matching if both terms are found? I tried a few variants of the following, but in every case I am getting set intersection on the search terms:
select?q={!q.op=OR}text:"term1 term2"~100000 Thus, if term1 matches 10 documents and term2 matches 20 documents, then SET UNION would include all of the documents that have either term1 and/or term2. That means that between 20-30 results should be returned. Conversely, SET INTERSECTION would return only results with _both_ term1 _and_ term2, which could be between 0-10 documents. Note that in the application, users will be searching for any arbitrary number of terms, in fact they will be entering phrases. I can limit these phrases to 140 characters if needed. Thank you in advance! -- Dotan Cohen http://gibberish.co.il http://what-is-what.com