BING searchWeb API OR运算符使用疑问及精准查询需求
Let’s break down your questions clearly, based on how Bing’s SearchWeb API handles operators:
1. Will the query a b c OR d e return pages with "a b c e" or "a b d e"?
Absolutely yes. Here’s the breakdown:
- The
ORoperator acts as a logical separator between two sets of required terms. Your query translates to: pages that contain all of a, b, c OR pages that contain all of d, e. - A page with "a b c e" includes all three terms a, b, c — so it meets the first condition and will be returned.
- A page with "a b d e" includes both d and e — so it meets the second condition and will also be returned.
2. How to find pages that contain both "a b c" AND "d e"?
To get pages that include both term groups, use the AND operator to link the two sets. Your query should be:
a b c AND d e
This tells the API to only return pages that satisfy both requirements: containing all of a, b, c and containing all of d, e.
Why doesn’t (a b c) OR (d e) work?
As you noted, parentheses in Bing’s API aren’t used for logical grouping. They’re reserved for specific syntax like site-specific searches (e.g., (site:example.com)) or other scope-limiting operations. Wrapping term groups in parentheses won’t enforce the OR logic you expect, and will likely lead to unexpected results or invalid query parsing.
内容的提问来源于stack exchange,提问作者David Portabella

