Search code examples
bing-api

BING searchWeb API OR operator


https://msdn.microsoft.com/en-us/library/ff795643.aspx

OR: Finds webpages that contain either the term that precedes the operator or the term that follows the operator. Same as | and ||.

So, the query a b c OR d e will return results for a b c e and a b d e, right?

How can I find results for a b c and d e?

I tried with (a b c) OR (d e), but it does not work. The parenthesis are used for something else:

https://msdn.microsoft.com/en-us/library/ff795621.aspx

In combination with ), operator for term separation and precedence. Examples As Operator: foo(bar)blue

I could use "a b c" OR "d e", but then "a b c" should be exact query, which I do not want:

https://msdn.microsoft.com/en-us/library/ff795609.aspx

"phrase”: Returns results that contain the specified phrase, exactly.

How can I find results for a b c and d e?

of course, I could make 2 separated API queries, but we pay twice for that.


Solution

  • according to this other page, we can use parenthesis, such as (foo & bar) | (bing & yahoo), so this solves the problem.

    https://msdn.microsoft.com/en-us/library/ff795639.aspx

    (a b c) | (d e)